From 3b77fb74cf249011213816403980f3bb909c6f78 Mon Sep 17 00:00:00 2001 From: EntranceJew Date: Fri, 31 Jul 2015 15:37:25 -0400 Subject: [PATCH] Added libtheora. --- CMakeLists.txt | 10 + libs/libtheora-1.1/AUTHORS | 49 + libs/libtheora-1.1/CHANGES | 243 + libs/libtheora-1.1/CMakeLists.txt | 48 + libs/libtheora-1.1/COPYING | 28 + libs/libtheora-1.1/LICENSE | 18 + libs/libtheora-1.1/Makefile.am | 35 + libs/libtheora-1.1/README | 152 + libs/libtheora-1.1/SConstruct | 225 + libs/libtheora-1.1/autogen.sh | 130 + libs/libtheora-1.1/configure.ac | 531 ++ libs/libtheora-1.1/debian/changelog | 15 + libs/libtheora-1.1/debian/control | 24 + libs/libtheora-1.1/debian/copyright | 38 + .../debian/libtheora-dev.install | 5 + libs/libtheora-1.1/debian/libtheora0.install | 2 + libs/libtheora-1.1/debian/rules | 3 + libs/libtheora-1.1/debian/watch | 3 + libs/libtheora-1.1/doc/Doxyfile.in | 1142 +++ libs/libtheora-1.1/doc/Makefile.am | 72 + libs/libtheora-1.1/doc/color.html | 602 ++ .../doc/draft-ietf-avt-rtp-theora-00.txt | 1400 +++ .../doc/draft-ietf-avt-rtp-theora-00.xml | 1146 +++ .../doc/draft-kerr-avt-theora-rtp-00.txt | 1512 +++ .../doc/draft-kerr-avt-theora-rtp-00.xml | 1277 +++ libs/libtheora-1.1/doc/spec/Makefile.am | 81 + libs/libtheora-1.1/doc/spec/fdct.fig | 371 + libs/libtheora-1.1/doc/spec/hilbert-block.fig | 104 + libs/libtheora-1.1/doc/spec/hilbert-mb.fig | 32 + libs/libtheora-1.1/doc/spec/idct.fig | 369 + libs/libtheora-1.1/doc/spec/lflim.fig | 23 + libs/libtheora-1.1/doc/spec/ltablex.sty | 237 + libs/libtheora-1.1/doc/spec/macroblock.fig | 37 + libs/libtheora-1.1/doc/spec/pic-frame.fig | 75 + libs/libtheora-1.1/doc/spec/pic_even.fig | 102 + libs/libtheora-1.1/doc/spec/pic_even_odd.fig | 88 + libs/libtheora-1.1/doc/spec/pic_odd.fig | 90 + libs/libtheora-1.1/doc/spec/pic_odd_even.fig | 84 + libs/libtheora-1.1/doc/spec/pixel420.fig | 56 + libs/libtheora-1.1/doc/spec/pixel422.fig | 70 + libs/libtheora-1.1/doc/spec/pixel444.fig | 44 + libs/libtheora-1.1/doc/spec/raster-block.fig | 91 + .../doc/spec/reference-frames.fig | 46 + libs/libtheora-1.1/doc/spec/spec.bib | 120 + libs/libtheora-1.1/doc/spec/spec.tex | 8194 +++++++++++++++++ libs/libtheora-1.1/doc/spec/superblock.fig | 72 + libs/libtheora-1.1/doc/spec/vp3huff.c | 918 ++ libs/libtheora-1.1/doc/spec/xifish.fig | 85 + libs/libtheora-1.1/doc/vp3-format.txt | 1305 +++ libs/libtheora-1.1/examples/Makefile.am | 41 + libs/libtheora-1.1/examples/README_SPLAYER | 21 + libs/libtheora-1.1/examples/dump_psnr.c | 1210 +++ libs/libtheora-1.1/examples/dump_video.c | 496 + libs/libtheora-1.1/examples/encoder_example.c | 1830 ++++ libs/libtheora-1.1/examples/getopt.c | 1055 +++ libs/libtheora-1.1/examples/getopt.h | 180 + libs/libtheora-1.1/examples/getopt1.c | 188 + libs/libtheora-1.1/examples/player_example.c | 887 ++ libs/libtheora-1.1/examples/png2theora.c | 942 ++ libs/libtheora-1.1/examples/splayer.c | 1107 +++ libs/libtheora-1.1/include/Makefile.am | 3 + libs/libtheora-1.1/include/theora/Makefile.am | 7 + libs/libtheora-1.1/include/theora/codec.h | 591 ++ libs/libtheora-1.1/include/theora/theora.h | 784 ++ libs/libtheora-1.1/include/theora/theoradec.h | 325 + libs/libtheora-1.1/include/theora/theoraenc.h | 500 + libs/libtheora-1.1/lib/Makefile.am | 177 + libs/libtheora-1.1/lib/Version_script | 53 + libs/libtheora-1.1/lib/Version_script-dec | 82 + libs/libtheora-1.1/lib/Version_script-enc | 43 + libs/libtheora-1.1/lib/analyze.c | 2701 ++++++ libs/libtheora-1.1/lib/apiwrapper.c | 166 + libs/libtheora-1.1/lib/apiwrapper.h | 54 + libs/libtheora-1.1/lib/bitpack.c | 111 + libs/libtheora-1.1/lib/bitpack.h | 60 + libs/libtheora-1.1/lib/cpu.c | 226 + libs/libtheora-1.1/lib/cpu.h | 34 + libs/libtheora-1.1/lib/dct.h | 31 + libs/libtheora-1.1/lib/decapiwrapper.c | 193 + libs/libtheora-1.1/lib/decinfo.c | 246 + libs/libtheora-1.1/lib/decint.h | 107 + libs/libtheora-1.1/lib/decode.c | 2943 ++++++ libs/libtheora-1.1/lib/defexp.awk | 27 + libs/libtheora-1.1/lib/dequant.c | 182 + libs/libtheora-1.1/lib/dequant.h | 27 + libs/libtheora-1.1/lib/encapiwrapper.c | 168 + libs/libtheora-1.1/lib/encfrag.c | 388 + libs/libtheora-1.1/lib/encinfo.c | 121 + libs/libtheora-1.1/lib/encint.h | 490 + libs/libtheora-1.1/lib/encode.c | 1627 ++++ libs/libtheora-1.1/lib/encoder_disabled.c | 67 + libs/libtheora-1.1/lib/enquant.c | 274 + libs/libtheora-1.1/lib/enquant.h | 27 + libs/libtheora-1.1/lib/fdct.c | 422 + libs/libtheora-1.1/lib/fragment.c | 87 + libs/libtheora-1.1/lib/huffdec.c | 489 + libs/libtheora-1.1/lib/huffdec.h | 92 + libs/libtheora-1.1/lib/huffenc.c | 910 ++ libs/libtheora-1.1/lib/huffenc.h | 19 + libs/libtheora-1.1/lib/huffman.h | 70 + libs/libtheora-1.1/lib/idct.c | 335 + libs/libtheora-1.1/lib/info.c | 131 + libs/libtheora-1.1/lib/internal.c | 262 + libs/libtheora-1.1/lib/internal.h | 509 + libs/libtheora-1.1/lib/mathops.c | 296 + libs/libtheora-1.1/lib/mathops.h | 141 + libs/libtheora-1.1/lib/mcenc.c | 767 ++ libs/libtheora-1.1/lib/modedec.h | 4027 ++++++++ libs/libtheora-1.1/lib/ocintrin.h | 128 + libs/libtheora-1.1/lib/quant.c | 119 + libs/libtheora-1.1/lib/quant.h | 33 + libs/libtheora-1.1/lib/rate.c | 1137 +++ libs/libtheora-1.1/lib/state.c | 1227 +++ libs/libtheora-1.1/lib/theora.def | 56 + libs/libtheora-1.1/lib/theora.exp | 55 + libs/libtheora-1.1/lib/theoradec.exp | 43 + libs/libtheora-1.1/lib/theoraenc.exp | 15 + libs/libtheora-1.1/lib/tokenize.c | 1072 +++ libs/libtheora-1.1/lib/x86/mmxencfrag.c | 900 ++ libs/libtheora-1.1/lib/x86/mmxfdct.c | 665 ++ libs/libtheora-1.1/lib/x86/mmxfrag.c | 293 + libs/libtheora-1.1/lib/x86/mmxfrag.h | 64 + libs/libtheora-1.1/lib/x86/mmxidct.c | 564 ++ libs/libtheora-1.1/lib/x86/mmxloop.h | 215 + libs/libtheora-1.1/lib/x86/mmxstate.c | 188 + libs/libtheora-1.1/lib/x86/sse2fdct.c | 523 ++ libs/libtheora-1.1/lib/x86/x86enc.c | 49 + libs/libtheora-1.1/lib/x86/x86enc.h | 47 + libs/libtheora-1.1/lib/x86/x86int.h | 42 + libs/libtheora-1.1/lib/x86/x86state.c | 62 + libs/libtheora-1.1/lib/x86_vc/mmxencfrag.c | 969 ++ libs/libtheora-1.1/lib/x86_vc/mmxfdct.c | 670 ++ libs/libtheora-1.1/lib/x86_vc/mmxfrag.c | 337 + libs/libtheora-1.1/lib/x86_vc/mmxfrag.h | 61 + libs/libtheora-1.1/lib/x86_vc/mmxidct.c | 562 ++ libs/libtheora-1.1/lib/x86_vc/mmxloop.h | 219 + libs/libtheora-1.1/lib/x86_vc/mmxstate.c | 211 + libs/libtheora-1.1/lib/x86_vc/x86enc.c | 49 + libs/libtheora-1.1/lib/x86_vc/x86enc.h | 47 + libs/libtheora-1.1/lib/x86_vc/x86int.h | 42 + libs/libtheora-1.1/lib/x86_vc/x86state.c | 62 + libs/libtheora-1.1/libtheora.spec.in | 82 + libs/libtheora-1.1/m4/Makefile.am | 6 + libs/libtheora-1.1/m4/as-ac-expand.m4 | 43 + libs/libtheora-1.1/m4/ogg.m4 | 116 + libs/libtheora-1.1/m4/pkg.m4 | 157 + libs/libtheora-1.1/m4/sdl.m4 | 180 + libs/libtheora-1.1/m4/vorbis.m4 | 122 + .../macosx/English.lproj/InfoPlist.strings | Bin 0 -> 142 bytes libs/libtheora-1.1/macosx/Info.plist | 30 + .../macosx/Theora.xcodeproj/project.pbxproj | 864 ++ libs/libtheora-1.1/macosx/Theora_Prefix.pch | 5 + libs/libtheora-1.1/symbian/bld.inf | 35 + libs/libtheora-1.1/symbian/config.h | 57 + libs/libtheora-1.1/symbian/theora.mmp | 41 + libs/libtheora-1.1/tests/Makefile.am | 69 + libs/libtheora-1.1/tests/comment.c | 91 + libs/libtheora-1.1/tests/comment_theora.c | 91 + libs/libtheora-1.1/tests/granulepos.c | 149 + libs/libtheora-1.1/tests/granulepos_theora.c | 154 + libs/libtheora-1.1/tests/noop.c | 119 + libs/libtheora-1.1/tests/noop_theora.c | 88 + libs/libtheora-1.1/tests/tests.h | 33 + libs/libtheora-1.1/theora-uninstalled.pc.in | 14 + libs/libtheora-1.1/theora.pc.in | 14 + .../libtheora-1.1/theoradec-uninstalled.pc.in | 14 + libs/libtheora-1.1/theoradec.pc.in | 14 + .../libtheora-1.1/theoraenc-uninstalled.pc.in | 14 + libs/libtheora-1.1/theoraenc.pc.in | 14 + libs/libtheora-1.1/win32/VS2005/README | 22 + .../dump_video/dump_video_dynamic.vcproj | 108 + .../dump_video/dump_video_static.vcproj | 108 + .../encoder_example_dynamic.vcproj | 104 + .../encoder_example_static.vcproj | 104 + .../libtheora-1.1/win32/VS2005/libogg.vsprops | 19 + .../VS2005/libtheora/libtheora_dynamic.vcproj | 688 ++ .../VS2005/libtheora/libtheora_static.vcproj | 690 ++ .../win32/VS2005/libtheora_dynamic.sln | 82 + .../win32/VS2005/libtheora_static.sln | 82 + .../win32/VS2005/libvorbis.vsprops | 19 + libs/libtheora-1.1/win32/VS2008/README | 22 + .../dump_video/dump_video_dynamic.vcproj | 104 + .../dump_video/dump_video_static.vcproj | 104 + .../encoder_example_dynamic.vcproj | 100 + .../encoder_example_static.vcproj | 100 + .../libtheora-1.1/win32/VS2008/libogg.vsprops | 19 + .../VS2008/libtheora/libtheora_dynamic.vcproj | 576 ++ .../VS2008/libtheora/libtheora_static.vcproj | 566 ++ .../win32/VS2008/libtheora_dynamic.sln | 146 + .../win32/VS2008/libtheora_static.sln | 146 + .../win32/VS2008/libvorbis.vsprops | 19 + libs/libtheora-1.1/win32/VS2010/README | 22 + .../dump_video/dump_video_dynamic.vcxproj | 198 + .../dump_video/dump_video_static.vcxproj | 198 + .../encoder_example_dynamic.vcxproj | 204 + .../encoder_example_static.vcxproj | 204 + libs/libtheora-1.1/win32/VS2010/libogg.props | 22 + .../libtheora/libtheora_dynamic.vcxproj | 285 + .../VS2010/libtheora/libtheora_static.vcxproj | 251 + .../win32/VS2010/libtheora_dynamic.sln | 46 + .../win32/VS2010/libtheora_static.sln | 46 + .../win32/VS2010/libvorbis.props | 22 + .../win32/build_theora_static.bat | 18 + .../win32/build_theora_static_debug.bat | 18 + .../win32/experimental/dumpvid/dumpvid.dsp | 121 + .../win32/experimental/encoderwin/ReadMe.txt | 13 + .../experimental/encoderwin/encoderwin.dsp | 121 + .../experimental/transcoder/avi2vp3/avi2vp3.c | 82 + .../experimental/transcoder/avi2vp3/avilib.c | 1839 ++++ .../experimental/transcoder/avi2vp3/avilib.h | 309 + .../transcoder/avi2vp3/outfile.vp3 | Bin 0 -> 233132 bytes .../experimental/transcoder/avi2vp3/vp31.avi | Bin 0 -> 299724 bytes .../win32/experimental/transcoder/readme.txt | 17 + .../experimental/transcoder/transcoder.dsp | 121 + .../transcoder/transcoder_example.c | 926 ++ .../win32/experimental/wincompat/README.txt | 1 + .../win32/experimental/wincompat/getopt.c | 122 + .../win32/experimental/wincompat/getopt.h | 110 + .../experimental/wincompat/getopt_long.c | 547 ++ .../win32/experimental/wincompat/unistd.h | 0 libs/libtheora-1.1/win32/getopt.c | 1047 +++ libs/libtheora-1.1/win32/getopt1.c | 188 + libs/libtheora-1.1/win32/getopt_win.h | 169 + libs/libtheora-1.1/win32/theora_static.dsp | 336 + libs/libtheora-1.1/win32/xmingw32/Makefile | 393 + .../win32/xmingw32/libtheoradec-all.def | 58 + .../win32/xmingw32/libtheoradec-all.rc | 39 + .../win32/xmingw32/libtheoradec.rc | 3 + .../win32/xmingw32/libtheoradec70.rc | 3 + .../win32/xmingw32/libtheoradec70d.rc | 3 + .../win32/xmingw32/libtheoradec71.rc | 3 + .../win32/xmingw32/libtheoradec71d.rc | 3 + .../win32/xmingw32/libtheoradec80.rc | 3 + .../win32/xmingw32/libtheoradec80d.rc | 3 + .../win32/xmingw32/libtheoradecd.rc | 3 + .../win32/xmingw32/libtheoraenc-all.def | 17 + .../win32/xmingw32/libtheoraenc-all.rc | 39 + .../win32/xmingw32/libtheoraenc.rc | 3 + .../win32/xmingw32/libtheoraenc70.rc | 3 + .../win32/xmingw32/libtheoraenc70d.rc | 3 + .../win32/xmingw32/libtheoraenc71.rc | 3 + .../win32/xmingw32/libtheoraenc71d.rc | 3 + .../win32/xmingw32/libtheoraenc80.rc | 3 + .../win32/xmingw32/libtheoraenc80d.rc | 3 + .../win32/xmingw32/libtheoraencd.rc | 3 + 245 files changed, 76220 insertions(+) create mode 100644 libs/libtheora-1.1/AUTHORS create mode 100644 libs/libtheora-1.1/CHANGES create mode 100644 libs/libtheora-1.1/CMakeLists.txt create mode 100644 libs/libtheora-1.1/COPYING create mode 100644 libs/libtheora-1.1/LICENSE create mode 100644 libs/libtheora-1.1/Makefile.am create mode 100644 libs/libtheora-1.1/README create mode 100644 libs/libtheora-1.1/SConstruct create mode 100644 libs/libtheora-1.1/autogen.sh create mode 100644 libs/libtheora-1.1/configure.ac create mode 100644 libs/libtheora-1.1/debian/changelog create mode 100644 libs/libtheora-1.1/debian/control create mode 100644 libs/libtheora-1.1/debian/copyright create mode 100644 libs/libtheora-1.1/debian/libtheora-dev.install create mode 100644 libs/libtheora-1.1/debian/libtheora0.install create mode 100644 libs/libtheora-1.1/debian/rules create mode 100644 libs/libtheora-1.1/debian/watch create mode 100644 libs/libtheora-1.1/doc/Doxyfile.in create mode 100644 libs/libtheora-1.1/doc/Makefile.am create mode 100644 libs/libtheora-1.1/doc/color.html create mode 100644 libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.txt create mode 100644 libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.xml create mode 100644 libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.txt create mode 100644 libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.xml create mode 100644 libs/libtheora-1.1/doc/spec/Makefile.am create mode 100644 libs/libtheora-1.1/doc/spec/fdct.fig create mode 100644 libs/libtheora-1.1/doc/spec/hilbert-block.fig create mode 100644 libs/libtheora-1.1/doc/spec/hilbert-mb.fig create mode 100644 libs/libtheora-1.1/doc/spec/idct.fig create mode 100644 libs/libtheora-1.1/doc/spec/lflim.fig create mode 100644 libs/libtheora-1.1/doc/spec/ltablex.sty create mode 100644 libs/libtheora-1.1/doc/spec/macroblock.fig create mode 100644 libs/libtheora-1.1/doc/spec/pic-frame.fig create mode 100644 libs/libtheora-1.1/doc/spec/pic_even.fig create mode 100644 libs/libtheora-1.1/doc/spec/pic_even_odd.fig create mode 100644 libs/libtheora-1.1/doc/spec/pic_odd.fig create mode 100644 libs/libtheora-1.1/doc/spec/pic_odd_even.fig create mode 100644 libs/libtheora-1.1/doc/spec/pixel420.fig create mode 100644 libs/libtheora-1.1/doc/spec/pixel422.fig create mode 100644 libs/libtheora-1.1/doc/spec/pixel444.fig create mode 100644 libs/libtheora-1.1/doc/spec/raster-block.fig create mode 100644 libs/libtheora-1.1/doc/spec/reference-frames.fig create mode 100644 libs/libtheora-1.1/doc/spec/spec.bib create mode 100644 libs/libtheora-1.1/doc/spec/spec.tex create mode 100644 libs/libtheora-1.1/doc/spec/superblock.fig create mode 100644 libs/libtheora-1.1/doc/spec/vp3huff.c create mode 100644 libs/libtheora-1.1/doc/spec/xifish.fig create mode 100644 libs/libtheora-1.1/doc/vp3-format.txt create mode 100644 libs/libtheora-1.1/examples/Makefile.am create mode 100644 libs/libtheora-1.1/examples/README_SPLAYER create mode 100644 libs/libtheora-1.1/examples/dump_psnr.c create mode 100644 libs/libtheora-1.1/examples/dump_video.c create mode 100644 libs/libtheora-1.1/examples/encoder_example.c create mode 100644 libs/libtheora-1.1/examples/getopt.c create mode 100644 libs/libtheora-1.1/examples/getopt.h create mode 100644 libs/libtheora-1.1/examples/getopt1.c create mode 100644 libs/libtheora-1.1/examples/player_example.c create mode 100644 libs/libtheora-1.1/examples/png2theora.c create mode 100644 libs/libtheora-1.1/examples/splayer.c create mode 100644 libs/libtheora-1.1/include/Makefile.am create mode 100644 libs/libtheora-1.1/include/theora/Makefile.am create mode 100644 libs/libtheora-1.1/include/theora/codec.h create mode 100644 libs/libtheora-1.1/include/theora/theora.h create mode 100644 libs/libtheora-1.1/include/theora/theoradec.h create mode 100644 libs/libtheora-1.1/include/theora/theoraenc.h create mode 100644 libs/libtheora-1.1/lib/Makefile.am create mode 100644 libs/libtheora-1.1/lib/Version_script create mode 100644 libs/libtheora-1.1/lib/Version_script-dec create mode 100644 libs/libtheora-1.1/lib/Version_script-enc create mode 100644 libs/libtheora-1.1/lib/analyze.c create mode 100644 libs/libtheora-1.1/lib/apiwrapper.c create mode 100644 libs/libtheora-1.1/lib/apiwrapper.h create mode 100644 libs/libtheora-1.1/lib/bitpack.c create mode 100644 libs/libtheora-1.1/lib/bitpack.h create mode 100644 libs/libtheora-1.1/lib/cpu.c create mode 100644 libs/libtheora-1.1/lib/cpu.h create mode 100644 libs/libtheora-1.1/lib/dct.h create mode 100644 libs/libtheora-1.1/lib/decapiwrapper.c create mode 100644 libs/libtheora-1.1/lib/decinfo.c create mode 100644 libs/libtheora-1.1/lib/decint.h create mode 100644 libs/libtheora-1.1/lib/decode.c create mode 100644 libs/libtheora-1.1/lib/defexp.awk create mode 100644 libs/libtheora-1.1/lib/dequant.c create mode 100644 libs/libtheora-1.1/lib/dequant.h create mode 100644 libs/libtheora-1.1/lib/encapiwrapper.c create mode 100644 libs/libtheora-1.1/lib/encfrag.c create mode 100644 libs/libtheora-1.1/lib/encinfo.c create mode 100644 libs/libtheora-1.1/lib/encint.h create mode 100644 libs/libtheora-1.1/lib/encode.c create mode 100644 libs/libtheora-1.1/lib/encoder_disabled.c create mode 100644 libs/libtheora-1.1/lib/enquant.c create mode 100644 libs/libtheora-1.1/lib/enquant.h create mode 100644 libs/libtheora-1.1/lib/fdct.c create mode 100644 libs/libtheora-1.1/lib/fragment.c create mode 100644 libs/libtheora-1.1/lib/huffdec.c create mode 100644 libs/libtheora-1.1/lib/huffdec.h create mode 100644 libs/libtheora-1.1/lib/huffenc.c create mode 100644 libs/libtheora-1.1/lib/huffenc.h create mode 100644 libs/libtheora-1.1/lib/huffman.h create mode 100644 libs/libtheora-1.1/lib/idct.c create mode 100644 libs/libtheora-1.1/lib/info.c create mode 100644 libs/libtheora-1.1/lib/internal.c create mode 100644 libs/libtheora-1.1/lib/internal.h create mode 100644 libs/libtheora-1.1/lib/mathops.c create mode 100644 libs/libtheora-1.1/lib/mathops.h create mode 100644 libs/libtheora-1.1/lib/mcenc.c create mode 100644 libs/libtheora-1.1/lib/modedec.h create mode 100644 libs/libtheora-1.1/lib/ocintrin.h create mode 100644 libs/libtheora-1.1/lib/quant.c create mode 100644 libs/libtheora-1.1/lib/quant.h create mode 100644 libs/libtheora-1.1/lib/rate.c create mode 100644 libs/libtheora-1.1/lib/state.c create mode 100644 libs/libtheora-1.1/lib/theora.def create mode 100644 libs/libtheora-1.1/lib/theora.exp create mode 100644 libs/libtheora-1.1/lib/theoradec.exp create mode 100644 libs/libtheora-1.1/lib/theoraenc.exp create mode 100644 libs/libtheora-1.1/lib/tokenize.c create mode 100644 libs/libtheora-1.1/lib/x86/mmxencfrag.c create mode 100644 libs/libtheora-1.1/lib/x86/mmxfdct.c create mode 100644 libs/libtheora-1.1/lib/x86/mmxfrag.c create mode 100644 libs/libtheora-1.1/lib/x86/mmxfrag.h create mode 100644 libs/libtheora-1.1/lib/x86/mmxidct.c create mode 100644 libs/libtheora-1.1/lib/x86/mmxloop.h create mode 100644 libs/libtheora-1.1/lib/x86/mmxstate.c create mode 100644 libs/libtheora-1.1/lib/x86/sse2fdct.c create mode 100644 libs/libtheora-1.1/lib/x86/x86enc.c create mode 100644 libs/libtheora-1.1/lib/x86/x86enc.h create mode 100644 libs/libtheora-1.1/lib/x86/x86int.h create mode 100644 libs/libtheora-1.1/lib/x86/x86state.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxencfrag.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxfdct.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxfrag.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxfrag.h create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxidct.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxloop.h create mode 100644 libs/libtheora-1.1/lib/x86_vc/mmxstate.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/x86enc.c create mode 100644 libs/libtheora-1.1/lib/x86_vc/x86enc.h create mode 100644 libs/libtheora-1.1/lib/x86_vc/x86int.h create mode 100644 libs/libtheora-1.1/lib/x86_vc/x86state.c create mode 100644 libs/libtheora-1.1/libtheora.spec.in create mode 100644 libs/libtheora-1.1/m4/Makefile.am create mode 100644 libs/libtheora-1.1/m4/as-ac-expand.m4 create mode 100644 libs/libtheora-1.1/m4/ogg.m4 create mode 100644 libs/libtheora-1.1/m4/pkg.m4 create mode 100644 libs/libtheora-1.1/m4/sdl.m4 create mode 100644 libs/libtheora-1.1/m4/vorbis.m4 create mode 100644 libs/libtheora-1.1/macosx/English.lproj/InfoPlist.strings create mode 100644 libs/libtheora-1.1/macosx/Info.plist create mode 100644 libs/libtheora-1.1/macosx/Theora.xcodeproj/project.pbxproj create mode 100644 libs/libtheora-1.1/macosx/Theora_Prefix.pch create mode 100644 libs/libtheora-1.1/symbian/bld.inf create mode 100644 libs/libtheora-1.1/symbian/config.h create mode 100644 libs/libtheora-1.1/symbian/theora.mmp create mode 100644 libs/libtheora-1.1/tests/Makefile.am create mode 100644 libs/libtheora-1.1/tests/comment.c create mode 100644 libs/libtheora-1.1/tests/comment_theora.c create mode 100644 libs/libtheora-1.1/tests/granulepos.c create mode 100644 libs/libtheora-1.1/tests/granulepos_theora.c create mode 100644 libs/libtheora-1.1/tests/noop.c create mode 100644 libs/libtheora-1.1/tests/noop_theora.c create mode 100644 libs/libtheora-1.1/tests/tests.h create mode 100644 libs/libtheora-1.1/theora-uninstalled.pc.in create mode 100644 libs/libtheora-1.1/theora.pc.in create mode 100644 libs/libtheora-1.1/theoradec-uninstalled.pc.in create mode 100644 libs/libtheora-1.1/theoradec.pc.in create mode 100644 libs/libtheora-1.1/theoraenc-uninstalled.pc.in create mode 100644 libs/libtheora-1.1/theoraenc.pc.in create mode 100644 libs/libtheora-1.1/win32/VS2005/README create mode 100644 libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/libogg.vsprops create mode 100644 libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2005/libtheora_dynamic.sln create mode 100644 libs/libtheora-1.1/win32/VS2005/libtheora_static.sln create mode 100644 libs/libtheora-1.1/win32/VS2005/libvorbis.vsprops create mode 100644 libs/libtheora-1.1/win32/VS2008/README create mode 100644 libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/libogg.vsprops create mode 100644 libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_dynamic.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_static.vcproj create mode 100644 libs/libtheora-1.1/win32/VS2008/libtheora_dynamic.sln create mode 100644 libs/libtheora-1.1/win32/VS2008/libtheora_static.sln create mode 100644 libs/libtheora-1.1/win32/VS2008/libvorbis.vsprops create mode 100644 libs/libtheora-1.1/win32/VS2010/README create mode 100644 libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_dynamic.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_static.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_dynamic.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_static.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/libogg.props create mode 100644 libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_dynamic.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_static.vcxproj create mode 100644 libs/libtheora-1.1/win32/VS2010/libtheora_dynamic.sln create mode 100644 libs/libtheora-1.1/win32/VS2010/libtheora_static.sln create mode 100644 libs/libtheora-1.1/win32/VS2010/libvorbis.props create mode 100644 libs/libtheora-1.1/win32/build_theora_static.bat create mode 100644 libs/libtheora-1.1/win32/build_theora_static_debug.bat create mode 100644 libs/libtheora-1.1/win32/experimental/dumpvid/dumpvid.dsp create mode 100644 libs/libtheora-1.1/win32/experimental/encoderwin/ReadMe.txt create mode 100644 libs/libtheora-1.1/win32/experimental/encoderwin/encoderwin.dsp create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avi2vp3.c create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avilib.c create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avilib.h create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/outfile.vp3 create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/vp31.avi create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/readme.txt create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/transcoder.dsp create mode 100644 libs/libtheora-1.1/win32/experimental/transcoder/transcoder_example.c create mode 100644 libs/libtheora-1.1/win32/experimental/wincompat/README.txt create mode 100644 libs/libtheora-1.1/win32/experimental/wincompat/getopt.c create mode 100644 libs/libtheora-1.1/win32/experimental/wincompat/getopt.h create mode 100644 libs/libtheora-1.1/win32/experimental/wincompat/getopt_long.c create mode 100644 libs/libtheora-1.1/win32/experimental/wincompat/unistd.h create mode 100644 libs/libtheora-1.1/win32/getopt.c create mode 100644 libs/libtheora-1.1/win32/getopt1.c create mode 100644 libs/libtheora-1.1/win32/getopt_win.h create mode 100644 libs/libtheora-1.1/win32/theora_static.dsp create mode 100644 libs/libtheora-1.1/win32/xmingw32/Makefile create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.def create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec70.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec70d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec71.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec71d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec80.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradec80d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoradecd.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.def create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc70.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc70d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc71.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc71d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc80.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraenc80d.rc create mode 100644 libs/libtheora-1.1/win32/xmingw32/libtheoraencd.rc diff --git a/CMakeLists.txt b/CMakeLists.txt index c3d4ab95..556a99db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,8 @@ elseif(MSVC12) endif() endif() + + set(MEGA_ZLIB_VER "1.2.8") set(MEGA_PHYSFS_VER "2.0.3") set(MEGA_LUA51_VER "5.1.5") @@ -134,6 +136,7 @@ set(MEGA_LIBPNG_VER "166") set(MEGA_JPEG_TURBO_VER "1.3.1") set(MEGA_LIBOGG_VER "1.3.1") set(MEGA_LIBVORBIS_VER "1.3.3") +set(MEGA_LIBTHEORA_VER "1.1") set(MEGA_MPG123_VER "1.15.3") set(MEGA_FREETYPE_VER "2.5.0.1") set(MEGA_SDL2_VER "2.0.3-1c0f6952e65e") @@ -195,6 +198,12 @@ add_subdirectory("libs/libvorbis-${MEGA_LIBVORBIS_VER}" ${CMAKE_BINARY_DIR}/libv set(MEGA_LIBVORBIS vorbis-static) set(MEGA_LIBVORBISFILE vorbisfile-static) +message(STATUS "-----------------------------------------------------") +message(STATUS "Configuring: libtheora ${MEGA_LIBTHEORA_VER}") +message(STATUS "-----------------------------------------------------") +add_subdirectory("libs/libtheora-${MEGA_LIBTHEORA_VER}" ${CMAKE_BINARY_DIR}/libtheora) +set(MEGA_LIBTHEORA theora-static) + message(STATUS "-----------------------------------------------------") message(STATUS "Configuring: mpg123 ${MEGA_MPG123_VER}") message(STATUS "-----------------------------------------------------") @@ -293,6 +302,7 @@ set(MEGA_3P ${MEGA_LIBOGG} ${MEGA_LIBVORBIS} ${MEGA_LIBVORBISFILE} + ${MEGA_LIBTHEORA} ${MEGA_MPEG123} ${MEGA_FREETYPE} ${MEGA_SDL2} diff --git a/libs/libtheora-1.1/AUTHORS b/libs/libtheora-1.1/AUTHORS new file mode 100644 index 00000000..c8d0992e --- /dev/null +++ b/libs/libtheora-1.1/AUTHORS @@ -0,0 +1,49 @@ +Monty + - Original VP3 port + +Ralph Giles +Timothy B. Terriberry +Monty + - Ongoing development + +Dan B. Miller + - Pre alpha3 development + +Rudolf Marek +Wim Tayman +Dan Lenski +Nils Pipenbrinck +Monty + - MMX optimized functions + +Aaron Colwell +Thomas Vander Stichele +Jan Gerber +Conrad Parker +Cristian Adam +Sebastian Pippin +Simon Hosie + - Bug fixes, enhancements, build systems. + +Mauricio Piacentini + - Original win32 projects and example ports + - VP3->Theora transcoder + +Silvia Pfeiffer + - Figures for the spec + +Michael Smith +Andre Pang +calc +Chris Cheney +Brendan Cully +Edward Hervey +Adam Moss +Colin Ward +Jeremy C. Reed +Arc Riley +Rodolphe Ortalo + - Bug fixes + + +and other Xiph.org contributors diff --git a/libs/libtheora-1.1/CHANGES b/libs/libtheora-1.1/CHANGES new file mode 100644 index 00000000..7bd04a1f --- /dev/null +++ b/libs/libtheora-1.1/CHANGES @@ -0,0 +1,243 @@ +libtheora 1.1.2 (unreleased snapshot) + + - Fix Huffman table decoding with OC_HUFF_SLUSH is set to 0 + - Fix a frame size bug in player_example + - Add support for passing a buffer the size of the picture + region, rather than a full padded frame to th_encode_ycbcr_in() + as was possible with the legacy pre-1.0 API. + - 4:4:4 support in player_example using software yuv->rgb + - Better rgb->yuv conversion in png2theora + - Clean up warnings and local variables + - Build and documentation fixes + +libtheora 1.1.1 (2009 October 1) + + - Fix problems with MSVC inline assembly + - Add the missing encoder_disabled.c to the distribution + - build updates: autogen.sh should work better after switching systems + and the MSVC project now defaults to the dynamic runtime library + - Namespace some variables to avoid conflicts on wince. + +libtheora 1.1.0 (2009 September 24) + + - Fix various small issues with the example and telemetry code + - Fix handing a zero-byte packet as the first frame + - Documentation cleanup + - Two minor build fixes + +libtheora 1.1beta3 (2009 August 22) + + - Rate control fixes to smooth quality + - MSVC build now exports all of the 1.0 api + - Assorted small bug fixes + +libtheora 1.1beta2 (2009 August 12) + + - Fix a rate control problem with difficult input + - Build fixes for OpenBSD and Apple Xcode + - Examples now all use the 1.0 api + - TH_ENCCTL_SET_SPLEVEL works again + - Various bug fixes and source tree rearrangement + +libtheora 1.1beta1 (2009 August 5) + + - Support for two-pass encoding + - Performance optimization of both encoder and decoder + - Encoder supports dynamic adjustment of quality and + bitrate targets + - Encoder is generally more configurable, and all + rate control modes perform better + - Encoder now accepts 4:2:2 and 4:4:4 chroma sampling + - Decoder telemetry output shows quantization choice + and a breakdown of bitrate usage in the frame + - MSVC assembly optimizations up to date and functional + +libtheora 1.1alpha2 (2009 May 26) + + - Reduce lambda for small quantizers. + - New encoder fDCT does better on smooth gradients + - Use SATD for mode decisions (1-2% bitrate reduction) + - Assembly rewrite for new features and general speed up + - Share code between the encoder and decoder for performance + - Fix 4:2:2 decoding and telemetry + - MSVC project files updated, but assembly is disabled. + - New configure option --disable-spec to work around toolchain + detection failures. + - Limit symbol exports on MacOS X. + - Port remaining unit tests from the 1.0 release. + +libtheora 1.1alpha1 (2009 March 27) + + - Encoder rewrite with much improved vbr quality/bitrate and + better tracking of the target rate in cbr mode. + - MSVC project files do not work in this release. + +libtheora 1.0 (2008 November 3) + + - Merge x86 assembly for forward DCT from Thusnelda branch. + - Update 32 bit MMX with loop filter fix. + - Check for an uninitialized state before dereferencing in propagating + decode calls. + - Remove all TH_DEBUG statements. + - Rename the bitpacker source files copied from libogg to avoid + confusing simple build systems using both libraries. + - Declare bitfield entries to be explicitly signed for Solaris cc. + - Set quantization parameters to default values when an empty buffer is + passed with TH_ENCCTL_SET_QUANT_PARAMS. + - Split encoder and decoder tests depending on configure settings. + - Return lstylex.sty to the distribution. + - Disable inline assembly on gcc versions prior to 3.1. + - Remove extern references for OC_*_QUANT_MIN. + - Make various data tables static const so they can be read-only. + - Remove ENCCTL codes from the old encoder API. + - Implement TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE ctl. + - Fix segfault when exactly one of the width or height is not a multiple + of 16, but the other is. + - Compute the correct vertical offset for chroma. + - cpuid assembly fix for MSVC. + - Add VS2008 project files. + - Build updates for 64-bit platforms, Mingw32, VS and XCode. + - Do not clobber the cropping rectangle. + - Declare ourselves 1.0final to pkg-config to sort after beta releases. + - Fix the scons build to include asm in libtheoradec/enc. + +libtheora 1.0beta3 (2008 April 16) + + - Build new libtheoradec and libtheoraenc libraries + supporting the new API from theora-exp. This API should + not be considered stable yet. + - Change granule_frame() to return an index as documented. + This is a change of behaviour from 1.0beta1. + - Document that granule_time() returns the end of the + presentation interval. + - Use a custom copy of the libogg bitpacker in the decoder + to avoid function call overhead. + - MMX code improved and ported to MSVC. + - Fix a problem with the MMX code on SELinux. + - Fix a problem with decoder quantizer initialization. + - Fix a page queue problem with png2theora. + - Improved robustness. + - Updated VS2005 project files. + - Dropped build support for Microsoft VS2003. + - Dropped build support for the unreleased libogg2. + - Added the specification to the autotools build. + - Specification corrections. + +libtheora 1.0beta2 (2007 October 12) + + - Fix a crash bug on char-is-unsigned architectures (PowerPC) + - Fix a buffer sizing issue that caused rare encoder crashes + - Fix a buffer alignment issue + - Build fixes for MingW32, MSVC + - Improved format documentation. + +libtheora 1.0beta1 (2007 September 22) + + - Granulepos scheme modified to match other codecs. This bumps + the bitstream revision to 3.2.1. Bitstreams marked 3.2.0 are + handled correctly by this decoder. Older decoders will show + a one frame sync error in the less noticeable direction. + +libtheora 1.0alpha8 (2007 September 18) + + - Switch to new spec compliant decoder from theora-exp branch. + Written by Dr. Timothy Terriberry. + - Add support to the encoder for using quantization settings + provided by the application. + - more assembly optimizations + +libtheora 1.0alpha7 (2006 June 20) + + - Enable mmx assembly by default + - Avoid some relocations that caused problems on SELinux + - Other build fixes + - time testing mode (-f) for the dump_video example + +libtheora 1.0alpha6 (2006 May 30) + + * Merge theora-mmx simd acceleration (x86_32 and x86_64) + * Major RTP payload specification update + * Minor format specification updates + * Fix some spurious calls to free() instead of _ogg_free() + * Fix invalid array indexing in PixelLineSearch() + * Improve robustness against invalid input + * General warning cleanup + * The offset_y member now means what every application thought it meant + (offset from the top). This will mean some old files (those with a + non-centered image created with a buggy encoder) will display differently. + +libtheora 1.0alpha5 (2005 August 20) + + * Fixed bitrate management bugs that caused popping and encode + errors + * Fixed a crash problem with the theora_state internals not + being intialized properly. + * new utility function: + - theora_granule_shift() + * dump_video example now makes YUV4MPEG files by default, so + the results can be fed back to encoder_example and similar + tools. The old behavior is restored through the '-r' switch. + * ./configure now prints a summary + * simple unit test of the comment api under 'make check' + * misc code cleanup, warning and leak fixes + +libtheora 1.0alpha4 (2004 December 15) + + * first draft of the Theora I Format Specification + * API documentation generated from theora.h with Doxygen + * fix a double-update bug in the motion analysis + * apply the loop filter before filling motion vector border + in the reference frame + * new utility functions: + - theora_packet_isheader(), + - theora_packet_iskeyframe() + - theora_granule_frame() + * optional support for building without floating point + * optional support for building without encode support + * various build and packaging fixes + * pkg-config support + * SymbianOS build support + +libtheora 1.0alpha3 (2004 March 20) + + UPDATE: on 2004 July 1 the Theora I bitstream format was frozen. Files + produced by the libtheora 1.0alpha3 reference encoder will always be + decodable by the Theora I spec. + + * Bitstream info header FORMAT CHANGES: + - move the granulepos shift field to maintain byte alignment longer. + - reserve 5 additional bits for subsampling and interlace flags. + * Bitstream setup header FORMAT CHANGES: + - support for a range of interpolated quant matricies. + - include the in-loop block filter coeff. + * Bitsteam data packet FORMAT CHANGES: + - Reserve a bit for per-block Q index selection. + - Flip the coded image orientation for compatibility with VP3. + This allows lossless transcoding of VP3 content, but files + encoded with earlier theora releases would play upside down. + * example VP3 lossless transcoder + * optional support for libogg2 + * timing improvements in the example player + * packaging and build system updates and fixes + +libtheora 1.0alpha2 (2003 June 9) + + * bitstream FORMAT CHANGES: + - store the quant tables in a third setup header for + future encoder flexibility + - store the huffman tables in the third setup header + - add a field for marking the colorspace to the info header + - add crop parameters for non-multiple-of-16 frame sizes + - add a second vorbiscomment-style metadata header + * API changes to handle multiple headers with a single + theora_decode_header() call, like libvorbis + * code cleanup and minor fixes + * new dump_video code example/utility + * experimental win32 code examples + +libtheora 1.0alpha1 (2002 September 25) + + * First release of the theora reference implementation + * Port of the newly opened VP3 code to the Ogg container + * Rewrite of the code for portability and to use the libogg bitpacker + diff --git a/libs/libtheora-1.1/CMakeLists.txt b/libs/libtheora-1.1/CMakeLists.txt new file mode 100644 index 00000000..21907f26 --- /dev/null +++ b/libs/libtheora-1.1/CMakeLists.txt @@ -0,0 +1,48 @@ +cmake_minimum_required(VERSION 2.8) + +project(theora) + +option(THEORA_BUILD_SHARED "Build shared libtheora" OFF) +option(THEORA_BUILD_STATIC "Build static libtheora" ON) + +set(THEORA_SRC + lib/analyze.c + lib/apiwrapper.c + lib/bitpack.c + lib/cpu.c + lib/decapiwrapper.c + lib/decinfo.c + lib/decode.c + lib/dequant.c + lib/encapiwrapper.c + lib/encfrag.c + lib/encinfo.c + lib/encode.c + lib/encoder_disabled.c + lib/enquant.c + lib/fdct.c + lib/fragment.c + lib/huffdec.c + lib/huffenc.c + lib/idct.c + lib/info.c + lib/internal.c + lib/mathops.c + lib/mcenc.c + lib/quant.c + lib/rate.c + lib/state.c + lib/tokenize.c +) + +if(THEORA_BUILD_STATIC) + add_library(theora-static STATIC ${THEORA_SRC}) + target_include_directories(theora-static PUBLIC include lib) + target_link_libraries(theora-static ${OGG_LIBRARY}) +endif() + +if(THEORA_BUILD_SHARED) + add_library(theora SHARED ${THEORA_SRC} lib/theora.def) + target_include_directories(theora PUBLIC include lib) + target_link_libraries(theora ${OGG_LIBRARY}) +endif() diff --git a/libs/libtheora-1.1/COPYING b/libs/libtheora-1.1/COPYING new file mode 100644 index 00000000..8e334356 --- /dev/null +++ b/libs/libtheora-1.1/COPYING @@ -0,0 +1,28 @@ +Copyright (C) 2002-2009 Xiph.org Foundation + +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 the Xiph.org Foundation 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 FOUNDATION +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/libs/libtheora-1.1/LICENSE b/libs/libtheora-1.1/LICENSE new file mode 100644 index 00000000..530a8e28 --- /dev/null +++ b/libs/libtheora-1.1/LICENSE @@ -0,0 +1,18 @@ +Please see the file COPYING for the copyright license for this software. + +In addition to and irrespective of the copyright license associated +with this software, On2 Technologies, Inc. makes the following statement +regarding technology used in this software: + + On2 represents and warrants that it shall not assert any rights + relating to infringement of On2's registered patents, nor initiate + any litigation asserting such rights, against any person who, or + entity which utilizes the On2 VP3 Codec Software, including any + use, distribution, and sale of said Software; which make changes, + modifications, and improvements in said Software; and to use, + distribute, and sell said changes as well as applications for other + fields of use. + +This reference implementation is originally derived from the On2 VP3 +Codec Software, and the Theora video format is essentially compatible +with the VP3 video format, consisting of a backward-compatible superset. diff --git a/libs/libtheora-1.1/Makefile.am b/libs/libtheora-1.1/Makefile.am new file mode 100644 index 00000000..6c7c2ae6 --- /dev/null +++ b/libs/libtheora-1.1/Makefile.am @@ -0,0 +1,35 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = foreign 1.11 dist-zip dist-xz + +if THEORA_ENABLE_EXAMPLES +EXAMPLES_DIR = examples +else +EXAMPLES_DIR = +endif + +SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR) + + +# we include the whole debian/ dir in EXTRA_DIST because there's a problem +# with autotools and HFS+ MacOSX file systems that caused debian/Makefile.am +# to pick up on the lowercase changelog file and add ChangeLog to DIST_COMMON +# because of it, breaking make dist. This works just as well. +EXTRA_DIST = \ + README CHANGES COPYING LICENSE \ + autogen.sh win32 macosx symbian SConstruct \ + libtheora.spec libtheora.spec.in \ + theora-uninstalled.pc.in + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = theora.pc theoradec.pc theoraenc.pc + +# Remove the .svn folders included in the tarball +dist-hook: + find $(distdir) -type d -name '.svn' | xargs rm -rf + +debug: + $(MAKE) all CFLAGS="@DEBUG@" + +profile: + $(MAKE) all CFLAGS="@PROFILE@" diff --git a/libs/libtheora-1.1/README b/libs/libtheora-1.1/README new file mode 100644 index 00000000..8f82b8ab --- /dev/null +++ b/libs/libtheora-1.1/README @@ -0,0 +1,152 @@ +------------------------------------------------------------------------- + The Xiph.org Foundation's libtheora 1.1 +------------------------------------------------------------------------- + +*** What is Theora? + +Theora is Xiph.Org's first publicly released video codec, intended +for use within the Foundation's Ogg multimedia streaming system. +Theora is derived directly from On2's VP3 codec, adds new features +while allow it a longer useful lifetime as an competitive codec. + +The 1.0 release decoder supported all the new features, but the +encoder is nearly identical to the VP3 code. + +The 1.1 release features a completely rewritten encoder, offering +better performance and compression, and making more complete use +of the format's feature set. Files produced by both encoders can +be decoded by either release. + +*** Where is Theora? + +Theora's main site is www.theora.org. Theora and related libraries +can be gotten from www.theora.org or the main Xiph.Org site at +www.xiph.org. Development source is kept in an open subversion +repository, see http://theora.org/svn/ for instructions. + +------------------------------------------------------------------------- +Getting started with the code +------------------------------------------------------------------------- + +*** What do I need to build the source? + +Requirements summary: + + For libtheora: + + libogg 1.1 or newer. + + For example encoder: + + as above, + + libvorbis and libvorbisenc 1.0.1 or newer. + + For creating a source distribution package: + + as above, + + Doxygen to build the API documentation, + pdflatex and fig2dev to build the format specification + (transfig package in Ubuntu). + + For the player only: + + as above, + + SDL (Simple Direct media Layer) libraries and headers, + OSS audio driver and development headers. + +The provided build system is the GNU automake/autoconf system, and +the main library, libtheora, should already build smoothly on any +system. Failure of libtheora to build on a GNU-enabled system is +considered a bug; please report problems to theora-dev@xiph.org. + +Windows build support is included in the win32 directory. + +Project files for Apple XCode are included in the macosx directory. + +There is also an experimental scons build. + +*** How do I use the sample encoder? + +The sample encoder takes raw video in YUV4MPEG2 format, as used by +lavtools, mjpeg-tools and other packages. The encoder expects audio, +if any, in a separate wave WAV file. Try 'encoder_example -h' for a +complete list of options. + +An easy way to get raw video and audio files is to use MPlayer as an +export utility. The options " -ao pcm -vo yuv4mpeg " will export a +wav file named audiodump.wav and a YUV video file in the correct +format for encoder_example as stream.yuv. Be careful when exporting +video alone; MPlayer may drop frames to 'keep up' with the audio +timer. The example encoder can't properly synchronize input audio and +video file that aren't in sync to begin with. + +The encoder will also take video or audio on stdin if '-' is specified +as the input file name. + +There is also a 'png2theora' example which accepts a set of image +files in that format. + +*** How do I use the sample player? + +The sample player takes an Ogg file on standard in; the file may be +audio alone, video alone or video with audio. + +*** What other tools are available? + +The programs in the examples directory are intended as tutorial source +for developers using the library. As such they sacrifice features and +robustness in the interests of comprehension and should not be +considered serious applications. + +If you're wanting to just use theora, consider the programs linked +from http://www.theora.org/. There is playback support in a number +of common free players, and plugins for major media frameworks. +Jan Gerber's ffmpeg2theora is an excellent encoding front end. + +------------------------------------------------------------------------- +Troubleshooting the build process +------------------------------------------------------------------------- + +*** Compile error, such as: + +encoder_internal.h:664: parse error before `ogg_uint16_t' + +This means you have version of libogg prior to 1.1. A *complete* new Ogg +install, libs and headers is needed. + +Also be sure that there aren't multiple copies of Ogg installed in +/usr and /usr/local; an older one might be first on the search path +for libs and headers. + +*** Link error, such as: + +undefined reference to `oggpackB_stream' + +See above; you need libogg 1.1 or later. + +*** Link error, such as: + +undefined reference to `vorbis_granule_time' + +You need libvorbis and libvorbisenc from the 1.0.1 release or later. + +*** Link error, such as: + +/usr/lib/libSDL.a(SDL_esdaudio.lo): In function `ESD_OpenAudio': +SDL_esdaudio.lo(.text+0x25d): undefined reference to `esd_play_stream' + +Be sure to use an SDL that's built to work with OSS. If you use an +SDL that is also built with ESD and/or ALSA support, it will try to +suck in all those extra libraries at link time too. That will only +work if the extra libraries are also installed. + +*** Link warning, such as: + +libtool: link: warning: library `/usr/lib/libogg.la' was moved. +libtool: link: warning: library `/usr/lib/libogg.la' was moved. + +Re-run theora/autogen.sh after an Ogg or Vorbis rebuild/reinstall + diff --git a/libs/libtheora-1.1/SConstruct b/libs/libtheora-1.1/SConstruct new file mode 100644 index 00000000..01bcfb46 --- /dev/null +++ b/libs/libtheora-1.1/SConstruct @@ -0,0 +1,225 @@ +# see http://www.scons.org if you do not have this tool +from os.path import join +import SCons + +# TODO: should use lamda and map to work on python 1.5 +def path(prefix, list): return [join(prefix, x) for x in list] + +encoder_sources = """ + apiwrapper.c + fragment.c + idct.c + internal.c + state.c + quant.c + analyze.c + encfrag.c + encapiwrapper.c + encinfo.c + encode.c + enquant.c + fdct.c + huffenc.c + mathops.c + mcenc.c + rate.c + tokenize.c +""" + +decoder_sources = """ + apiwrapper.c + bitpack.c + decapiwrapper.c + decinfo.c + decode.c + dequant.c + fragment.c + huffdec.c + idct.c + info.c + internal.c + quant.c + state.c +""" + +env = Environment() +if env['CC'] == 'gcc': + env.Append(CCFLAGS=["-g", "-O2", "-Wall", "-Wno-parentheses"]) + +def CheckPKGConfig(context, version): + context.Message( 'Checking for pkg-config... ' ) + ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] + context.Result( ret ) + return ret + +def CheckPKG(context, name): + context.Message( 'Checking for %s... ' % name ) + ret = context.TryAction('pkg-config --exists %s' % name)[0] + context.Result( ret ) + return ret + +def CheckSDL(context): + name = "sdl-config" + context.Message( 'Checking for %s... ' % name ) + ret = SCons.Util.WhereIs('sdl-config') + context.Result( ret ) + return ret + +# check for appropriate inline asm support +host_x86_32_test = """ + int main(int argc, char **argv) { +#if !defined(__i386__) + #error not an x86 host: preprocessor macro __i386__ not defined +#endif + return 0; + } + """ +def CheckHost_x86_32(context): + context.Message('Checking for an x86 host...') + result = context.TryCompile(host_x86_32_test, '.c') + context.Result(result) + return result + +host_x86_64_test = """ + int main(int argc, char **argv) { +#if !defined(__x86_64__) + #error not an x86_64 host: preprocessor macro __x86_64__ not defined +#endif + return 0; + } + """ +def CheckHost_x86_64(context): + context.Message('Checking for an x86_64 host...') + result = context.TryCompile(host_x86_64_test, '.c') + context.Result(result) + return result + +conf = Configure(env, custom_tests = { + 'CheckPKGConfig' : CheckPKGConfig, + 'CheckPKG' : CheckPKG, + 'CheckSDL' : CheckSDL, + 'CheckHost_x86_32' : CheckHost_x86_32, + 'CheckHost_x86_64' : CheckHost_x86_64, + }) + +if not conf.CheckPKGConfig('0.15.0'): + print 'pkg-config >= 0.15.0 not found.' + Exit(1) + +if not conf.CheckPKG('ogg'): + print 'libogg not found.' + Exit(1) + +if conf.CheckPKG('vorbis vorbisenc'): + have_vorbis=True +else: + have_vorbis=False + +if conf.CheckPKG('libpng'): + have_libpng=True +else: + have_libpng=False + +build_player_example=True +if not conf.CheckHeader('sys/soundcard.h'): + build_player_example=False +if build_player_example and not conf.CheckSDL(): + build_player_example=False + +if conf.CheckHost_x86_32(): + env.Append(CPPDEFINES='OC_X86_ASM') + decoder_sources += """ + x86/mmxidct.c + x86/mmxfrag.c + x86/mmxstate.c + x86/x86state.c + """ + encoder_sources += """ + x86/mmxencfrag.c + x86/mmxfdct.c + x86/x86enc.c + x86/mmxfrag.c + x86/mmxidct.c + x86/mmxstate.c + x86/x86state.c + """ +elif conf.CheckHost_x86_64(): + env.Append(CPPDEFINES=['OC_X86_ASM', 'OC_X86_64_ASM']) + decoder_sources += """ + x86/mmxidct.c + x86/mmxfrag.c + x86/mmxstate.c + x86/x86state.c + """ + encoder_sources += """ + x86/mmxencfrag.c + x86/mmxfdct.c + x86/x86enc.c + x86/sse2fdct.c + x86/mmxfrag.c + x86/mmxidct.c + x86/mmxstate.c + x86/x86state.c + """ + +env = conf.Finish() + +env.Append(CPPPATH=['include']) +env.ParseConfig('pkg-config --cflags --libs ogg') + +libtheoradec_Sources = Split(decoder_sources) +libtheoraenc_Sources = Split(encoder_sources) + +libtheoradec_a = env.Library('lib/theoradec', + path('lib', libtheoradec_Sources)) +libtheoradec_so = env.SharedLibrary('lib/theoradec', + path('lib', libtheoradec_Sources)) + +libtheoraenc_a = env.Library('lib/theoraenc', + path('lib', libtheoraenc_Sources)) +libtheoraenc_so = env.SharedLibrary('lib/theoraenc', + path('lib', libtheoraenc_Sources) + [libtheoradec_so]) + +#installing +prefix='/usr' +lib_dir = prefix + '/lib' +env.Alias('install', prefix) +env.Install(lib_dir, [libtheoradec_a, libtheoradec_so]) +env.Install(lib_dir, [libtheoraenc_a, libtheoraenc_so]) + +# example programs +dump_video = env.Clone() +dump_video_Sources = Split("""dump_video.c ../lib/libtheoradec.a""") +dump_video.Program('examples/dump_video', path('examples', dump_video_Sources)) + +dump_psnr = env.Clone() +dump_psnr.Append(LIBS='m') +dump_psnr_Sources = Split("""dump_psnr.c ../lib/libtheoradec.a""") +dump_psnr.Program('examples/dump_psnr', path('examples', dump_psnr_Sources)) + +if have_vorbis: + encex = dump_video.Clone() + encex.ParseConfig('pkg-config --cflags --libs vorbisenc vorbis') + encex_Sources = Split(""" + encoder_example.c + ../lib/libtheoraenc.a + ../lib/libtheoradec.a + """) + encex.Program('examples/encoder_example', path('examples', encex_Sources)) + + if build_player_example: + plyex = encex.Clone() + plyex_Sources = Split(""" + player_example.c + ../lib/libtheoradec.a + """) + plyex.ParseConfig('sdl-config --cflags --libs') + plyex.Program('examples/player_example', path('examples', plyex_Sources)) + +png2theora = env.Clone() +png2theora_Sources = Split("""png2theora.c + ../lib/libtheoraenc.a + ../lib/libtheoradec.a +""") +png2theora.ParseConfig('pkg-config --cflags --libs libpng') +png2theora.Program('examples/png2theora', path('examples', png2theora_Sources)) diff --git a/libs/libtheora-1.1/autogen.sh b/libs/libtheora-1.1/autogen.sh new file mode 100644 index 00000000..2700868c --- /dev/null +++ b/libs/libtheora-1.1/autogen.sh @@ -0,0 +1,130 @@ +#!/bin/sh +# Run this to set up the build system: configure, makefiles, etc. +# (based on the version in enlightenment's cvs) + +package="theora" + +ACLOCAL_FLAGS="-I m4" + +olddir=`pwd` +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +cd "$srcdir" +DIE=0 + +/bin/echo "checking for autoconf... " +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" +VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" +VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" + +# do we need automake? +if test -r Makefile.am; then + AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` + AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` + if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then + AM_NEEDED="" + fi + if test -z $AM_NEEDED; then + /bin/echo -n "checking for automake... " + AUTOMAKE=automake + ACLOCAL=aclocal + if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then + /bin/echo "yes" + else + /bin/echo "no" + AUTOMAKE= + fi + else + /bin/echo -n "checking for automake $AM_NEEDED or later... " + majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` + minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` + for am in automake-$AM_NEEDED automake$AM_NEEDED \ + automake automake-1.7 automake-1.8 automake-1.9 \ + automake-1.10 automake-1.11; do + ($am --version < /dev/null > /dev/null 2>&1) || continue + ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` + maj=`echo $ver | $VERSIONMKMAJ` + min=`echo $ver | $VERSIONMKMIN` + if test $maj -eq $majneeded -a $min -ge $minneeded; then + AUTOMAKE=$am + /bin/echo $AUTOMAKE + break + fi + done + test -z $AUTOMAKE && /bin/echo "no" + /bin/echo -n "checking for aclocal $AM_NEEDED or later... " + for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ + aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10 aclocal-1.11; do + ($ac --version < /dev/null > /dev/null 2>&1) || continue + ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` + maj=`echo $ver | $VERSIONMKMAJ` + min=`echo $ver | $VERSIONMKMIN` + if test $maj -eq $majneeded -a $min -ge $minneeded; then + ACLOCAL=$ac + /bin/echo $ACLOCAL + break + fi + done + test -z $ACLOCAL && /bin/echo "no" + fi + test -z $AUTOMAKE || test -z $ACLOCAL && { + echo + echo "You must have automake installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + exit 1 + } +fi + +/bin/echo -n "checking for libtool... " +for LIBTOOLIZE in libtoolize glibtoolize nope; do + ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break +done +if test x$LIBTOOLIZE = xnope; then + /bin/echo "nope." + LIBTOOLIZE=libtoolize +else + /bin/echo $LIBTOOLIZE +fi +($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed to compile $package." + echo "Download the appropriate package for your system," + echo "or get the source from one of the GNU ftp sites" + echo "listed in http://www.gnu.org/order/ftp.html" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." +fi + +/bin/echo "Generating configuration files for $package, please wait...." + +/bin/echo " $ACLOCAL $ACLOCAL_FLAGS" +$ACLOCAL $ACLOCAL_FLAGS || exit 1 +/bin/echo " $LIBTOOLIZE --automake --force" +$LIBTOOLIZE --automake --force || exit 1 +/bin/echo " autoheader" +autoheader || exit 1 +/bin/echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" +$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 +/bin/echo " autoconf" +autoconf || exit 1 + +cd $olddir +$srcdir/configure --enable-maintainer-mode "$@" && /bin/echo diff --git a/libs/libtheora-1.1/configure.ac b/libs/libtheora-1.1/configure.ac new file mode 100644 index 00000000..b2118944 --- /dev/null +++ b/libs/libtheora-1.1/configure.ac @@ -0,0 +1,531 @@ +dnl Process this file with autoconf to produce a configure script + +dnl ------------------------------------------------ +dnl Initialization and Versioning +dnl ------------------------------------------------ + +AC_INIT(libtheora,[1.1.1+svn]) + +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AM_CONFIG_HEADER([config.h]) +AC_CONFIG_SRCDIR([lib/fdct.c]) +AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE + +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 + +TH_LIB_CURRENT=3 +TH_LIB_REVISION=10 +TH_LIB_AGE=3 +AC_SUBST(TH_LIB_CURRENT) +AC_SUBST(TH_LIB_REVISION) +AC_SUBST(TH_LIB_AGE) + +THDEC_LIB_CURRENT=2 +THDEC_LIB_REVISION=4 +THDEC_LIB_AGE=1 +AC_SUBST(THDEC_LIB_CURRENT) +AC_SUBST(THDEC_LIB_REVISION) +AC_SUBST(THDEC_LIB_AGE) + +THENC_LIB_CURRENT=2 +THENC_LIB_REVISION=2 +THENC_LIB_AGE=1 +AC_SUBST(THENC_LIB_CURRENT) +AC_SUBST(THENC_LIB_REVISION) +AC_SUBST(THENC_LIB_AGE) + +dnl Extra linker options (for version script) +THEORA_LDFLAGS="" + +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 Add parameters for aclocal +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") + +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 + +dnl Check for tools used to build the format specification +BUILD_SPEC="false" +ac_build_spec=no +AC_ARG_ENABLE(spec, + AS_HELP_STRING([--enable-spec], [(re)build the specification document]), + [ + if test "x$enableval" = "xyes"; then + ac_build_spec=$enableval + fi + ], [ + ac_build_spec=no + ] ) +if test "x$ac_build_spec" = "xyes"; then + AC_CHECK_PROG(HAVE_PDFLATEX, pdflatex, yes) + AC_CHECK_PROG(HAVE_BIBTEX, bibtex, yes) + AC_CHECK_PROG(HAVE_TRANSFIG, fig2dev, yes) + if test -r doc/spec/spec.tex; then + if test "x$HAVE_PDFLATEX" = "xyes"; then + if test "x$HAVE_BIBTEX" = "xyes"; then + if test "x$HAVE_TRANSFIG" = "xyes"; then + tex_pkg_list=`fgrep usepackage doc/spec/spec.tex | grep \{ | grep -v ltablex` + tex_pkg_ok="yes" + for pkg_line in $tex_pkg_list; do + pkg_name=`echo $pkg_line | sed -e 's/.*{\(.*\)}.*/\1/'` + AC_MSG_CHECKING([for Tex package $pkg_name]) + cat >conftest.tex <<_ACEOF +\\documentclass{book} +$pkg_line +\\begin{document} +Hello World. +\\end{document} +_ACEOF + if pdflatex -interaction batchmode -halt-on-error conftest < /dev/null > /dev/null 2>&1; then + AC_MSG_RESULT([ok]) + else + tex_pkg_ok="no" + AC_MSG_RESULT([no]) + fi + done + if test -w conftest.tex; then rm conftest.tex; fi + if test -w conftest.tex; then rm conftest.aux; fi + if test -w conftest.pdf; then rm conftest.pdf; fi + if test "x$tex_pkg_ok" = "xyes"; then + BUILD_SPEC="true" + fi + fi + fi + fi + fi +fi +AM_CONDITIONAL(BUILD_SPEC, $BUILD_SPEC) +if test $BUILD_SPEC = "false"; then + AC_MSG_WARN([*** Format Specification will not built.]) +fi + +dnl Check for valgrind +VALGRIND_ENVIRONMENT="" +ac_enable_valgrind=no +AC_ARG_ENABLE(valgrind-testing, + AS_HELP_STRING([--enable-valgrind-testing], [Enable running of tests inside Valgrind]), + [ ac_enable_valgrind=$enableval ], [ ac_enable_valgrind=no] ) + +if test "x${ac_enable_valgrind}" = xyes ; then + if test "x${enable_shared}" = xyes ; then + VALGRIND_ENVIRONMENT="libtool --mode=execute " + fi + + AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) + if test "x$HAVE_VALGRIND" = xyes ; then + VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100" + AC_SUBST(VALGRIND_ENVIRONMENT) + TESTS_INFO="Type 'make check' to run test suite. Tests will be run under: + ${VALGRIND_ENVIRONMENT}" + else + TESTS_INFO="Type 'make check' to run test suite (Valgrind not found)" + fi +else + TESTS_INFO="Type 'make check' to run test suite (Valgrind testing not enabled)" +fi + +dnl -------------------------------------------------- +dnl Set build flags based on environment +dnl -------------------------------------------------- + +dnl Set some target options + +cflags_save="$CFLAGS" +if test -z "$GCC"; then + case $host in + *) + DEBUG="-g -DDEBUG" + CFLAGS="-O" + PROFILE="-g -p -DDEBUG" ;; + esac +else + + case $host in + *) + DEBUG="-g -Wall -Wno-parentheses -DDEBUG -D__NO_MATH_INLINES" + CFLAGS="-Wall -Wno-parentheses -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops" + PROFILE="-Wall -Wno-parentheses -pg -g -O3 -fno-inline-functions -DDEBUG";; + esac +fi +CFLAGS="$CFLAGS $cflags_save" + +cpu_x86_64=no +cpu_x86_32=no +AC_ARG_ENABLE(asm, + AS_HELP_STRING([--disable-asm], [Disable assembly optimizations]), + [ ac_enable_asm=$enableval ], [ ac_enable_asm=yes] ) + +if test "x${ac_enable_asm}" = xyes; then + cpu_optimization="no optimization for your platform, please send a patch" + case $target_cpu in + i[[3456]]86) + cpu_x86_32=yes + cpu_optimization="32 bit x86" + AC_DEFINE([OC_X86_ASM], [], [make use of x86 asm optimization]) + if test "x$target_vendor" = "xapple"; then + THEORA_LDFLAGS="$THEORA_LDFLAGS -Wl,-read_only_relocs,suppress" + fi + ;; + x86_64) + cpu_x86_64=yes + cpu_optimization="64 bit x86" + AC_DEFINE([OC_X86_ASM], [], [make use of x86 asm optimization]) + AC_DEFINE([OC_X86_64_ASM], [], [make use of x86_64 asm optimization]) + ;; + esac +else + cpu_optimization="disabled" +fi +AM_CONDITIONAL([CPU_x86_64], [test x$cpu_x86_64 = xyes]) +AM_CONDITIONAL([CPU_x86_32], [test x$cpu_x86_32 = xyes]) + +# Test whenever ld supports -version-script +AC_PROG_LD +AC_PROG_LD_GNU +AC_MSG_CHECKING([how to control symbol export]) + +THDEC_VERSION_ARG="" +THENC_VERSION_ARG="" +TH_VERSION_ARG="" +if test "x$lt_cv_prog_gnu_ld" = "xyes"; then + case "$target_os" in + *mingw*) + THEORA_LDFLAGS="$THEORA_LDFLAGS -no-undefined" + THDEC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/xmingw32/libtheoradec-all.def" + THENC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/xmingw32/libtheoraenc-all.def" + THENC_VERSION_ARG="$THENC_VERSION_ARG -ltheoradec" + THC_VERSION_ARG="-export-symbols \$(top_srcdir)/win32/libtheora.def" + AC_MSG_RESULT([-export-symbols]) + ;; + linux* | solaris* | gnu* | k*bsd*-gnu) + THDEC_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script-dec' + THENC_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script-enc' + TH_VERSION_ARG='-Wl,--version-script=$(srcdir)/Version_script' + AC_MSG_RESULT([--version-script]) + ;; + *) + # build without versioning + AC_MSG_RESULT([no]) + ;; + esac +else + case "$target_os" in + darwin*) + THDEC_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theoradec.exp' + THENC_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theoraenc.exp' + TH_VERSION_ARG='-Wl,-exported_symbols_list,$(srcdir)/theora.exp' + AC_MSG_RESULT([-exported_symbols_list]) + ;; + *) + # build without versioning + AC_MSG_RESULT([no]) + ;; + esac +fi + +THEORADEC_LDFLAGS="$THEORA_LDFLAGS $THDEC_VERSION_ARG" +THEORAENC_LDFLAGS="$THEORA_LDFLAGS $THENC_VERSION_ARG" +THEORA_LDFLAGS="$THEORA_LDFLAGS $TH_VERSION_ARG" +AC_SUBST(THEORADEC_LDFLAGS) +AC_SUBST(THEORAENC_LDFLAGS) +AC_SUBST(THEORA_LDFLAGS) + +dnl -------------------------------------------------- +dnl Checks for support libraries and headers +dnl -------------------------------------------------- + +dnl check for Ogg +HAVE_OGG=no + +dnl first check through pkg-config since it's more flexible + +dnl check for pkg-config itself so we don't try the m4 macro without pkg-config +AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes) +if test "x$HAVE_PKG_CONFIG" = "xyes" +then + PKG_CHECK_MODULES(OGG, ogg >= 1.1, HAVE_OGG=yes, HAVE_OGG=no) +fi +if test "x$HAVE_OGG" = "xno" +then + dnl fall back to the old school test + XIPH_PATH_OGG(, AC_MSG_ERROR([ + libogg is required to build this package! + please see http://www.xiph.org/ for how to + obtain a copy. + ])) + cflags_save=$CFLAGS + libs_save=$LIBS + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" + AC_CHECK_FUNC(oggpackB_read, , [ + AC_MSG_ERROR([newer libogg version (1.1 or later) required]) + ]) + CFLAGS=$cflags_save + LIBS=$libs_save +fi + + +dnl check for Vorbis +HAVE_VORBIS=no + +dnl first check through pkg-config since it's more flexible + +if test "x$HAVE_PKG_CONFIG" = "xyes" +then + PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, HAVE_VORBIS=yes, HAVE_VORBIS=no) + dnl also set VORBISENC_LIBS since an examples needs it + dnl the old .m4 sets this to a value to use on top of VORBIS_LIBS, + dnl so we do the same here. + VORBISENC_LIBS="-lvorbisenc" + AC_SUBST(VORBISENC_LIBS) +fi +if test "x$HAVE_VORBIS" = "xno" +then + dnl fall back to the old school test + XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no) +fi + +dnl check for SDL +HAVE_SDL=no + +AM_PATH_SDL(,[ + HAVE_SDL=yes + SDL_LIBS=`$SDL_CONFIG --libs` +],AC_MSG_WARN([*** Unable to find SDL -- Not compiling example players ***])) + +dnl check for OSS +HAVE_OSS=no +AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[ + HAVE_OSS=yes + break +]) +if test x$HAVE_OSS != xyes; then + AC_MSG_WARN([OSS audio support not found -- not compiling player_example]) +fi + +dnl OpenBSD needs -lossaudio to use the oss interface +OSS_LIBS= +case "$target_os" in + openbsd*) + OSS_LIBS='-lossaudio' + ;; +esac +AC_SUBST(OSS_LIBS) + +dnl check for libpng +HAVE_PNG=no +if test "x$HAVE_PKG_CONFIG" = "xyes" +then + PKG_CHECK_MODULES(PNG, libpng, HAVE_PNG=yes, HAVE_PNG=no) +fi +AC_SUBST(PNG_CFLAGS) +AC_SUBST(PNG_LIBS) + +dnl check for libcairo +HAVE_CAIRO=no +AC_ARG_ENABLE(telemetry, + AS_HELP_STRING([--enable-telemetry], [Enable debugging output controls]), + [ ac_enable_telemetry=$enableval ], [ ac_enable_telemetry=no] ) + +if test "x${ac_enable_telemetry}" = xyes; then + if test "x$HAVE_PKG_CONFIG" = "xyes" + then + PKG_CHECK_MODULES(CAIRO, cairo, HAVE_CAIRO=yes, HAVE_CAIRO=no) + AC_DEFINE([HAVE_CAIRO], [], [libcairo is available for visual debugging output]) + fi + if test x$HAVE_CAIRO != xyes; then + AC_MSG_WARN([libcairo not found -- not compiling telemetry output support ]) + fi + AC_SUBST(CAIRO_CFLAGS) + AC_SUBST(CAIRO_LIBS) +fi + +dnl -------------------------------------------------- +dnl Overall build configuration options +dnl -------------------------------------------------- + +dnl Configuration option for building of floating point code. + +ac_enable_float=yes +AC_ARG_ENABLE(float, + AS_HELP_STRING([--disable-float], [Disable use of floating point code]), + [ ac_enable_float=$enableval ], [ ac_enable_float=yes] ) + +if test "x${ac_enable_float}" != xyes ; then + AC_DEFINE([THEORA_DISABLE_FLOAT], [], + [Define to exclude floating point code from the build]) +fi +AM_CONDITIONAL(THEORA_DISABLE_FLOAT, [test "x${ac_enable_float}" != xyes]) + +dnl Configuration option for building of encoding support. + +ac_enable_encode=yes +AC_ARG_ENABLE(encode, + AS_HELP_STRING([--disable-encode], [Disable encoding support]), + [ ac_enable_encode=$enableval ], [ ac_enable_encode=yes] ) + +if test "x${ac_enable_encode}" != xyes ; then + AC_DEFINE([THEORA_DISABLE_ENCODE], [], + [Define to exclude encode support from the build]) +else + if test x$HAVE_VORBIS = xyes; then + BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES encoder_example\$(EXEEXT)" + else + AC_MSG_NOTICE([Vorbis missing, cannot build example encoder]) + fi +fi +AM_CONDITIONAL(THEORA_DISABLE_ENCODE, [test "x${ac_enable_encode}" != xyes]) + +dnl Configuration option for examples + +ac_enable_examples=yes +AC_ARG_ENABLE(examples, + AS_HELP_STRING([--disable-examples], [Disable examples]), + [ ac_enable_examples=$enableval ], [ ac_enable_examples=yes] ) +AM_CONDITIONAL(THEORA_ENABLE_EXAMPLES, [test "x${ac_enable_examples}" != xno]) + +dnl -------------------------------------------------- +dnl Check for headers +dnl -------------------------------------------------- + +dnl none here + +dnl -------------------------------------------------- +dnl Check for typedefs, structures, etc +dnl -------------------------------------------------- + +dnl none + +dnl -------------------------------------------------- +dnl Check for library functions +dnl -------------------------------------------------- + +dnl OpenBSD needs -lcompat for ftime() used by dump_video.c +AC_SEARCH_LIBS([ftime], [compat]) + +dnl substitute the included getopt if the system doesn't support long options +AC_CHECK_FUNC(getopt_long, + [GETOPT_OBJS=''], + [GETOPT_OBJS='getopt.$(OBJEXT) getopt1.$(OBJEXT)']) +AC_SUBST(GETOPT_OBJS) + +if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes -a x$HAVE_VORBIS = xyes; then + BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example\$(EXEEXT)" +fi +if test x$HAVE_PNG = xyes; then + BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES png2theora\$(EXEEXT)" +fi +AC_SUBST(BUILDABLE_EXAMPLES) + +dnl -------------------------------------------------- +dnl Do substitutions +dnl -------------------------------------------------- + +AC_SUBST(DEBUG) +AC_SUBST(PROFILE) + +AC_OUTPUT([ + Makefile + lib/Makefile + include/Makefile include/theora/Makefile + examples/Makefile + doc/Makefile doc/Doxyfile doc/spec/Makefile + tests/Makefile + m4/Makefile + libtheora.spec + theora.pc + theora-uninstalled.pc + theoradec.pc + theoradec-uninstalled.pc + theoraenc.pc + theoraenc-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 +if test $BUILD_SPEC = "false"; then + spec_build="no" +else + spec_build="yes" +fi + +AC_MSG_RESULT([ +------------------------------------------------------------------------ + $PACKAGE $VERSION: Automatic configuration OK. + + General configuration: + + Encoding support: ........... ${ac_enable_encode} + Floating point support: ..... ${ac_enable_float} + Assembly optimization: ...... ${cpu_optimization} + Debugging telemetry: ........ ${ac_enable_telemetry} + Build example code: ......... ${ac_enable_examples} + API Documentation: .......... ${doc_build} + Format Documentation: ....... ${spec_build} + + Installation paths: + + libtheora: ................... ${LIBDIR} + C header files: .............. ${INCLUDEDIR}/theora + Documentation: ............... ${DOCDIR} + + Building: + + Type 'make' to compile $PACKAGE. + + Type 'make install' to install $PACKAGE. + + ${TESTS_INFO} + + Example programs will be built but not installed. +------------------------------------------------------------------------ +]) + diff --git a/libs/libtheora-1.1/debian/changelog b/libs/libtheora-1.1/debian/changelog new file mode 100644 index 00000000..bfcd6440 --- /dev/null +++ b/libs/libtheora-1.1/debian/changelog @@ -0,0 +1,15 @@ +libtheora (0.0.0.alpha3-1) unstable; urgency=low + + * Initial upload to Debian. + + -- Christopher L Cheney Tue, 29 Jun 2004 22:00:00 -0500 + +libtheora (0.0.0-0) unstable; urgency=low + + * Initial Release. + + -- Christopher L Cheney Wed, 25 Sep 2002 21:00:00 -0500 + +Local variables: +mode: debian-changelog +End: diff --git a/libs/libtheora-1.1/debian/control b/libs/libtheora-1.1/debian/control new file mode 100644 index 00000000..28921c31 --- /dev/null +++ b/libs/libtheora-1.1/debian/control @@ -0,0 +1,24 @@ +Source: libtheora +Section: libs +Priority: optional +Maintainer: Christopher L Cheney +Build-Depends: cdbs, autotools-dev, debhelper (>> 4.0.0), devscripts, libogg-dev (>= 1.1.0), libvorbis-dev, python +Standards-Version: 3.6.1.0 + +Package: libtheora0 +Architecture: any +Section: libs +Depends: ${shlibs:Depends} +Description: The Theora Video Compression Codec + Ogg Theora + +Package: libtheora-dev +Architecture: any +Section: libdevel +Depends: libtheora0 (= ${Source-Version}), libogg-dev +Description: The Theora Compression Codec (development files) + Theora is a fully open, non-proprietary, patent-and-royalty-free, + general-purpose compressed video format. + . + This package contains the header files and documentation needed to develop + applications with libtheora. diff --git a/libs/libtheora-1.1/debian/copyright b/libs/libtheora-1.1/debian/copyright new file mode 100644 index 00000000..5eb0d7b0 --- /dev/null +++ b/libs/libtheora-1.1/debian/copyright @@ -0,0 +1,38 @@ +This package was debianized by Christopher L Cheney on +Wed, 25 Sep 2002 21:00:00 -0500. + +It was downloaded from http://svn.xiph.org/trunk/theora/ + +Upstream Authors: Xiph.Org Foundation + +Copyright: + +Copyright (c) 2002-2009 Xiph.org Foundation + +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 the Xiph.org Foundation 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 REGENTS 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/libs/libtheora-1.1/debian/libtheora-dev.install b/libs/libtheora-1.1/debian/libtheora-dev.install new file mode 100644 index 00000000..adab6bc8 --- /dev/null +++ b/libs/libtheora-1.1/debian/libtheora-dev.install @@ -0,0 +1,5 @@ +debian/tmp/usr/include/theora/theora.h +debian/tmp/usr/lib/libtheora.a +debian/tmp/usr/lib/libtheora.la +debian/tmp/usr/lib/libtheora.so +debian/tmp/usr/lib/pkgconfig/theora.pc diff --git a/libs/libtheora-1.1/debian/libtheora0.install b/libs/libtheora-1.1/debian/libtheora0.install new file mode 100644 index 00000000..cac5198b --- /dev/null +++ b/libs/libtheora-1.1/debian/libtheora0.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/libtheora.so.0 +debian/tmp/usr/lib/libtheora.so.0.0.0 diff --git a/libs/libtheora-1.1/debian/rules b/libs/libtheora-1.1/debian/rules new file mode 100644 index 00000000..4b0564ec --- /dev/null +++ b/libs/libtheora-1.1/debian/rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk diff --git a/libs/libtheora-1.1/debian/watch b/libs/libtheora-1.1/debian/watch new file mode 100644 index 00000000..033083d2 --- /dev/null +++ b/libs/libtheora-1.1/debian/watch @@ -0,0 +1,3 @@ +version=2 + +http://downloads.xiph.org/releases/theora/libtheora-(.*)\.tar\.gz debian uupdate diff --git a/libs/libtheora-1.1/doc/Doxyfile.in b/libs/libtheora-1.1/doc/Doxyfile.in new file mode 100644 index 00000000..ea155730 --- /dev/null +++ b/libs/libtheora-1.1/doc/Doxyfile.in @@ -0,0 +1,1142 @@ +# Doxyfile 1.3.7 + +# 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 +#--------------------------------------------------------------------------- + +# 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 = libtheora + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 2 levels of 10 sub-directories 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: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en +# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, +# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). +#This tag is now obsolete, according to doxygen 1.5.2 +#USE_WINDOWS_ENCODING = NO + +# 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 = NO + +# 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 the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# 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 DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = 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 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 + +# 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 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 + +#--------------------------------------------------------------------------- +# 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 = YES + +# 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 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 +# users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# 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 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 = YES + +# 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_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 + +#--------------------------------------------------------------------------- +# 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 = NO + +# 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 + +# 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. + +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/theora + +# 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 + +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. + +EXCLUDE_PATTERNS = + +# 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 , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. + +INPUT_FILTER = + +# 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 (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# 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_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 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 compressed 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 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 + +# 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 + +# If the GENERATE_TREEVIEW tag 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 (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = 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 + +#--------------------------------------------------------------------------- +# 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 = YES + +# 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. + +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 = NO + +# 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 = NO + +# 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 + +#--------------------------------------------------------------------------- +# 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_PREDEFINED 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. + +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 + +# 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 + +# 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 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 tags 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 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 + +# 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 on 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 MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. +#This tag is now obsolete, according to doxygen 1.5.2 +#MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. +#This tag is now obsolete, according to doxygen 1.5.2 +#MAX_DOT_GRAPH_HEIGHT = 1024 + +# 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 a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. +#This tag is now obsolete, according to doxygen 1.5.2 +#MAX_DOT_GRAPH_DEPTH = 0 + +# 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 + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/libs/libtheora-1.1/doc/Makefile.am b/libs/libtheora-1.1/doc/Makefile.am new file mode 100644 index 00000000..783bd015 --- /dev/null +++ b/libs/libtheora-1.1/doc/Makefile.am @@ -0,0 +1,72 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = spec + +static_docs = vp3-format.txt color.html \ + draft-ietf-avt-rtp-theora-00.xml \ + draft-ietf-avt-rtp-theora-00.txt + +doc_DATA = $(static_docs) doxygen-build.stamp + +EXTRA_DIST = $(static_docs) Doxyfile.in + +if HAVE_DOXYGEN +doxygen-build.stamp: Doxyfile $(top_srcdir)/include/theora/*.h + 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)/libtheora + +dist-hook: + if test -d libtheora; then \ + mkdir $(dist_docdir); \ + echo -n "copying built documenation..."; \ + for dir in libtheora/*; do \ + b=`basename $$dir`; \ + if test $$b != ".svn"; then \ + if test -d $$dir; then \ + mkdir $(dist_docdir)/$$b; \ + for f in $$dir/*; do \ + cp -p $$f $(dist_docdir)/$$b; \ + done; \ + fi; \ + fi; \ + done; \ + echo "OK"; \ + fi + for item in $(EXTRA_DIST); do \ + if test -d $$item; then \ + echo -n "cleaning $$item dir for distribution..."; \ + rm -rf `find $(distdir)/$$item -name .svn`; \ + echo "OK"; \ + fi; \ + done + + + +install-data-local: doxygen-build.stamp + $(mkinstalldirs) $(DESTDIR)$(docdir) + if test -d libtheora; then \ + for dir in libtheora/*; do \ + if test -d $$dir; then \ + b=`basename $$dir`; \ + $(mkinstalldirs) $(DESTDIR)$(docdir)/$$b; \ + for f in $$dir/*; do \ + $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$b; \ + done \ + fi \ + done \ + fi + +uninstall-local: + rm -rf $(DESTDIR)$(docdir) + +clean-local: + if test -d libtheora; then rm -rf libtheora; fi + if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi + diff --git a/libs/libtheora-1.1/doc/color.html b/libs/libtheora-1.1/doc/color.html new file mode 100644 index 00000000..ad7d90cd --- /dev/null +++ b/libs/libtheora-1.1/doc/color.html @@ -0,0 +1,602 @@ + +xiph.org: Ogg Theora documentation + +

+Ogg Theora I specification: color space conventions +

+

Overview

+

+There are a large number of different color standards used in digital video. +Since Theora is a lossy codec, it restricts itself to only a few of them to + simplify playback. +Unlike the alternate method of describing all the parameters of the color + model, this allows a few dedicated routines for color conversion to be written + and heavily optimized in a decoder. +More flexible conversion functions should instead be specified in an encoder, + where additional computational complexity is more easily tolerated. +The color spaces were selected to give a fair representation of color standards + in use around the world today. +Most of the standards that do not exactly match one of these can be converted + to one fairly easily. +

+

+The Theora codec identification header contains an 8-bit value that describes + the color space. +This merely selects one of the color spaces available from an enumerated list. +Currently, only two color spaces are defined, with a third possibility that + indicates the color space is "unknown". +All of them are Y'CbCr color spaces with one luma channel + and two chroma channels. +Each channel contains 8-bit discrete values in the range 0-255, which represent + non-linear gamma pre-corrected signals. +

+

color space parameters

+

+The parameters which describe each color space are listed below. +These are the parameters needed to map colors from the encoded + Y'CbCr representation to the device-independent color + space CIE XYZ (1931). +

+
+
Y'CbCr to Y'PbPr
+
+

+This conversion takes 8-bit discrete values in the range 0-255 and maps them to + real values in the range [0,1] for Y and [-1/2,1/2] for Pb + and Pr. +Because some values may fall outside the offset and excursion defined for each + channel in the Y'CbCr space, the results may fall + outside these ranges in Y'PbPr space. +No clamping should be done at this stage. +

+

+Parameters: OffsetY,Cb,Cr, + ExcursionY,Cb,Cr, +

+ + + + + + + + + + + + + + + + +
Y'out= +(Y'in-OffsetY)/ + ExcursionY +
Pb= +(Cb-OffsetCb)/ + ExcursionCb +
Pr= +(Cr-OffsetCr)/ + ExcursionCr +
+
+
Y'PbPr to R'G'B'
+
+

+This conversion takes the one luma and two chroma channel representation and + maps it to the non-linear R'G'B' space used to drive actual output devices. +Values should be clamped into the range [0,1] after this stage. +

+Parameters: Kb, Kr +

+ + + + + + + + + + + + + + + + +
R'=Y' + 2(1-Kr)Pr
G'= +Y' + + 2((Kb-1)Kb/ + (1-Kb-Kr))Pb + + 2((Kr-1)Kr/ + (1-Kb-Kr))Pr +
B'=Y' + 2(1-Kb)Pb
+
+
R'G'B' to RGB (Output device gamma correction)
+
+

+This conversion takes the non-linear R'G'B' voltage levels and maps it to the + linear light levels produced by the actual output device. +Note that this conversion is only that of the output device, and its inverse is + not that used by the input device. +Because a dim viewing environment is assumed in most television standards, the + overall gamma between the input and output devices is usually around 1.1 to + 1.2, and not a strict 1.0. +

+

+For calibration with actual output devices, the model + + + + + + +
L=(E'+Δ)γ
+should be used, with Δ the free parameter and γ held + fixed to the value specified in this document. +The conversion function presented here is an idealized version with Δ=0. +

+

+Parameters: γ +

+ + + + + + + + + + + + + + + + +
R=R'γ
G=G'γ
B=B'γ
+
+
RGB to R'G'B' (Input device gamma correction)
+
+

+This conversion takes linear light levels and maps them to the non-linear + voltage levels used to drive the actual output device. +This information is merely informative. +It is not required for building a decoder or for converting between the various + formats and the actual output capabilities of a particular device. +

+

+A linear segment is introduced on the low end to reduce noise in dark areas of + the image. +The rest of the scale is adjusted so that the power segment of the curve + intersects the linear segment with the proper slope, and so that it still maps + 0 to 0 and 1 to 1. +

+

+Parameters: β, α, δ, + ε +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
R'= +(1+ε)Rβ-ε +for δ ≤ R ≤ 1
R'=αRfor 0 ≤ R < δ
G'= +(1+ε)Gβ-ε +for δ ≤ G ≤ 1
G'=αGfor 0 ≤ G < δ
B'= +(1+ε)Bβ-ε +for δ ≤ B ≤ 1
B'=αBfor 0 ≤ B < δ
+
+
RGB to CIE XYZ (1931)
+
+

+This conversion maps a device-dependent linear RGB space to the + device-independent linear CIE XYZ space. +The parameters are the CIE chromaticity coordinates of the three primaries, + red, green, and blue, as well as the chromaticity coordinates of the white + point of the device. +This is how hardware manufacturers and standards typically describe a + particular RGB space. +The math required to convert these parameters into a useful transformation + matrix is reproduced below. +

+

+Parameters: xr,g,b,w, yr,g,b,w +

+ + + + + + + + + + + + + + + + +
F= + + +) +
( + + + + + + + + + + + + + + + +
xr/yrxg/ygxb/yb
111
+(1-xr-yr)/yr + +(1-xg-yg)/yg + +(1-xb-yb)/yb +
+ + + +
( + + + +
sr
sg
sb
)
= + + + +
F-1( + + + +
xw/yw
1
+(1-xw-yw)/yw +
)
+ + + +
( + + + +
X
Y
Z
)
= + + + +
F( + + + +
srR
sgG
sbB
)
+
+
+

available color spaces

+

+These are the color spaces currently defined for use by Ogg Theora video. +Each one has a short name, with which it is referred to in this document, and + a more detailed specification of the standards from which its parameters are + derived. +Some standards do not specify all the parameters necessary. +For these unspecified parameters, this document serves as the definition of + what should be used when encoding or decoding Ogg Theora video. +

Rec 470M (Rec. ITU-R BT.470-6 System M/NTSC with Rec. ITU-R BT.601-5)

+

+This color space is used by broadcast television and DVDs in much of the + Americas, Japan, Korea, and the Union of Myanmar + [Rec470]. +This color space may also be used for System M/PAL (Brazil), with an + appropriate conversion supplied by the encoder to compensate for the + different gamma value. +See the Rec 470BG section for an appropriate gamma value to assume for M/PAL + input. +

+

+In the US, studio monitors are adjusted to a D65 white point + (xw,yw=0.313,0.329). +In Japan, studio monitors are adjusted to a D white of 9300K + (xw,yw=0.285,0.293). +

+

+Rec 470 does not specify a digital encoding of the color signals. +For Ogg Theora, Rec. ITU-R BT.601-5 is used, starting from the R'G'B' signals + specified by Rec 470 [Rec601]. +

+

+

+Rec 470 does not specify an input gamma function. +For Ogg Theora, the Rec 709 input function is used. +This is the same as that specified by SMPTE 170M, which claims to reflect + modern practice in the creation of NTSC signals (c. 1994) + [SMPTE170M]. +

+

parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetY,Cb,Cr=(16,128,128)
+ExcursionY,Cb,Cr +=(219,224,224)
Kb=0.114
Kr=0.299
γ=2.2
β=0.45
α=4.5
δ=0.018
ε=0.099
xr,yr=0.67,0.33
xg,yg=0.21,0.71
xb,yb=0.14,0.08
+(Illuminant C) xw,yw +=0.310,0.316
+

+Rec 470BG (Rec. ITU-R BT.470-6 Systems B and G with Rec. ITU-R BT.601-5) +

+

+This color space is used by the PAL and SECAM systems in much of the rest of + the world [Rec470]. +This can be used directly by systems (B, B1, D, D1, G, H, I, K, N)/PAL and (B, + D, G, H, K, K1, L)/SECAM. +

+

+Note that the Rec 470BG chromaticity values are different from those specified + in Rec 470M. +When PAL and SECAM systems were first designed, they were based upon the same + primaries as NTSC. +However, as methods of making color picture tubes have changed, the primaries + used have changed as well. +The US recommends using correction circuitry to approximate the existing, + standard NTSC primaries. +Current PAL and SECAM systems have standardized on primaries in accord with + more recent technology. +

+

+Rec 470 provisionally permits the use of the NTSC chromaticity values (given + above) with legacy PAL and SECAM equipment. +In Ogg Theora, material must be decoded assuming the new PAL and SECAM + primaries. +Material intended for display on old legacy devices should be converted by the + decoder. +

+

+The official Rec 470BG specifies a gamma value of γ=2.8. +However, in practice this value is unrealistically high + [Poy97]. +Rec 470BG states that the overall system gamma should be approximately + γ/β=1.2. +However, most cameras pre-correct with a gamma value of β=0.45, + which suggests an output device gamma of approximately γ=2.67. +This is the value recommended for use with PAL systems in Ogg Theora. +

+

+Rec 470 does not specify a digital encoding of the color signals. +For Ogg Theora, Rec. ITU-R BT.601-5 is used, starting from the R'G'B' signals + specified by Rec 470 [Rec601]. +

+

+Rec 470 does not specify an input gamma function. +For Ogg Theora, the Rec 709 input function is used. +

+

parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OffsetY,Cb,Cr=(16,128,128)
+ExcursionY,Cb,Cr +=(219,224,224)
Kb=0.114
Kr=0.299
γ=2.67
β=0.45
α=4.5
δ=0.018
ε=0.099
xr,yr=0.64,0.33
xg,yg=0.29,0.60
xb,yb=0.15,0.06
+(D65) xw,yw +=0.313,0.329
+

references

+
+
[Poy97]
+
+Poynton, Charles, Frequently-Asked Questions about Gamma. + http://www.poynton.com/GammaFAQ/html, + Feb. 1997. +
+
[Rec470]
+
+Recommendation ITU-R BT.470-6, Conventional Television Systems + (1970, revised 1998). International Telecommunications Union, 1211 Geneva 20, + Switzerland. +
+
[Rec601]
+
+Recommendation ITU-R BT.601-5, Studio Encoding Parameters of + Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios + (1982, revised 1995). International Telecommunications Union, 1211 Geneva 20, + Switzerland. +
+
[Rec709]
+
+Recommendation ITU-R BT.709-5, Parameter values for the + HDTV standards for production and international programme exchange + (1990, revised 2002). International Telecommunications Union, 1211 Geneva 20, + Switzerland. +
+
[SMPTE170M]
+
+Society of Motion Picture and Television Engineers, Television — + Composite Analog Video Signal — NTSC for Studio Applications. + SMPTE-170M, 1994 +
+
[SMPTE240M]
+
+Society of Motion Picture and Television Engineers, Television — + Signal Parameters — 1125-Line High-Definition Production. + SMPTE-240M, 1999. +
+
+ + diff --git a/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.txt b/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.txt new file mode 100644 index 00000000..f759aef6 --- /dev/null +++ b/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.txt @@ -0,0 +1,1400 @@ + + + +AVT Working Group L. Barbato +Internet-Draft Xiph.Org +Expires: January 22, 2007 July 21, 2006 + + + draft-ietf-avt-rtp-theora-00 + RTP Payload Format for Theora Encoded Video + +Status of this Memo + + By submitting this Internet-Draft, each author represents that any + applicable patent or other IPR claims of which he or she is aware + have been or will be disclosed, and any of which he or she becomes + aware will be disclosed, in accordance with Section 6 of BCP 79. + + Internet-Drafts are working documents of the Internet Engineering + Task Force (IETF), its areas, and its working groups. Note that + other groups may also distribute working documents as Internet- + Drafts. + + Internet-Drafts are draft documents valid for a maximum of six months + and may be updated, replaced, or obsoleted by other documents at any + time. It is inappropriate to use Internet-Drafts as reference + material or to cite them other than as "work in progress." + + The list of current Internet-Drafts can be accessed at + http://www.ietf.org/ietf/1id-abstracts.txt. + + The list of Internet-Draft Shadow Directories can be accessed at + http://www.ietf.org/shadow.html. + + This Internet-Draft will expire on January 22, 2007. + +Copyright Notice + + Copyright (C) The Internet Society (2006). + +Abstract + + This document describes a RTP payload format for transporting Theora + encoded video. It details the RTP encapsulation mechanism for raw + Theora data and configuration headers necessary to configure the + decoder. + + Also included within the document are the necessary details for the + use of Theora with MIME and Session Description Protocol (SDP). + +Editors Note + + + +Barbato Expires January 22, 2007 [Page 1] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + All references to RFC XXXX are to be replaced by references to the + RFC number of this memo, when published. + + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 + 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 + 2. Payload Format . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.1. RTP Header . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.2. Payload Header . . . . . . . . . . . . . . . . . . . . . . 5 + 2.3. Payload Data . . . . . . . . . . . . . . . . . . . . . . . 6 + 2.4. Example RTP Packet . . . . . . . . . . . . . . . . . . . . 7 + 3. Configuration Headers . . . . . . . . . . . . . . . . . . . . 8 + 3.1. In-band Header Transmission . . . . . . . . . . . . . . . 9 + 3.1.1. Packed Configuration . . . . . . . . . . . . . . . . . 9 + 3.2. Out of Band Transmission . . . . . . . . . . . . . . . . . 10 + 3.2.1. Packed Headers . . . . . . . . . . . . . . . . . . . . 11 + 3.3. Loss of Configuration Headers . . . . . . . . . . . . . . 13 + 4. Comment Headers . . . . . . . . . . . . . . . . . . . . . . . 13 + 5. Frame Packetizing . . . . . . . . . . . . . . . . . . . . . . 14 + 5.1. Example Fragmented Theora Packet . . . . . . . . . . . . . 15 + 5.2. Packet Loss . . . . . . . . . . . . . . . . . . . . . . . 17 + 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 + 6.1. Mapping MIME Parameters into SDP . . . . . . . . . . . . . 19 + 6.1.1. SDP Example . . . . . . . . . . . . . . . . . . . . . 20 + 6.2. Usage with the SDP Offer/Answer Model . . . . . . . . . . 20 + 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 + 7.1. Stream Video . . . . . . . . . . . . . . . . . . . . . . . 21 + 8. Security Considerations . . . . . . . . . . . . . . . . . . . 21 + 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 22 + 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 + 10.1. Normative References . . . . . . . . . . . . . . . . . . . 22 + 10.2. Informative References . . . . . . . . . . . . . . . . . . 23 + Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 24 + Intellectual Property and Copyright Statements . . . . . . . . . . 25 + + + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 2] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +1. Introduction + + Theora is a general purpose, lossy video codec. It is based on the + VP3 video codec produced by On2 Technologies and has been donated to + the Xiph.org Foundation. + + Theora I is a block-based lossy transform codec that utilizes an 8 x + 8 Type-II Discrete Cosine Transform and block-based motion + compensation. This places it in the same class of codecs as MPEG-1, + MPEG-2, MPEG-4, and H.263. The details of how individual blocks are + organized and how DCT coefficients are stored in the bitstream differ + substantially from these codecs, however. Theora supports only intra + frames (I frames in MPEG) and inter frames (P frames in MPEG). + + Theora provides none of its own framing, synchronization, or + protection against transmission errors. Instead, the codec expects + to receive a discrete sequence of data packets. Theora is a free- + form variable bit rate (VBR) codec, and these packets have no minimum + size, maximum size, or fixed/expected size. Theora packets are thus + intended to be used with a transport mechanism that provides free- + form framing, synchronization, positioning, and error correction in + accordance with these design assumptions, such as Ogg [1] or RTP/AVP + [3]. + + Theora I currently supports progressive video data of arbitrary + dimensions at a constant frame rate in one of several Y'CbCr color + spaces. Three different chroma subsampling formats are supported: + 4:2:0, 4:2:2, and 4:4:4. The Theora I format does not support + interlaced material, variable frame rates, bit-depths larger than 8 + bits per component, nor alternate color spaces such as RGB or + arbitrary multi-channel spaces. Black and white content can be + efficiently encoded, however, because the uniform chroma planes + compress well. For performance reason, arbitrary frame sizes will be + encoded rounding both dimensions to the upper multiple of 16. The + original width and height will be encoded in the header and the + decoder will use this information to clip the decoded frame to the + right dimensions. + + Theora is similar to the Vorbis audio [10] in that the decoder reads + the probability model for the entropy coder and all quantization + parameters from special "header" packets at the start of the + compressed data. It is therefore impossible to decode any video data + without having previously fetched the codec info and codec setup + headers, although Theora can begin to decode at an arbitrary intra- + frame packet so long as the codec has been initialized with the + associated headers. + + + + + +Barbato Expires January 22, 2007 [Page 3] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +1.1. Terminology + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in RFC 2119 [2]. + + +2. Payload Format + + For RTP based transportation of Theora encoded video the standard RTP + header is followed by a 4 octets payload header, then the payload + data. The payload headers are used to associate the Theora data with + its associated decoding codebooks as well as indicating if the + following packet contains fragmented Theora data and/or the number of + whole Theora data frames. The payload data contains the raw Theora + bitstream information. + + For RTP based transport of Theora encoded video the standard RTP + header is followed by a 4 octets payload header, then the payload + data. + +2.1. RTP Header + + The format of the RTP header is specified in [3] and shown in Figure + 1. This payload format uses the fields of the header in a manner + consistent with that specification. + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | sequence number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 1: RTP Header + + The RTP header begins with an octet of fields (V, P, X, and CC) to + support specialized RTP uses (see [3] and [4] for details). For + Theora RTP, the following values are used. + + Version (V): 2 bits + + + + +Barbato Expires January 22, 2007 [Page 4] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + This field identifies the version of RTP. The version used by this + specification is two (2). + + Padding (P): 1 bit + + Padding MAY be used with this payload format according to section 5.1 + of [3]. + + Extension (X): 1 bit + + The Extension bit is used in accordance with [3]. + + CSRC count (CC): 4 bits + + The CSRC count is used in accordance with [3]. + + Marker (M): 1 bit + + The Marker bit is used in accordance with [3]. + + Payload Type (PT): 7 bits + + An RTP profile for a class of applications is expected to assign a + payload type for this format, or a dynamically allocated payload type + SHOULD be chosen which designates the payload as Theora. + + Sequence number: 16 bits + + The sequence number increments by one for each RTP data packet sent, + and may be used by the receiver to detect packet loss and to restore + packet sequence. This field is detailed further in [3]. + + Timestamp: 32 bits + + A timestamp representing the presentation time of the first sample of + the first Theora packet in the RTP packet. The clock frequency MUST + be set to 90kHz. + + SSRC/CSRC identifiers: + + These two fields, 32 bits each with one SSRC field and a maximum of + 16 CSRC fields, are as defined in [3]. + +2.2. Payload Header + + The 4 octets following the RTP Header section represent the Payload + Header. This header is split into a number of bitfields detailing + the format of the following Payload Datagrams. + + + +Barbato Expires January 22, 2007 [Page 5] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | F |TDT|# pkts.| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + +-+-+-+-+-+-+-+-+ + + Figure 2: Payload Header + + Configuration Ident: 24 bits + + This 24 bit field is used to associate the Theora data to a decoding + Packed Configuration. + + Fragment type (F): 2 bit + + This field is set according to the following list + + 0 = Not Fragmented + 1 = Start Fragment + 2 = Continuation Fragment + 3 = End Fragment + + This field must be zero if the number of packets field is non-zero. + + Theora Data Type (TDT): 2 bits + + This field sets the packet payload type for the Theora data. There + are currently three Theora payload types currently used and one + reserved for future use. + + 0 = Raw Theora payload + 1 = Theora Packed Configuration payload + 2 = Legacy Theora Comment payload + 3 = Reserved + + The packets with a TDT of value 3 MUST be ignored + + The last 4 bits represent the number of complete packets in this + payload. This provides a maximum number of 15 Theora packets in the + payload. If the packet contains fragmented data the number of + packets MUST be set to 0. + +2.3. Payload Data + + Each Theora payload section starts with a two octets length header + that is used to represent the size of the following data payload, + + + +Barbato Expires January 22, 2007 [Page 6] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + followed by the raw Theora packet data. + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length | Theora Data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 3: Payload Data + + The Theora codec uses relatively unstructured raw packets containing + binary integer fields of arbitrary width that often do not fall on an + octet boundary. When a Theora encoder produces packets, unused space + in the last byte of a packet is always zeroed during the encoding + process. Thus, should this unused space be read, it will return + binary zeros. + + For payloads which consist of multiple Theora packets the payload + data consists of the payload length field followed by the first + Theora packet's data, then the payload length followed by the second + Theora packet, and so on for each of the Theora packets in the + payload. + +2.4. Example RTP Packet + + Here is an example RTP packet containing two Theora packets. + + RTP Packet Header: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 2 |0|0| 0 |0| PT | sequence number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronisation source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 4: Example RTP Packet + + Payload Data: + + + + + + +Barbato Expires January 22, 2007 [Page 7] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 0 | 0 | 2 pks | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length | .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. data | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 5: Example Theora Payload Packet + + The payload portion of the packet begins with the 24 bit + Configuration ident field followed by 8 bits describing the payload. + The Fragment type field is set to 0, indicating that this packet + contains whole Theora frame data. The Data type field is set to 0 + (theora raw data). The number of whole Theora data packets is set to + 2. + + Each of the payload blocks starts with the two octets length field + followed by the variable length Theora packet data. + + +3. Configuration Headers + + To decode a Theora stream three configuration header packets are + needed. The first (Identification Header) indicates frame + dimensions, quality, blocks used and Theora encoder version. The + second (Comment Header) contains stream metadata and the third (Setup + Header) contains details of the dequantization and Huffman tables. + + Since this information must be transmitted reliably, and as the RTP + stream may change certain configuration data mid-session, there are + different methods for delivering this configuration data to a client, + both in-band and out-of-band, which are detailed below. SDP delivery + is used to set up an initial state for the client application. The + changes may be due to different dequantization and Huffman tables as + well as different bitrates of the stream. + + The delivery vectors in use are specified by an SDP attribute that + indicates the method and the optional URI where the Theora Packed + Configuration (Section 3.1.1) Packets could be fetched. Different + delivery methods MAY be advertised for the same session. The in-band + codebook delivery SHOULD be considered as baseline, out-of-band + + + +Barbato Expires January 22, 2007 [Page 8] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + delivery methods that don't use RTP will not be described in this + document. For non chained streams, the RECOMMENDED Configuration + delivery method is inline the Packed Configuration (Section 3.1.1) in + the SDP as explained in the IANA considerations (Section 6.1) + + The 24 bit Ident field is used to map which Configuration will be + used to decode a packet. When the Ident field changes, it indicates + that a change in the stream has taken place. The client application + MUST have in advance the correct configuration and if the client + detects a change in the Ident value and does not have this + information it MUST NOT decode the raw data associated until it has + fetched the correct Configuration. + +3.1. In-band Header Transmission + + The Packed Configuration (Section 3.1.1) Payload is sent in-band with + the packet type bits set to match the payload type. Clients MUST be + capable of dealing with periodic re-transmission of the configuration + headers. + +3.1.1. Packed Configuration + + A Theora Packed Configuration is identified by a payload type field + of 1. Of the three headers, defined in the Theora I specification + [16], the identification and the setup will be packed together, while + the comment header will be completely suppressed. It is up to the + client to provide a minimal size comment header to the decoder if + required by the implementation. + + + + + + + + + + + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 9] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | xxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 0 | 1 | 1| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | length | Identification .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Identification .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Identification .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Identification | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. | Setup .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 6: Packed Configuration Figure + + The Ident field is set with the value that will be used by the Raw + Payload Packets to address this Configuration. The Fragment type is + set to 0 since the packet bears full Packed configuration, the number + of packet is set to 1. In practice, Packed Headers usually need to + be fragmented to fit the path MTU. + +3.2. Out of Band Transmission + + This section, as stated above, does not cover all the possible out- + of-band delivery methods since they rely on different protocols and + are linked to specific applications. The following packet definition + SHOULD be used in out-of-band delivery and MUST be used when + Configuration is inlined in the SDP. + + + + + + +Barbato Expires January 22, 2007 [Page 10] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +3.2.1. Packed Headers + + As mentioned above, the recommended delivery vector for Theora + configuration data is via a retrieval method that can be performed + using a reliable transport protocol. As the RTP headers are not + required for this method of delivery the structure of the + configuration data is slightly different. The packed header starts + with a 32 bit count field which details the number of packed headers + that are contained in the bundle. Next is the Packed header payload + for each setup id. + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Number of packed headers | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Packed header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Packed header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 7: Packed Headers Overview + + Since the Configuration Ident and the Identification Header are fixed + length there is only a 16bit Length tag to define the length of the + packed headers. + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Length | Identification Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Identification Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 8: Packed Headers Detail + + The key difference from the in-band format is that there is no need + for the payload header octet. + + + + + + +Barbato Expires January 22, 2007 [Page 11] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +3.2.1.1. Packed Headers IANA Considerations + + The following IANA considerations MUST only be applied to the packed + headers. + + MIME media type name: audio + + MIME subtype: theora-config + + Required Parameters: + + None + + Optional Parameters: + + None + + Encoding considerations: + + This media type contains binary data. + + Security Considerations: + + See Section 6 of RFC XXXX. + + Interoperability considerations: + + None + + Published specification: + + RFC XXXX [RFC Editor: please replace by the RFC number of this + memo, when published] + + Applications which use this media type: + + Theora encoded video, configuration data. + + Additional information: + + None + + Person & email address to contact for further information: + + Luca Barbato: + IETF Audio/Video Transport Working Group + + + + + +Barbato Expires January 22, 2007 [Page 12] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Intended usage: COMMON + + Restriction on usage: + + This media type does not depend on the transport. + + Author: + + Luca Barbato + + Change controller: + + IETF AVT Working Group + +3.3. Loss of Configuration Headers + + Unlike the loss of raw Theora payload data, the loss of a + configuration header can lead to a situation where it will not be + possible to successfully decode the stream. + + A loss of a Configuration Packet causes the stream decoder to halt + and SHOULD be reported to the client as well as a loss report sent + via RTCP. + + +4. Comment Headers + + When the payload type is set to 2, the packet contains comment + metadata such as artist name, track title and so on. These metadata + messages are not intended to be fully descriptive but to offer basic + title information. Clients MAY choose to completely ignore them. + The details on the comments format can be found in the Theora + documentation [16]. + + + + + + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 13] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | xxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 0 | 2 | 1| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | length | Comment .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Comment .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Comment | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 9: Comment Packet + + The 2 byte length field is necessary since this Theora packet could + be fragmented. + + +5. Frame Packetizing + + Each RTP packet contains either one complete Theora packet, one + Theora packet fragment, or an integer number of complete Theora + packets (up to a maximum of 15 packets, since the number of packets + is defined by a 4 bit value). + + Any Theora data packet that is less than path MTU SHOULD be bundled + in the RTP packet with as many Theora packets as will fit, up to a + maximum of 15. Path MTU is detailed in [7] and [8]. + + A fragmented packet has a zero in the last four bits of the payload + header. The RTP packet containing the first fragment will set the + Fragment type to 1. Each RTP packet after the first will set the + Fragment type to 2 in the payload header. The RTP packet containing + the last fragment of the Theora packet will have the Fragment type + set to 3. If the fragmented Theora packet spans only two RTP + packets, the first will set the Fragment type field to 1 and the + second will set it to 2. To maintain the correct sequence for + fragmented packet reception the timestamp field of fragmented packets + + + +Barbato Expires January 22, 2007 [Page 14] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + MUST be the same as the first packet sent, with the sequence number + incremented as normal for the subsequent RTP packets. + +5.1. Example Fragmented Theora Packet + + Here is an example fragmented Theora packet split over three RTP + packets. Each packet contains the standard RTP headers as well as + the 4 octets Theora headers. + + Packet 1: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1000 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 1 | 0 | 0| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length | Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 10: Example Fragmented Packet (Packet 1) + + In this packet the initial sequence number is 1000 and the timestamp + is xxxxx. The Fragment type field is set to one, indicating it is + the start packet of a serie of fragments. The number of packets + field is set to 0, and as the payload is raw Theora data the Theora + payload type field is set to 0. + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 15] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Packet 2: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1001 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 2 | 0 | 0| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length | .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 11: Example Fragmented Packet (Packet 2) + + The Fragment type field is set to 2 and the number of packets field + is set to 0. For large Theora fragments there can be several of + these type of payload packets. The maximum RTP packet size SHOULD be + no greater than the path MTU, including all RTP and payload headers. + The sequence number has been incremented by one but the timestamp + field remains the same as the initial packet. + + + + + + + + + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 16] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Packet 3: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1002 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Configuration Ident | 3 | 0 | 0| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length | .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 12: Example Fragmented Packet (Packet 3) + + This is the last Theora fragment packet. The Fragment type filed is + set to 3 and the packet count remains set to 0. As in the previous + packets the timestamp remains set to the first packet in the sequence + and the sequence number has been incremented. + +5.2. Packet Loss + + As there is no error correction within the Theora stream, packet loss + will result in a loss of signal. Packet loss is more of an issue for + fragmented Theora packets as the client will have to cope with the + handling of the Fragment type field. If we use the fragmented Theora + packet example above and the first packet is lost the client MUST + detect that the next packet has the packet count field set to 0 and + the Fragment type is set to 2 and MUST drop it. The next packet, + which is the final fragmented packet, MUST be dropped in the same + manner. Feedback reports on lost and dropped packets MUST be sent + back via RTCP.[note: reordering] + + If a particular multicast session has a large number of participants + care must be taken to prevent an RTCP feedback implosion, [9], in the + event of packet loss from a large number of participants. + + Loss of any of the Configuration fragment will result in the loss of + the full Configuration packet as detailed in the Loss of + + + +Barbato Expires January 22, 2007 [Page 17] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Configuration Headers (Section 3.3) section. + + +6. IANA Considerations + + MIME media type name: video + + MIME subtype: theora + + Required Parameters: + + sampling: Determines the chroma subsampling format. + + width: Determines the number of pixels per line. This is an + integer between 1 and 1048561 and MUST be in multiples of 16. + + height: Determines the number of lines per frame encoded. This is + an integer between 1 and 1048561 and MUST be in multiples of + 16. + + delivery-method: indicates the delivery methods in use, the + possible values are: inline, in_band, out_band/specific_name + Where "specific_name" is the name of the out of band delivery + method. + + configuration: the base16 [11] (hexadecimal) representation of the + Packed Headers (Section 3.2.1). + + Optional Parameters: + + configuration-uri: the URI of the configuration headers in case of + out of band transmission. In the form of + "protocol://path/to/resource/". Depending on the specific + method the single ident packets could be retrived by their + number or aggregated in a single stream, aggregates MAY be + compressed using gzip [12] or bzip2 [14] and an sha1 [13] + checksum MAY be provided in the form of + "protocol://path/to/resource/aggregated.bz2!sha1hash" + + Encoding considerations: + + This media type is framed and contains binary data. + + Security Considerations: + + See Section 6 of RFC XXXX. + + + + + +Barbato Expires January 22, 2007 [Page 18] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Interoperability considerations: + + None + + Published specification: + + RFC XXXX [RFC Editor: please replace by the RFC number of this + memo, when published] + + Ogg Theora I specification: Codec setup and packet decode. + Available from the Xiph website, http://www.xiph.org + + Applications which use this media type: + + Audio streaming and conferencing tools + + Additional information: + + None + + Person & email address to contact for further information: + + Luca Barbato: + IETF Audio/Video Transport Working Group + + Intended usage: + + COMMON + + Restriction on usage: + + This media type depends on RTP framing, and hence is only defined + for transfer via RTP [3] + + Author: + + Luca Barbato + + Change controller: + + IETF AVT Working Group + + +6.1. Mapping MIME Parameters into SDP + + The information carried in the MIME media type specification has a + specific mapping to fields in the Session Description Protocol (SDP) + [6], which is commonly used to describe RTP sessions. When SDP is + + + +Barbato Expires January 22, 2007 [Page 19] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + used to specify sessions the mapping are as follows: + + o The MIME type ("video") goes in SDP "m=" as the media name. + + o The MIME subtype ("theora") goes in SDP "a=rtpmap" as the encoding + name. + + o The clock rate in the "a=rtpmap" line MUST be 90000 + + o The mandated parameters "delivery-method" and "configuration" MUST + be included in the SDP "a=fmpt" attribute. + + o The optional parameter "configuration-uri", when present, MUST be + included in the SDP "a=fmpt" attribute and MUST follow the + delivery-method that applies. + + If the stream uses multiple decoder setup configurations and all of + them are known in advance, the Configuration Packet for each file + SHOULD be packaged together and passed to the client using the + configuration attribute. + + The URI specified in the configuration-uri attribute MUST point to a + location where all of the Configuration Packets needed for the life + of the session reside. + +6.1.1. SDP Example + + The following example shows a basic SDP for a single stream. The + first configuration packet is inlined in the sdp, other + configurations could be fetched at any time from the first provided + uri using or all the known configuration could be downloaded using + the second uri. The inline base16 [11] configuration string is + omitted because of the lenght. + c=IN IP4 192.0.0.1 + m=video RTP/AVP 98 + a=rtpmap:98 theora/90000 + a=fmtp:98 sampling=YCbCr-4:2:2; width=1280; height=720; delivery- + method=inline; configuration=base16string1; delivery- + method=out_band/rtsp; delivery-method=out_band/rtsp; + configuration-uri=rtsp://path/to/resource/; delivery- + method=out_band/http; configuration-uri=http://another/path/to/ + resource/aggregate.bz2!sha1hash; + +6.2. Usage with the SDP Offer/Answer Model + + The offer, as described in An Offer/Answer Model Session Description + Protocol [5], may contain a large number of delivery methods per + single fmtp attribute, the answerer MUST remove every delivery-method + + + +Barbato Expires January 22, 2007 [Page 20] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + and configuration-uri not supported. All the parameters MUST not be + altered on answer otherwise. + + +7. Examples + + The following examples are common usage patterns that MAY be applied + in such situations, the main scope of this section is to explain + better usage of the transmission vectors. + +7.1. Stream Video + + This is one of the most common situation: one single server streaming + content in multicast, the clients may start a session at random time. + The content itself could be a mix of live stream, as the wj's voice + or studio scenes, and stored streams, as the music she plays. + + In this situation we don't know in advance how many codebooks we will + use. The clients can join anytime and users expect to start the + fruition of the content in a short time. + + On join the client will receive the current Configuration necessary + to decode the current streams inlined in the SDP so that the decoding + will start immediately after. + + When the streamed content changes the new Configuration is sent in- + band before the actual stream, and the Configuration that has to be + sent inline in the SDP updated. Since the inline method is + unreliable, an out of band fallback is provided. + + The client could choose to fetch the Configuration from the alternate + source as soon it discovers a Configuration packet got lost inline or + use selective retransmission [17], if the server supports the + feature. + + A serverside optimization would be to keep an hash list of the + Configurations per session to avoid packing all of them and send the + same Configuration with different Ident tags + + A clientside optimization would be to keep a tag list of the + Configurations per session and don't process configuration packets + already known. + + +8. Security Considerations + + RTP packets using this payload format are subject to the security + considerations discussed in the RTP specification [3]. This implies + + + +Barbato Expires January 22, 2007 [Page 21] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + that the confidentiality of the media stream is achieved by using + encryption. Because the data compression used with this payload + format is applied end-to-end, encryption may be performed on the + compressed data. Where the size of a data block is set care MUST be + taken to prevent buffer overflows in the client applications. + + +9. Acknowledgments + + This document is a continuation of draft-kerr-avt-theora-rtp-00.txt + + Thanks to the AVT, Ogg Theora Communities / Xiph.org, Fluendo, Ralph + Giles, Mike Smith, Phil Kerr, Timothy Terriberry, Stefan Ehmann, + Alessandro Salvatori, Politecnico di Torino (LS)^3/IMG Group in + particular Federico Ridolfo, Francesco Varano, Giampaolo Mancini, + Juan Carlos De Martin. + + +10. References + +10.1. Normative References + + [1] Pfeiffer, S., "The Ogg Encapsulation Format Version 0", + RFC 3533. + + [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement + Levels", RFC 2119. + + [3] Schulzrinne, H., Casner, S., Frederick, R., and V. Jacobson, + "RTP: A Transport Protocol for real-time applications", + RFC 3550. + + [4] Schulzrinne, H. and S. Casner, "RTP Profile for video and Video + Conferences with Minimal Control.", RFC 3551. + + [5] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with + Session Description Protocol (SDP)", RFC 3264. + + [6] Handley, M. and V. Jacobson, "SDP: Session Description + Protocol", RFC 2327. + + [7] Mogul et al., J., "Path MTU Discovery", RFC 1063. + + [8] McCann et al., J., "Path MTU Discovery for IP version 6", + RFC 1981. + + [9] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, + "Extended RTP Profile for RTCP-based Feedback (RTP/AVPF)", + + + +Barbato Expires January 22, 2007 [Page 22] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + + Internet Draft (draft-ietf-avt-rtcp-feedback-11: Work in + progress). + + [10] Barbato, L., "RTP Payload Format for Vorbis Encoded Audio - + draft-ietf-avt-vorbis-rtp-00", Internet Draft (Work in + progress). + + [11] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", + RFC 3548. + + [12] Deutsch, P., "GZIP file format specification version 4.3", + RFC 1952. + + [13] National Institute of Standards and Technology, "Secure Hash + Standard", May 1993. + + [14] Seward, J., "libbz2 and bzip2". + +10.2. Informative References + + [15] "libTheora: Available from the Xiph website, + http://www.xiph.org". + + [16] "Theora I specification: Codec setup and packet decode. + http://www.xiph.org/theora/doc/Theora_I_spec.pdf". + + [17] Friedman, T., Caceres, R., and A. Clark, "RTP Control Protocol + Extended Reports (RTCP XR)", RFC 3611, November 2003. + + [18] "ITU-T Recommendation V.42, 1994, Rev. 1. Error-correcting + Procedures for DCEs Using Asynchronous-to-Synchronous + Conversion. International Telecommunications Union. Available + from the ITU website, http://www.itu.int". + + [19] "ISO 3309, October 1984, 3rd Edition. Information Processing + Systems--Data Communication High-Level Data Link Control + Procedure--Frame Structure. International Organization for + Standardization.". + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 23] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +Author's Address + + Luca Barbato + Xiph.Org + + Email: lu_zero@gentoo.org + URI: http://www.xiph.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Barbato Expires January 22, 2007 [Page 24] + +Internet-Draft draft-ietf-avt-rtp-theora-00 July 2006 + + +Intellectual Property Statement + + The IETF takes no position regarding the validity or scope of any + Intellectual Property Rights or other rights that might be claimed to + pertain to the implementation or use of the technology described in + this document or the extent to which any license under such rights + might or might not be available; nor does it represent that it has + made any independent effort to identify any such rights. Information + on the procedures with respect to rights in RFC documents can be + found in BCP 78 and BCP 79. + + Copies of IPR disclosures made to the IETF Secretariat and any + assurances of licenses to be made available, or the result of an + attempt made to obtain a general license or permission for the use of + such proprietary rights by implementers or users of this + specification can be obtained from the IETF on-line IPR repository at + http://www.ietf.org/ipr. + + The IETF invites any interested party to bring to its attention any + copyrights, patents or patent applications, or other proprietary + rights that may cover technology that may be required to implement + this standard. Please address the information to the IETF at + ietf-ipr@ietf.org. + + +Disclaimer of Validity + + This document and the information contained herein are provided on an + "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS + OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET + ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE + INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +Copyright Statement + + Copyright (C) The Internet Society (2006). This document is subject + to the rights, licenses and restrictions contained in BCP 78, and + except as set forth therein, the authors retain all their rights. + + +Acknowledgment + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + +Barbato Expires January 22, 2007 [Page 25] + diff --git a/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.xml b/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.xml new file mode 100644 index 00000000..2f8af399 --- /dev/null +++ b/libs/libtheora-1.1/doc/draft-ietf-avt-rtp-theora-00.xml @@ -0,0 +1,1146 @@ + + + + + + + + +draft-ietf-avt-rtp-theora-00 + + +Xiph.Org +
+lu_zero@gentoo.org +http://www.xiph.org/ +
+
+ + +General +AVT Working Group +I-D + +Internet-Draft +Theora +RTP + + + +This document describes a RTP payload format for transporting Theora encoded video. It details the RTP encapsulation mechanism for raw Theora data and configuration headers necessary to configure the decoder. + + + +Also included within the document are the necessary details for the use of Theora with MIME and Session Description Protocol (SDP). + + + + + + +All references to RFC XXXX are to be replaced by references to the RFC number of this memo, when published. + + + +
+ + + +
+ +Theora is a general purpose, lossy video codec. It is based on the VP3 video codec produced by On2 Technologies and has been donated to the Xiph.org Foundation. + + +Theora I is a block-based lossy transform codec that utilizes an 8 x 8 Type-II Discrete Cosine Transform and block-based motion compensation. This places it in the same class of codecs as MPEG-1, MPEG-2, MPEG-4, and H.263. The details of how individual blocks are organized and how DCT coefficients are stored in the bitstream differ substantially from these codecs, however. Theora supports only intra frames (I frames in MPEG) and inter frames (P frames in MPEG). + + + +Theora provides none of its own framing, synchronization, or protection against transmission errors. Instead, the codec expects to receive a discrete sequence of data packets. Theora is a free-form variable bit rate (VBR) codec, and these packets have no minimum size, maximum size, or fixed/expected size. Theora packets are thus intended to be used with a transport mechanism that provides free-form framing, synchronization, positioning, and error correction in accordance with these design assumptions, such as Ogg or RTP/AVP . + + + +Theora I currently supports progressive video data of arbitrary dimensions at a constant frame rate in one of several Y'CbCr color spaces. +Three different chroma subsampling formats are supported: 4:2:0, 4:2:2, and 4:4:4. The Theora I format does not support interlaced material, variable frame rates, bit-depths larger than 8 bits per component, nor alternate color spaces such as RGB or arbitrary multi-channel spaces. Black and white content can be efficiently encoded, however, because the uniform chroma planes compress well. For performance reason, arbitrary frame sizes will be encoded rounding both dimensions to the upper multiple of 16. The original width and height will be encoded in the header and the decoder will use this information to clip the decoded frame to the right dimensions. + + + +Theora is similar to the Vorbis audio in that the decoder reads the probability model for the entropy coder and all quantization parameters from special "header" packets at the start of the compressed data. It is therefore impossible to decode any video data without having previously fetched the codec info and codec setup headers, although Theora can begin to decode at an arbitrary intra-frame packet so long as the codec has been initialized with the associated headers. + + +
+ + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", +and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 . + + +
+
+ +
+ + +For RTP based transportation of Theora encoded video the standard RTP header is followed by a 4 octets payload header, then the payload data. The payload headers are used to associate the Theora data with its associated decoding codebooks as well as indicating if the following packet contains fragmented Theora data and/or the number of whole Theora data frames. The payload data contains the raw Theora bitstream information. + + + +For RTP based transport of Theora encoded video the standard RTP header is followed by a 4 octets payload header, then the payload data. + + +
+ + +The format of the RTP header is specified in and shown in Figure 1. This payload format uses the fields of the header in a manner consistent with that specification. + + +
+ +
+ + +The RTP header begins with an octet of fields (V, P, X, and CC) to support specialized RTP uses (see and for details). For Theora RTP, the following values are used. + + + +Version (V): 2 bits +This field identifies the version of RTP. The version used by this specification is two (2). + + + +Padding (P): 1 bit +Padding MAY be used with this payload format according to section 5.1 of . + + + +Extension (X): 1 bit +The Extension bit is used in accordance with . + + + +CSRC count (CC): 4 bits +The CSRC count is used in accordance with . + + + +Marker (M): 1 bit +The Marker bit is used in accordance with . + + + +Payload Type (PT): 7 bits +An RTP profile for a class of applications is expected to assign a payload type for this format, or a dynamically allocated payload type SHOULD be chosen which designates the payload as Theora. + + + +Sequence number: 16 bits +The sequence number increments by one for each RTP data packet sent, and may be used by the receiver to detect packet loss and to restore packet sequence. This field is detailed further in . + + + +Timestamp: 32 bits +A timestamp representing the presentation time of the first sample of the first Theora packet in the RTP packet. The clock frequency MUST be set to 90kHz. + + + +SSRC/CSRC identifiers: +These two fields, 32 bits each with one SSRC field and a maximum of 16 CSRC fields, are as defined in . + + +
+ +
+ + +The 4 octets following the RTP Header section represent the Payload Header. This header is split into a number of bitfields detailing the format of the following Payload Datagrams. + + +
+ +
+ + +Configuration Ident: 24 bits + +This 24 bit field is used to associate the Theora data to a decoding Packed Configuration. + + + +Fragment type (F): 2 bit + +This field is set according to the following list + + + + 0 = Not Fragmented + 1 = Start Fragment + 2 = Continuation Fragment + 3 = End Fragment + + +This field must be zero if the number of packets field is non-zero. + + +Theora Data Type (TDT): 2 bits + +This field sets the packet payload type for the Theora data. There are currently three Theora payload types currently used and one reserved for future use. + + + + + 0 = Raw Theora payload + 1 = Theora Packed Configuration payload + 2 = Legacy Theora Comment payload + 3 = Reserved + + + The packets with a TDT of value 3 MUST be ignored + + +The last 4 bits represent the number of complete packets in this payload. This provides a maximum number of 15 Theora packets in the payload. If the packet contains fragmented data the number of packets MUST be set to 0. + + +
+ +
+ + +Each Theora payload section starts with a two octets length header that is used to represent the size of the following data payload, followed by the raw Theora packet data. + + +
+ +
+ + +The Theora codec uses relatively unstructured raw packets containing binary integer fields of arbitrary width that often do not fall on an octet boundary. When a Theora encoder produces packets, unused space in the last byte of a packet is always zeroed during the encoding process. Thus, should this unused space be read, it will return binary zeros. + + + +For payloads which consist of multiple Theora packets the payload data consists of the payload length field followed by the first Theora packet's data, then the payload length followed by the second Theora packet, and so on for each of the Theora packets in the payload. + + +
+ +
+ + +Here is an example RTP packet containing two Theora packets. + + +RTP Packet Header: + + +
+ +
+ + + +Payload Data: + + +
+ +
+ + +The payload portion of the packet begins with the 24 bit Configuration ident field followed by 8 bits describing the payload. The Fragment type field is set to 0, indicating that this packet contains whole Theora frame data. The Data type field is set to 0 (theora raw data). The number of whole Theora data packets is set to 2. + + + +Each of the payload blocks starts with the two octets length field followed +by the variable length Theora packet data. + + +
+
+ +
+ + +To decode a Theora stream three configuration header packets are needed. The first (Identification Header) indicates frame dimensions, quality, blocks used and Theora encoder version. The second (Comment Header) contains stream metadata and the third (Setup Header) contains details of the dequantization and Huffman tables. + + + +Since this information must be transmitted reliably, and as the RTP stream may change certain configuration data mid-session, there are different methods for delivering this configuration data to a client, both in-band and out-of-band, which are detailed below. SDP delivery is used to set up an initial state for the client application. The changes may be due to different dequantization and Huffman tables as well as different bitrates of the stream. + + + +The delivery vectors in use are specified by an SDP attribute that indicates the method and the optional URI where the Theora Packed Configuration Packets could be fetched. Different delivery methods MAY be advertised for the same session. The in-band codebook delivery SHOULD be considered as baseline, out-of-band delivery methods that don't use RTP will not be described in this document. For non chained streams, the RECOMMENDED Configuration delivery method is inline the Packed Configuration in the SDP as explained in the IANA considerations + + + +The 24 bit Ident field is used to map which Configuration will be used to decode a packet. When the Ident field changes, it indicates that a change in the stream has taken place. The client application MUST have in advance the correct configuration and if the client detects a change in the Ident value and does not have this information it MUST NOT decode the raw data associated until it has fetched the correct Configuration. + + + +
+ + +The Packed Configuration Payload is sent in-band with the packet type bits set to match the payload type. Clients MUST be capable of dealing with periodic re-transmission of the configuration headers. + + +
+ + +A Theora Packed Configuration is identified by a payload type field of 1. Of the three headers, defined in the Theora I specification, the identification and the setup will be packed together, while the comment header will be completely suppressed. It is up to the client to provide a minimal size comment header to the decoder if required by the implementation. + + +
+ +
+The Ident field is set with the value that will be used by the Raw Payload Packets to address this Configuration. The Fragment type is set to 0 since the packet bears full Packed configuration, the number of packet is set to 1. In practice, Packed Headers usually need to be fragmented to fit the path MTU. + + +
+ +
+ +
+ + +This section, as stated above, does not cover all the possible out-of-band delivery methods since they rely on different protocols and are linked to specific applications. The following packet definition SHOULD be used in out-of-band delivery and MUST be used when Configuration is inlined in the SDP. + + +
+ + +As mentioned above, the recommended delivery vector for Theora configuration data is via a retrieval method that can be performed using a reliable transport protocol. As the RTP headers are not required for this method of delivery the structure of the configuration data is slightly different. The packed header starts with a 32 bit count field which details the number of packed headers that are contained in the bundle. Next is the Packed header payload for each setup id. + + +
+ +
+ + +Since the Configuration Ident and the Identification Header are fixed length there is only a 16bit Length tag to define the length of the packed headers. + + +
+
+ +The key difference from the in-band format is that there is no need for the payload header octet. + + +
+ + +The following IANA considerations MUST only be applied to the packed headers. + + + + + + video + + + + theora-config + + + + + +None + + + + + + +None + + + + + + +This media type contains binary data. + + + + + + +See Section 6 of RFC XXXX. + + + + + + +None + + + + + + +RFC XXXX [RFC Editor: please replace by the RFC number of this memo, + when published] + + + + + + +Theora encoded video, configuration data. + + + + + + +None + + + + + + +Luca Barbato: <lu_zero@gentoo.org> + +IETF Audio/Video Transport Working Group + + + + + +COMMON + + + + + + +This media type does not depend on the transport. + + + + + + +Luca Barbato + + + + + +IETF AVT Working Group + + +
+
+ +
+ +
+ + +Unlike the loss of raw Theora payload data, the loss of a configuration header can lead to a situation where it will not be possible to successfully decode the stream. + + + +A loss of a Configuration Packet causes the stream decoder to halt and SHOULD be reported to the client as well as a loss report sent via RTCP. + + +
+ +
+ +
+ + +When the payload type is set to 2, the packet contains comment metadata such as artist name, track title and so on. These metadata messages are not intended to be fully descriptive but to offer basic title information. Clients MAY choose to completely ignore them. The details on the comments format can be found in the Theora documentation. + + +
+ +
+ +The 2 byte length field is necessary since this Theora packet could be fragmented. + +
+ +
+ + +Each RTP packet contains either one complete Theora packet, one Theora packet fragment, or an integer number of complete Theora packets (up to a maximum of 15 packets, since the number of packets is defined by a 4 bit value). + + + +Any Theora data packet that is less than path MTU SHOULD be bundled in the RTP packet with as many Theora packets as will fit, up to a maximum of 15. Path MTU is detailed in and . + + + +A fragmented packet has a zero in the last four bits of the payload header. The RTP packet containing the first fragment will set the Fragment type to 1. Each RTP packet after the first will set the Fragment type to 2 in the payload header. The RTP packet containing the last fragment of the Theora packet will have the Fragment type set to 3. If the fragmented Theora packet spans only two RTP packets, the first will set the Fragment type field to 1 and the second will set it to 2. To maintain the correct sequence for fragmented packet reception the timestamp field of fragmented packets MUST be the same as the first packet sent, with the sequence number incremented as normal for the subsequent RTP packets. + +
+ + +Here is an example fragmented Theora packet split over three RTP packets. Each packet contains the standard RTP headers as well as the 4 octets Theora headers. + + +
+ +
+ + +In this packet the initial sequence number is 1000 and the timestamp is xxxxx. The Fragment type field is set to one, indicating it is the start packet of a serie of fragments. The number of packets field is set to 0, and as the payload is raw Theora data the Theora payload type field is set to 0. + + +
+ +
+ + +The Fragment type field is set to 2 and the number of packets field is set to 0. For large Theora fragments there can be several of these type of payload packets. The maximum RTP packet size SHOULD be no greater than the path MTU, including all RTP and payload headers. The sequence number has been incremented by one but the timestamp field remains the same as the initial packet. + + +
+ +
+ + +This is the last Theora fragment packet. The Fragment type filed is set to 3 and the packet count remains set to 0. As in the previous packets the timestamp remains set to the first packet in the sequence and the sequence number has been incremented. + + +
+ +
+ + +As there is no error correction within the Theora stream, packet loss will result in a loss of signal. Packet loss is more of an issue for fragmented Theora packets as the client will have to cope with the handling of the Fragment type field. If we use the fragmented Theora packet example above and the first packet is lost the client MUST detect that the next packet has the packet count field set to 0 and the Fragment type is set to 2 and MUST drop it. The next packet, which is the final fragmented packet, MUST be dropped in the same manner. Feedback reports on lost and dropped packets MUST be sent back via RTCP.[note: reordering] + + + +If a particular multicast session has a large number of participants care must be taken to prevent an RTCP feedback implosion, , in the event of packet loss from a large number of participants. + + + +Loss of any of the Configuration fragment will result in the loss of the full Configuration packet as detailed in the Loss of Configuration Headers section. + + +
+
+ +
+ + + + + video + + + + theora + + + + + + + + + + Determines the chroma subsampling format. + + + + + Determines the number of pixels per line. This is an integer between 1 and 1048561 and MUST be in multiples of 16. + + + + +Determines the number of lines per frame encoded. This is an integer between 1 and 1048561 and MUST be in multiples of 16. + + + + + indicates the delivery methods in use, the possible values are: inline, in_band, out_band/specific_name +Where "specific_name" is the name of the out of band delivery method. + + + + + the base16 (hexadecimal) representation of the Packed Headers. + + + + + + + + + + + + the URI of the configuration headers in case of out of band transmission. In the form of "protocol://path/to/resource/". Depending on the specific method the single ident packets could be retrived by their number or aggregated in a single stream, aggregates MAY be compressed using gzip or bzip2 and an sha1 checksum MAY be provided in the form of "protocol://path/to/resource/aggregated.bz2!sha1hash" + + + + + + + +This media type is framed and contains binary data. + + + + + + +See Section 6 of RFC XXXX. + + + + + +None + + + + + + + + RFC XXXX [RFC Editor: please replace by the RFC number of this memo, when published] + +Ogg Theora I specification: Codec setup and packet decode. Available from the Xiph website, http://www.xiph.org + + + + + + + +Video streaming and conferencing tools + + + + + +None + + + + + + + +Luca Barbato: <lu_zero@gentoo.org> +IETF Audio/Video Transport Working Group + + + + + + + +COMMON + + + + + +This media type depends on RTP framing, and hence is only defined for transfer via RTP + + + + +Luca Barbato + + + + IETF AVT Working Group + + + + + +
+ + +The information carried in the MIME media type specification has a specific mapping to fields in the Session Description Protocol (SDP) , which is commonly used to describe RTP sessions. When SDP is used to specify sessions the mapping are as follows: + + + + + +The MIME type ("video") goes in SDP "m=" as the media name. + + +The MIME subtype ("theora") goes in SDP "a=rtpmap" as the encoding name. + + +The clock rate in the "a=rtpmap" line MUST be 90000 + + +The mandated parameters "delivery-method" and "configuration" MUST be included in the SDP "a=fmpt" attribute. + + +The optional parameter "configuration-uri", when present, MUST be included in the SDP "a=fmpt" attribute and MUST follow the delivery-method that applies. + + + + +If the stream uses multiple decoder setup configurations and all of them are known in advance, the Configuration Packet for each file SHOULD be packaged together and passed to the client using the configuration attribute. + + + +The URI specified in the configuration-uri attribute MUST point to a location where all of the Configuration Packets needed for the life of the session reside. + + +
+The following example shows a basic SDP for a single stream. The first configuration packet is inlined in the sdp, other configurations could be fetched at any time from the first provided uri using or all the known configuration could be downloaded using the second uri. The inline base16 configuration string is omitted because of the lenght. + + +c=IN IP4 192.0.0.1 +m=video RTP/AVP 98 +a=rtpmap:98 theora/90000 +a=fmtp:98 sampling=YCbCr-4:2:2; width=1280; height=720; delivery-method=inline; configuration=base16string1; delivery-method=out_band/rtsp; delivery-method=out_band/rtsp; configuration-uri=rtsp://path/to/resource/; delivery-method=out_band/http; configuration-uri=http://another/path/to/resource/aggregate.bz2!sha1hash; + +
+ +
+ +
+ + +The offer, as described in An Offer/Answer Model Session Description Protocol, may contain a large number of delivery methods per single fmtp attribute, the answerer MUST remove every delivery-method and configuration-uri not supported. All the parameters MUST not be altered on answer otherwise. + + +
+ +
+ +
+ + +The following examples are common usage patterns that MAY be applied in such situations, the main scope of this section is to explain better usage of the transmission vectors. + + +
+ +This is one of the most common situation: one single server streaming content in multicast, the clients may start a session at random time. The content itself could be a mix of live stream, as the wj's voice or studio scenes, and stored streams, as the music she plays. + +In this situation we don't know in advance how many codebooks we will use. The clients can join anytime and users expect to start the fruition of the content in a short time. + +On join the client will receive the current Configuration necessary to decode the current streams inlined in the SDP so that the decoding will start immediately after. + +When the streamed content changes the new Configuration is sent in-band before the actual stream, and the Configuration that has to be sent inline in the SDP updated. Since the inline method is unreliable, an out of band fallback is provided. + +The client could choose to fetch the Configuration from the alternate source as soon it discovers a Configuration packet got lost inline or use selective retransmission, if the server supports the feature. + +A serverside optimization would be to keep an hash list of the Configurations per session to avoid packing all of them and send the same Configuration with different Ident tags + +A clientside optimization would be to keep a tag list of the Configurations per session and don't process configuration packets already known. + +
+ +
+ +
+ +RTP packets using this payload format are subject to the security considerations discussed in the RTP specification . This implies that the confidentiality of the media stream is achieved by using encryption. Because the data compression used with this payload format is applied end-to-end, encryption may be performed on the compressed data. Where the size of a data block is set care MUST be taken to prevent buffer overflows in the client applications. + + +
+ +
+ +This document is a continuation of draft-kerr-avt-theora-rtp-00.txt + + +Thanks to the AVT, Ogg Theora Communities / Xiph.org, Fluendo, Ralph Giles, Mike Smith, Phil Kerr, Timothy Terriberry, Stefan Ehmann, Alessandro Salvatori, Politecnico di Torino (LS)³/IMG Group in particular Federico Ridolfo, Francesco Varano, Giampaolo Mancini, Juan Carlos De Martin. + + +
+ +
+ + + + + + + +The Ogg Encapsulation Format Version 0 + + + + + + + +Key words for use in RFCs to Indicate Requirement Levels + + + + + + + +RTP: A Transport Protocol for real-time applications + + + + + + + + + + +RTP Profile for video and Video Conferences with Minimal Control. + + + + + + + + + +An Offer/Answer Model with Session Description Protocol (SDP) + + + + + + + + +SDP: Session Description Protocol + + + + + + + + +Path MTU Discovery + + + + + + + +Path MTU Discovery for IP version 6 + + + + + + + +Extended RTP Profile for RTCP-based Feedback (RTP/AVPF) + + + + + + + + + + + +RTP Payload Format for Vorbis Encoded Audio - draft-ietf-avt-vorbis-rtp-00 + + + + + + + +The Base16, Base32, and Base64 Data Encodings + + + + + + + +GZIP file format specification version 4.3 + + + + + + + +Secure Hash Standard + +National Institute of Standards and Technology + + + + + + + +libbz2 and bzip2 + + + + + + + + + +libTheora: Available from the Xiph website, http://www.xiph.org + + + + + +Theora I specification: Codec setup and packet decode. http://www.xiph.org/theora/doc/Theora_I_spec.pdf + + + + + + +RTP Control Protocol Extended Reports (RTCP XR) + + + + + + + + + + + + + + +ITU-T Recommendation V.42, 1994, Rev. 1. Error-correcting Procedures for DCEs Using Asynchronous-to-Synchronous Conversion. International Telecommunications Union. Available from the ITU website, http://www.itu.int + + + + + + +ISO 3309, October 1984, 3rd Edition. Information Processing Systems--Data Communication High-Level Data Link Control Procedure--Frame Structure. International Organization for Standardization. + + + + + +
diff --git a/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.txt b/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.txt new file mode 100644 index 00000000..51261521 --- /dev/null +++ b/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.txt @@ -0,0 +1,1512 @@ + + +AVT Working Group P. Kerr +Internet-Draft Xiph.Org +Expires: August 1, 2005 January 31, 2005 + + + draft-kerr-avt-theora-rtp-00 + RTP Payload Format for Theora Encoded Video + +Status of this Memo + + This document is an Internet-Draft and is subject to all provisions + of section 3 of RFC 3667. By submitting this Internet-Draft, each + author represents that any applicable patent or other IPR claims of + which he or she is aware have been or will be disclosed, and any of + which he or she become aware will be disclosed, in accordance with + RFC 3668. + + Internet-Drafts are working documents of the Internet Engineering + Task Force (IETF), its areas, and its working groups. Note that + other groups may also distribute working documents as + Internet-Drafts. + + Internet-Drafts are draft documents valid for a maximum of six months + and may be updated, replaced, or obsoleted by other documents at any + time. It is inappropriate to use Internet-Drafts as reference + material or to cite them other than as "work in progress." + + The list of current Internet-Drafts can be accessed at + http://www.ietf.org/ietf/1id-abstracts.txt. + + The list of Internet-Draft Shadow Directories can be accessed at + http://www.ietf.org/shadow.html. + + This Internet-Draft will expire on August 1, 2005. + +Copyright Notice + + Copyright (C) The Internet Society (2005). + +Abstract + + This document describes a RTP payload format for transporting Theora + encoded video. It details the RTP encapsulation mechanism for raw + Theora data and configuration headers consisting of the quantization + matrices and the Huffman codebooks for the DCT coefficients, and a + table of limit values for the deblocking filter. + + Also included within the document are the necessary details for the + use of Theora with MIME and Session Description Protocol (SDP). + + + +Kerr Expires August 1, 2005 [Page 1] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +Editors Note + + All references to RFC XXXX are to be replaced by references to the + RFC number of this memo, when published. + +Table of Contents + + 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 + 1.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 + 2. Payload Format . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.1 RTP Header . . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.2 Payload Header . . . . . . . . . . . . . . . . . . . . . . 5 + 2.3 Payload Data . . . . . . . . . . . . . . . . . . . . . . . 6 + 2.4 Example RTP Packet . . . . . . . . . . . . . . . . . . . . 7 + 3. Frame Packetizing . . . . . . . . . . . . . . . . . . . . . . 8 + 3.1 Example Fragmented Theora Packet . . . . . . . . . . . . . 9 + 4. Packet Loss . . . . . . . . . . . . . . . . . . . . . . . . . 12 + 5. Configuration Headers . . . . . . . . . . . . . . . . . . . . 13 + 5.1 In-band Header Transmission . . . . . . . . . . . . . . . 13 + 5.1.1 Identification Header . . . . . . . . . . . . . . . . 13 + 5.1.2 Comment Header . . . . . . . . . . . . . . . . . . . . 15 + 5.1.3 Setup Header . . . . . . . . . . . . . . . . . . . . . 16 + 5.2 Packed Headers Delivery . . . . . . . . . . . . . . . . . 18 + 5.2.1 Packed Headers IANA Considerations . . . . . . . . . . 21 + 5.3 Setup Header Caching . . . . . . . . . . . . . . . . . . . 22 + 5.4 Loss of Configuration Headers . . . . . . . . . . . . . . 22 + 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 + 6.1 Mapping MIME Parameters into SDP . . . . . . . . . . . . . 24 + 7. Security Considerations . . . . . . . . . . . . . . . . . . . 25 + 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 25 + 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 25 + 9.1 Normative References . . . . . . . . . . . . . . . . . . . . 25 + 9.2 Informative References . . . . . . . . . . . . . . . . . . . 26 + Author's Address . . . . . . . . . . . . . . . . . . . . . . . 26 + Intellectual Property and Copyright Statements . . . . . . . . 27 + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 2] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +1. Introduction + + Theora is a general purpose, lossy video codec. It is based on the + VP3.1 video codec produced by On2 Technologies and has been donated + to the Xiph.org Foundation. + + Theora I is a block-based lossy transform codec that utilizes an 8 x + 8 Type-II Discrete Cosine Transform and block-based motion + compensation. This places it in the same class of codecs as MPEG-1, + MPEG-2, MPEG-4, and H.263. The details of how individual blocks are + organized and how DCT coefficients are stored in the bitstream differ + substantially from these codecs, however. Theora supports only intra + frames (I frames in MPEG) and inter frames (P frames in MPEG). + + Theora provides none of its own framing, synchronization, or + protection against transmission errors. Theora is a free-form + variable bit rate (VBR) codec, and packets have no minimum size, + maximum size, or fixed/expected size. Theora packets are thus + intended to be used with a transport mechanism that provides + free-form framing, synchronization, positioning, and error correction + in accordance with these design assumptions, such as Ogg [1]. or + RTP/AVP [3]. + + Theora I currently supports progressive video data of arbitrary + dimensions at a constant frame rate in one of several YCbCr color + spaces. Three different chroma subsampling formats are supported: + 4:2:0, 4:2:2, and 4:4:4. The Theora I format does not support + interlaced material, variable frame rates, bit-depths larger than 8 + bits per component, nor alternate color spaces such as RGB or + arbitrary multi-channel spaces. Black and white content can be + efficiently encoded, however, because the uniform chroma planes + compress well. + + Theora is similar to Vorbis audio [9] in that it requires the + inclusion of the entire probability model for the DCT coefficients + and all the quantization parameters in the bitstream headers to be + sent ahead of the video data. It is therefore impossible to decode + any frame in the stream without having previously fetched the codec + info and codec setup headers, although Theora can initiate decode at + an arbitrary intra-frame packet within a bitstream so long as the + codec has been initialized with the setup headers. + +1.1 Terminology + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in RFC 2119 [2]. + + + + +Kerr Expires August 1, 2005 [Page 3] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +2. Payload Format + + Each frame of digital video is packetized into one or more RTP + packets. If the data for a complete frame exceeds the network MTU, + it SHOULD be fragmented into multiple RTP packets, each smaller than + the MTU. A single RTP packet MAY contain data for more than one + Theora frame. + + For RTP based transportation of Theora encoded video the standard RTP + header is followed by a 5 octet payload header, then the payload + data. + +2.1 RTP Header + + The format of the RTP header is specified in [3] and shown in Figure + 1. This payload format uses the fields of the header in a manner + consistent with that specification. + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | sequence number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | timestamp | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 1: RTP Header + + The RTP header begins with an octet of fields (V, P, X, and CC) to + support specialized RTP uses (see [3] and [4] for details). For + Theora RTP, the following values are used. + + Version (V): 2 bits + + This field identifies the version of RTP. The version used by this + specification is two (2). + + Padding (P): 1 bit + + Padding MAY be used with this payload format according to section 5.1 + of [3]. + + Extension (X): 1 bit + + + +Kerr Expires August 1, 2005 [Page 4] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + The Extension bit is used in accordance with [3]. + + CSRC count (CC): 4 bits + + The CSRC count is used in accordance with [3]. + + Marker (M): 1 bit + + The Marker bit is used in accordance with [3]. + + Payload Type (PT): 7 bits + + An RTP profile for a class of applications is expected to assign a + payload type for this format, or a dynamically allocated payload type + SHOULD be chosen which designates the payload as Theora. + + Sequence number: 16 bits + + The sequence number increments by one for each RTP data packet sent, + and may be used by the receiver to detect packet loss and to restore + packet sequence. This field is detailed further in [3]. + + Timestamp: 32 bits + + A timestamp representing the sampling time of the first sample of the + first Theora packet in the RTP packet. The clock frequency MUST be + set to the sample rate of the encoded video data and is conveyed + out-of-band as an SDP attribute. + + SSRC/CSRC identifiers: + + These two fields, 32 bits each with one SSRC field and a maximum of + 16 CSRC fields, are as defined in [3]. + +2.2 Payload Header + + After the RTP Header section the following five octets are the + Payload Header. This header is split into a number of bitfields + detailing the format of the following Payload Data packets. + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 5] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |C|F|0|0|# pkts.| + +-+-+-+-+-+-+-+-+ + + Figure 2: Payload Header + + Setup Header Ident: 32 bits + + This 32 bit field is used to associate the Theora data to a decoding + Setup Header. It is created by making a CRC32 checksum of the Setup + Header required to decode the particular Theora video stream. + + Continuation (C): 1 bit + + Set to one if this is a continuation of a fragmented packet. + + Fragmented (F): 1 bit + + Set to one if the payload contains complete packets or if it contains + the last fragment of a fragmented packet. + + The next two bits are currently reserved and MUST be set to 0. + + The last 4 bits are the number of complete packets in this payload. + This provides for a maximum number of 15 Theora packets in the + payload. If the packet contains fragmented data the number of + packets MUST be set to 0. + +2.3 Payload Data + + Each Theora payload section starts with a three octet header. The + first octet is used to denote what kind of Theora data follows. Then + a two octet length header is used to represent the size of the + following data payload, followed by the raw Theora data. + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 6] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Data type | Payload Length | Theora Data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 3: Payload Data + + The data type octet is used to signify the payload data type. If the + first bit is set to 0, this indicates the payload is Theora video + data. + + The following values for the Theora payload type are valid: + + 0 = Raw Theora data + 0x80 = Theora Identification header + 0x81 = Theora Comment header + 0x82 = Theora Setup header + + + The Theora packet length header is the length of the Theora data + block only and does not count the length octets and payload data type + octet. + + The Theora codec uses relatively unstructured raw packets containing + binary integer fields of arbitrary width that often do not fall on an + octet boundary. When this happens the bitstream is packed to an + octet boundary. When a Theora encoder produces packets unused space + in the last byte of a packet is always zeroed during the encoding + process. Thus, should this unused space be read, it will return + binary zeros. + + For payloads which consist of multiple Theora packets the payload + data consists of the data type field, the payload length field + followed by the payload data for each of the Theora packets in the + payload. + +2.4 Example RTP Packet + + Here is an example RTP packet containing two Theora packets. + + RTP Packet Header: + + + + + + + + + +Kerr Expires August 1, 2005 [Page 7] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 2 |0|0| 0 |0| PT | sequence number | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | timestamp (in sample rate units) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronisation source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 4: Example RTP Packet + + Payload Data: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0|1|0|0| 2 pks | 0x80 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. data | 0 | Payload Length .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Theora data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 5: Example Theora Payload Packet + + The payload portion of the packet starts with the 32 bit Setup Header + ident field followed by the 8 bit fragment/count fields. The F bit + is set to 1, indicating that this packet contains whole Theora frame + data. The number of whole Theora data packets is set to 2. + + Each of the payload blocks starts with a Data type field, for the + first payload this is set to 0x80 indicating it is an Identification + header and the second payload is set to 0 indicating it is raw Theora + data. Then the two octet length field is followed by the variable + length Theora data. + +3. Frame Packetizing + + Each RTP packet contains either one complete Theora packet, one + Theora packet fragment, or an integer number of complete Theora + + + +Kerr Expires August 1, 2005 [Page 8] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + packets (up to a max of 15 packets, since the number of packets is + defined by a 4 bit value). + + Any Theora data packet that is less than path MTU SHOULD be bundled + in the RTP packet with as many Theora packets as will fit, up to a + maximum of 15. Path MTU is detailed in [6] and [7]. + + If a Theora packet is larger than 65535 octets it MUST be fragmented. + A fragmented packet has a zero in the last four bits of the payload + header. Each fragment after the first will also set the Continued + (C) bit to one in the payload header. The RTP packet containing the + last fragment of the Theora packet will have the Fragmented (F) bit + set to one. To maintain the correct sequence for fragmented packet + reception the timestamp field of fragmented packets MUST be the same + as the first packet sent, with the sequence number incremented as + normal for the subsequent RTP packets. + +3.1 Example Fragmented Theora Packet + + Here is an example fragmented Theora packet split over three RTP + packets. Each packet contains the standard RTP headers as well as + the 5 octet Theora headers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 9] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + Packet 1: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1000 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0|0|0|0| 0| 0 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 6: Example Fragmented Packet (Packet 1) + + In this packet the initial sequence number is 1000 and the timestamp + is xxxxx. The Continuation (C) bit is set to one, indicating it is + not the continuation of a fragmented bit, and the Fragmentation (F) + is set to 0 indicating it is a fragmented packet. The number of + packets field is set to 0, and as the payload is raw Theora data the + Theora payload type field is set to 0. + + + + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 10] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + Packet 2: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1001 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |1|0|0|0| 0| 0 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 7: Example Fragmented Packet (Packet 2) + + The C bit is set to 1 and the number of packets field is set to 0. + For large Theora fragments there can be several of these type of + payload packets. The maximum packet size SHOULD be no greater than + the path MTU, including all RTP and payload headers. The sequence + number has been incremented by one but the timestamp field remains + the same as the initial packet. + + + + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 11] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + Packet 3: + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | 1002 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |1|1|0|0| 0| 0 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Theora data .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 8: Example Fragmented Packet (Packet 3) + + This is the last Theora fragment packet. The C and F bits are set + and the packet count remains set to 0. As in the previous packets + the timestamp remains set to the first packet in the sequence and the + sequence number has been incremented. + +4. Packet Loss + + As there is no error correction within the Theora stream, packet loss + will result in a loss of signal. Packet loss is more of an issue for + fragmented Theora packets as the client will have to cope with the + handling of the C and F flags. If we use the fragmented Theora + packet example above and the first packet is lost the client SHOULD + detect that the next packet has the packet count field set to 0 and + the C bit is set and MUST drop it. The next packet, which is the + final fragmented packet, SHOULD be dropped in the same manner, or + buffered. Feedback reports on lost and dropped packets MUST be sent + back via RTCP. + + If a particular multicast session has a large number of participants + care must be taken to prevent an RTCP feedback implosion, [8], in the + event of packet loss from a large number of participants. + + + + + + +Kerr Expires August 1, 2005 [Page 12] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +5. Configuration Headers + + To decode a Theora stream three configuration header blocks are + needed. The first header, the Identification Header, indicates the + frame dimensions, quality, blocks used and the version of the Theora + encoder used. The second header, the Comment Header, contains stream + metadata and the third header, the Setup Header, details which + contains dequantization and Huffman tables. + + As the RTP stream may change certain configuration data mid-session + there are two different methods for delivering this configuration + data to a client, in-band and SDP which is detailed below. SDP + delivery is used to set-up an initial state for the client + application and in-band is used to change state during the session. + The changes may be due to different metadata or Setup Header as well + as different bitrates of the stream. + + Out of the two delivery vectors the use of an SDP attribute to + indicate an URI where the configuration and Setup Header data can be + obtained is preferred as they can be fetched reliably using TCP. The + in-band Setup Header delivery SHOULD only be used in situations where + the link between the client is unidirectional or if the SDP-based + information is not available. + + Synchronizing the configuration and Setup Header to the RTP stream is + critical. The 32 bit Setup Header Ident field is used to indicate + when a change in the stream has taken place. The client application + MUST have in advance the correct configuration and Setup Headers and + if the client detects a change in the Ident value and does not have + this information it MUST NOT decode the raw Theora data. + +5.1 In-band Header Transmission + + The three header data blocks are sent in-band with the packet type + bits set to match the payload type. Normally the Setup Header and + Identification Header are sent once per session if the stream is an + encoding of live video, as typically the encoder state will not + change, but the encoder state can change at the boundary of chained + Theora video files. Metadata can be sent at the start as well as any + time during the life of the session. Clients MUST be capable of + dealing with periodic re-transmission of the configuration headers. + +5.1.1 Identification Header + + The Identification Header is a short header with only a few fields + used to declare the stream definitively as Theora and provide + detailed information about the format of the fully decoded video + data. + + + +Kerr Expires August 1, 2005 [Page 13] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | xxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0|1|0|0| 1| 0x80 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | VMAJ | VMIN | VREV | FMBW | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FMBW | FMBH | NSBS | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NSBS | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NBS | NMBS | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NMBS | PICW | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PICW | PICH | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PICH | PICX | PICY | FRN | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FRN | FRD | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FRD | PARN | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PARN | PARD | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PARD | CS |PF | NOMBR | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NOMBR | QUAL | KFGSHIFT| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 9: Identification Header + + The fields listed above have the following meanings: + + + + + + +Kerr Expires August 1, 2005 [Page 14] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + VMAJ = The major version number. 8 bits. + VMIN = The minor version number. 8 bits. + VREV = The version revision number. 8 bits. + FMBW = The width of the frame in macro blocks. 16 bits. + FMBH = The height of the frame in macro blocks. 16 bits. + NSBS = The total number of super blocks in a frame. 32 bits. + NBS = The total number of blocks in a frame. 36 bits. + NMBS = The total number of macro blocks in a frame. 32 bits. + PICW = The width of the picture region in pixels. 20 bits. + PICH = The height of the picture region in pixels. 20 bits. + PICX = The X offset of the picture region in pixels. 8 bits. + PICY = The Y offset of the picture region in pixels. 8 bits. + FRN = The frame-rate numerator. 32 bits. + FRD = The frame-rate denominator. 32 bits. + PARN = The pixel aspect-ratio numerator. 24 bits. + PARD = The pixel aspect-ratio denominator. 24 bits. + CS = The color space. 8 bits. + PF = The pixel format. 2 bits. + NOMBR = The nominal bitrate of the stream, in bits per second. + 24 bits. + QUAL = The quality hint. 6 bits. + KFGSHIFT = The amount to shift the key frame number by in the + granule position. 5 bits. + + +5.1.2 Comment Header + + The Theora Comment Header is the second of three header packets that + begin a Theora stream. It is meant for short text comments, not + arbitrary metadata; arbitrary metadata belongs in a separate logical + stream that provides greater structure and machine parseability. The + comment field is meant to be used much like someone jotting a quick + note on the label of a video. It should be a little information to + remember the disc or tape by and explain it to others; a short, + to-the-point text note that can be more than a couple words, but + isn't going to be more than a short paragraph. + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 15] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | xxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0|1|0|0| 1| 0x81 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comments list length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comment length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comment .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. User comment | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + + Figure 10: Comment Header + + The format for the data takes the form of a 32 bit field denoting the + number of user comments. Each of the user comments is prefixed by a + 32 bit length field followed by the comment text encoded in UTF-8. + +5.1.3 Setup Header + + The Theora setup header contains the limit values used to drive the + loop filter, the base matrices and scale values used to build the + dequantization tables, and the Huffman tables used to unpack the DCT + tokens. Because the contents of this header are specific to Theora, + no concessions have been made to keep the fields octet-aligned for + easy parsing. + + + + + + + + + +Kerr Expires August 1, 2005 [Page 16] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |V=2|P|X| CC |M| PT | xxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | xxxxx | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | synchronization source (SSRC) identifier | + +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ + | contributing source (CSRC) identifiers | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |0|1|0|0| 1| 0x82 | Payload Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 11: Setup Header + + +5.1.3.1 Setup Header CRC32 Generation + + In order for different implementations of Theora RTP clients and + servers to interoperate with each other a common format for the + production of the CRC32 hash is required. The polynomial is + X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0. + + The following C code function SHOULD be used by implementations, if + not then the code responsible for generating the CRC32 value MUST use + the polynomial function above. + + unsigned int crc32 (int length, unsigned char *crcdata) + { + int index, loop; + unsigned int byte, crc, mask; + + index = 0; + crc = 0xFFFFFFFF; + + while (index < length) { + byte = crcdata [index]; + + + +Kerr Expires August 1, 2005 [Page 17] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + crc = crc ^ byte; + + for (loop = 7; loop >= 0; loop--) { + mask = -(crc & 1); + crc = (crc >> 1) ^ (0xEDB88320 & mask); + } + index++; + } + return ~crc; + } + + +5.2 Packed Headers Delivery + + As mentioned above the RECOMMENDED delivery vector for Theora + configuration data is via an SDP attribute as this retrieval method + can be performed using a reliable transport protocol. + + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Number of packed headers | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Packed header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Packed header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 12: Packed Headers Overview + + As the RTP headers are not required for this method of delivery the + structure of the configuration data is slightly different. The + packed header starts with a 32 bit count field which details the + number of packed headers that are contained in the bundle. Next is + the packed header payload for each chained Theora file. + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 18] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Header Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Ident | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Identification Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Identification Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Comment Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Comment Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 13: Packed Headers Detail + + The key difference between the in-band format is there is no need for + the payload header octet and Setup Header Ident field. Below are + examples of the packed headers format. + + + + + + + + + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 19] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | VMAJ | VMIN | VREV | FMBW | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FMBW | FMBH | NSBS | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NSBS | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NBS | NMBS | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NMBS | PICW | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PICW | PICH | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PICH | PICX | PICY | FRN | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FRN | FRD | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FRD | PARN | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PARN | PARD | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PARD | CS |PF | NOMBR | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | NOMBR | QUAL | KFGSHIFT| + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 14: Packed Identification Header + + The alignment of the packed Identification Header is slightly + different from the RTP payload type as the payload header is not + used. + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 20] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comments list length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comment length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | User comment .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. User comment | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 15: Packed Comment Header + + The packed Comment Header also as a slightly different structure to + that of the RTP payload type with the payload header not being used. + + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header Length | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Setup Header .. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + .. Setup Header | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + Figure 16: Packed Setup Header + + The packed Setup Header also has a slightly different structure to + that of the RTP payload type. The Setup Header Ident field that is + normally part of this structure is moved to the second field of the + overall packed structure. + +5.2.1 Packed Headers IANA Considerations + + The following IANA considerations MUST only be applied to the packed + headers. + + MIME media type name: video + + MIME subtype: theora-config + + Required Parameters: + + None. + + + + +Kerr Expires August 1, 2005 [Page 21] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + Optional Parameters: + + None. + + Encoding considerations: + + This type is only defined for transfer via HTTP as specified in RFC + XXXX. + + Security Considerations: + + See Section 6 of RFC 3047. + + Interoperability considerations: none + + Published specification: + + See RFC XXXX for details. + + Applications which use this media type: + + Theora encoded video, configuration data. + + Additional information: none + + Person & email address to contact for further information: + + Phil Kerr: + + Intended usage: COMMON + + Author/Change controller: + + Author: Phil Kerr + + Change controller: IETF AVT Working Group + +5.3 Setup Header Caching + + Setup Header caching allows clients that have previously connected to + a stream to re-use the associated Setup Header and configuration + data. When a client receives a Setup Header it may store it locally + and can compare the CRC32 key with that of the new stream and begin + decoding before it has received any of the headers. + +5.4 Loss of Configuration Headers + + Unlike the loss of raw Theora payload data, loss of a configuration + + + +Kerr Expires August 1, 2005 [Page 22] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + header can lead to a situation where it will not be possible to + successfully decode the stream. + + Out of the three headers, loss of either the Setup Header or + Identification Headers MUST result in the halting of stream decoding. + Loss of the Comment header SHOULD NOT be regarded as fatal for + decoding. Loss of any of the headers SHOULD be reported to the + client as well as a loss report sent via RTCP. + +6. IANA Considerations + + MIME media type name: video + + MIME subtype: theora + + Required Parameters: + + sampling: Determines the chroma subsampling format. + + width: Determines the number of pixels per line. This is an integer + between 1 and 1048561 and MUST be in multiples of 16. + + height: Determines the number of lines per frame. This is an integer + between 1 and 1048561 and MUST be in multiples of 16. + + header: Indicates the URI of the decoding configuration headers. + + Optional Parameters: + + None. + + Encoding considerations: + + This type is only defined for transfer via RTP as specified in RFC + XXXX. + + Security Considerations: + + See Section 6 of RFC 3047. + + Interoperability considerations: none + + Published specification: + + See the Theora documentation [11] for details. + + Applications which use this media type: + + + + +Kerr Expires August 1, 2005 [Page 23] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + + Video streaming and conferencing tools + + Additional information: none + + Person & email address to contact for further information: + + Phil Kerr: + + Intended usage: COMMON + + Author/Change controller: + + Author: Phil Kerr + + Change controller: IETF AVT Working Group + +6.1 Mapping MIME Parameters into SDP + + The information carried in the MIME media type specification has a + specific mapping to fields in the Session Description Protocol (SDP) + [5], which is commonly used to describe RTP sessions. When SDP is + used to specify sessions the mapping are as follows: + + o The MIME type ("video") goes in SDP "m=" as the media name. + + o The MIME subtype ("THEORA") goes in SDP "a=rtpmap" as the encoding + name. + + o The parameter "rate" also goes in "a=rtpmap" as clock rate. + + o The parameter "channels" also goes in "a=rtpmap" as channel count. + + o The parameter "header" goes in the SDP "a=fmpt" attribute. + + If the stream comprises chained Theora files the configuration and + Setup Headers for each file SHOULD be packaged together and passed to + the client using the headers attribute if all the files to be played + are known in advance. + + Example: + + c=IN IP4/6 + m=video RTP/AVP 98 + a=rtpmap:98 theora/90000 + a=fmtp:98 sampling=YCbCr-4:2:2; width=1280; height=720; + header= + + + + + +Kerr Expires August 1, 2005 [Page 24] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +7. Security Considerations + + RTP packets using this payload format are subject to the security + considerations discussed in the RTP specification [3]. This implies + that the confidentiality of the media stream is achieved by using + encryption. Because the data compression used with this payload + format is applied end-to-end, encryption may be performed on the + compressed data. Where the size of a data block is set care MUST be + taken to prevent buffer overflows in the client applications. + +8. Acknowledgments + + Thanks to the AVT, Ogg Theora Communities / Xiph.org, Fluendo, Ralph + Giles. + +9. References + +9.1 Normative References + + [1] Pfeiffer, S., "The Ogg Encapsulation Format Version 0", RFC + 3533. + + [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement + Levels", RFC 2119. + + [3] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, + "RTP: A Transport Protocol for real-time applications", RFC + 3550. + + [4] Schulzrinne, H. and S. Casner, "RTP Profile for video and Video + Conferences with Minimal Control.", RFC 3551. + + [5] Handley, M. and V. Jacobson, "SDP: Session Description + Protocol", RFC 2327. + + [6] Mogul et al., J., "Path MTU Discovery", RFC 1063. + + [7] McCann et al., J., "Path MTU Discovery for IP version 6", RFC + 1981. + + [8] Ott, J., Wenger, S., Sato, N., Burmeister, C. and J. Rey, + "Extended RTP Profile for RTCP-based Feedback (RTP/AVPF)", + Internet Draft (draft-ietf-avt-rtcp-feedback-11: Work in + progress). + + [9] Kerr, P., "RTP Payload Format for Vorbis Encoded Audio - + draft-ietf-avt-vorbis-rtp-00", Internet Draft (Work in + progress). + + + +Kerr Expires August 1, 2005 [Page 25] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +9.2 Informative References + + [10] "libTheora: Available from the Xiph website, + http://www.xiph.org". + + [11] "Ogg Theora I spec: Codec setup and packet decode. + http://www.xiph.org/ogg/Theora/doc/Theora-spec-ref.html". + + +Author's Address + + Phil Kerr + Xiph.Org + + EMail: phil@plus24.com + URI: http://www.xiph.org/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Kerr Expires August 1, 2005 [Page 26] + +Internet-Draft draft-kerr-avt-theora-rtp-00 January 2005 + + +Intellectual Property Statement + + The IETF takes no position regarding the validity or scope of any + Intellectual Property Rights or other rights that might be claimed to + pertain to the implementation or use of the technology described in + this document or the extent to which any license under such rights + might or might not be available; nor does it represent that it has + made any independent effort to identify any such rights. Information + on the procedures with respect to rights in RFC documents can be + found in BCP 78 and BCP 79. + + Copies of IPR disclosures made to the IETF Secretariat and any + assurances of licenses to be made available, or the result of an + attempt made to obtain a general license or permission for the use of + such proprietary rights by implementers or users of this + specification can be obtained from the IETF on-line IPR repository at + http://www.ietf.org/ipr. + + The IETF invites any interested party to bring to its attention any + copyrights, patents or patent applications, or other proprietary + rights that may cover technology that may be required to implement + this standard. Please address the information to the IETF at + ietf-ipr@ietf.org. + + +Disclaimer of Validity + + This document and the information contained herein are provided on an + "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS + OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET + ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE + INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +Copyright Statement + + Copyright (C) The Internet Society (2005). This document is subject + to the rights, licenses and restrictions contained in BCP 78, and + except as set forth therein, the authors retain all their rights. + + +Acknowledgment + + Funding for the RFC Editor function is currently provided by the + Internet Society. + + + + +Kerr Expires August 1, 2005 [Page 27] + diff --git a/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.xml b/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.xml new file mode 100644 index 00000000..dff7a265 --- /dev/null +++ b/libs/libtheora-1.1/doc/draft-kerr-avt-theora-rtp-00.xml @@ -0,0 +1,1277 @@ + + + + + + + + +draft-kerr-avt-theora-rtp-00 + + +Xiph.Org +
+phil@plus24.com +http://www.xiph.org/ +
+
+ + + +General +AVT Working Group +I-D + +Internet-Draft +Theora +RTP + + + +This document describes a RTP payload format for transporting Theora encoded video. It details the RTP encapsulation mechanism +for raw Theora data and configuration headers consisting of the quantization matrices and the Huffman codebooks for the DCT +coefficients, and a table of limit values for the deblocking filter. + + + +Also included within the document are the necessary details for the use of Theora with MIME and Session Description Protocol +(SDP). + + + + + + +All references to RFC XXXX are to be replaced by references to the RFC number of this memo, when published. + + + +
+ + + +
+ +Theora is a general purpose, lossy video codec. It is based on the VP3.1 video codec produced by On2 Technologies and has been donated to the Xiph.org Foundation. + + + +Theora I is a block-based lossy transform codec that utilizes an 8 x 8 Type-II Discrete Cosine Transform and block-based motion +compensation. This places it in the same class of codecs as MPEG-1, MPEG-2, MPEG-4, and H.263. The details of how individual +blocks are organized and how DCT coefficients are stored in the bitstream differ substantially from these codecs, however. Theora +supports only intra frames (I frames in MPEG) and inter frames (P frames in MPEG). + + + +Theora provides none of its own framing, synchronization, or protection against transmission errors. Theora is a free-form +variable bit rate (VBR) codec, and packets have no minimum size, maximum size, or fixed/expected size. Theora packets are thus +intended to be used with a transport mechanism that provides free-form framing, synchronization, positioning, and error correction +in accordance with these design assumptions, such as Ogg . or RTP/AVP . + + + +Theora I currently supports progressive video data of arbitrary dimensions at a constant frame rate in one of several YCbCr color +spaces. +Three different chroma subsampling formats are supported: 4:2:0, 4:2:2, and 4:4:4. The Theora I format does not support interlaced +material, variable frame rates, bit-depths larger than 8 bits per component, nor alternate color spaces such as RGB or arbitrary +multi-channel spaces. Black and white content can be efficiently encoded, however, because the uniform chroma planes compress well. + + + +Theora is similar to Vorbis audio in that it requires the inclusion of the entire probability +model for the DCT coefficients and all the quantization parameters in the bitstream headers to be sent ahead of the video data. It +is therefore impossible to decode any frame in the stream without having previously fetched the codec info and codec setup headers, +although Theora can initiate decode at an arbitrary intra-frame packet within a bitstream so long as the codec has been initialized +with the setup headers. + + +
+ + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", +and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 . + + +
+
+ +
+ + +Each frame of digital video is packetized into one or more RTP packets. If the data for a complete frame exceeds the network +MTU, it SHOULD be fragmented into multiple RTP packets, each smaller than the MTU. A single RTP packet MAY contain +data for more than one Theora frame. + + + +For RTP based transportation of Theora encoded video the standard RTP header is followed by a 5 octet payload header, then the +payload data. + + +
+ + +The format of the RTP header is specified in and shown in Figure 1. This payload format uses +the fields of the header in a manner consistent with that specification. + + +
+ +
+ + +The RTP header begins with an octet of fields (V, P, X, and CC) to support specialized RTP uses (see + and for details). For Theora RTP, the following values are used. + + + +Version (V): 2 bits +This field identifies the version of RTP. The version used by this specification is two (2). + + + +Padding (P): 1 bit +Padding MAY be used with this payload format according to section 5.1 of . + + + +Extension (X): 1 bit +The Extension bit is used in accordance with . + + + +CSRC count (CC): 4 bits +The CSRC count is used in accordance with . + + + +Marker (M): 1 bit +The Marker bit is used in accordance with . + + + +Payload Type (PT): 7 bits +An RTP profile for a class of applications is expected to assign a payload type for this format, or a dynamically allocated +payload type SHOULD be chosen which designates the payload as Theora. + + + +Sequence number: 16 bits +The sequence number increments by one for each RTP data packet sent, and may be used by the receiver to detect packet loss and +to restore packet sequence. This field is detailed further in . + + + +Timestamp: 32 bits +A timestamp representing the sampling time of the first sample of the first Theora packet in the RTP packet. The clock frequency +MUST be set to the sample rate of the encoded video data and is conveyed out-of-band as an SDP attribute. + + + +SSRC/CSRC identifiers: +These two fields, 32 bits each with one SSRC field and a maximum of 16 CSRC fields, are as defined in +. + + +
+ +
+ + +After the RTP Header section the following five octets are the Payload Header. +This header is split into a number of bitfields detailing the format of the following Payload Data packets. + + +
+ +
+ + +Setup Header Ident: 32 bits + +This 32 bit field is used to associate the Theora data to a decoding Setup Header. It is created by making a CRC32 checksum +of the Setup Header required to decode the particular Theora video stream. + + + +Continuation (C): 1 bit + +Set to one if this is a continuation of a fragmented packet. + + + +Fragmented (F): 1 bit + +Set to one if the payload contains complete packets or if it contains the last fragment of a fragmented packet. + + + +The next two bits are currently reserved and MUST be set to 0. + + + +The last 4 bits are the number of complete packets in this payload. This provides for a maximum number of 15 Theora +packets in the payload. If the packet contains fragmented data the number of packets MUST be set to 0. + + +
+ +
+ + +Each Theora payload section starts with a three octet header. The first octet is used to denote what kind of Theora data follows. +Then a two octet length header is used to represent the size of the following data payload, followed by the raw Theora data. + + +
+ +
+ + +The data type octet is used to signify the payload data type. If the first bit is set to 0, this indicates the payload is +Theora video data. + + + +The following values for the Theora payload type are valid: + + + + 0 = Raw Theora data + 0x80 = Theora Identification header + 0x81 = Theora Comment header + 0x82 = Theora Setup header + + + + +The Theora packet length header is the length of the Theora data block only and does not count the length octets and payload +data type octet. + + + +The Theora codec uses relatively unstructured raw packets containing binary integer fields of arbitrary width that often do not fall on an octet boundary. When this happens the bitstream is packed to an octet boundary. When a Theora encoder produces packets unused space in the last byte of a packet is always zeroed during the encoding process. Thus, should this unused space be read, it will return binary zeros. + + + +For payloads which consist of multiple Theora packets the payload data consists of the data type field, the payload length field +followed by the payload data for each of the Theora packets in the payload. + + +
+ +
+ + +Here is an example RTP packet containing two Theora packets. + + +RTP Packet Header: + + +
+ +
+ + + +Payload Data: + + +
+ +
+ + +The payload portion of the packet starts with the 32 bit Setup Header ident field followed by the 8 bit fragment/count fields. The F +bit is set to 1, indicating that this packet contains whole Theora frame data. The number of whole Theora data packets is set to +2. + + + +Each of the payload blocks starts with a Data type field, for the first payload this is set to 0x80 indicating it is an +Identification header and the second payload is set to 0 indicating it is raw Theora data. Then the two octet length field is +followed by the variable length Theora data. + + +
+
+ + +
+ + +Each RTP packet contains either one complete Theora packet, one Theora packet fragment, or an integer number of complete Theora +packets (up to a max of 15 packets, since the number of packets is defined by a 4 bit value). + + + +Any Theora data packet that is less than path MTU SHOULD be bundled in the RTP packet with as many Theora packets as will +fit, up to a maximum of 15. Path MTU is detailed in and . + + + +If a Theora packet is larger than 65535 octets it MUST be fragmented. A fragmented packet has a zero in the last four bits +of the payload header. Each fragment after the first will also set the Continued (C) bit to one in the payload header. The +RTP packet containing the last fragment of the Theora packet will have the Fragmented (F) bit set to one. To maintain the +correct sequence for fragmented packet reception the timestamp field of fragmented packets MUST be the same as the first +packet sent, with the sequence number incremented as normal for the subsequent RTP packets. + + +
+ + +Here is an example fragmented Theora packet split over three RTP packets. Each packet contains the standard RTP headers as +well as the 5 octet Theora headers. + + +
+ +
+ + +In this packet the initial sequence number is 1000 and the timestamp is xxxxx. The Continuation (C) bit is set to one, +indicating it is not the continuation of a fragmented bit, and the Fragmentation (F) is set to 0 indicating it is a fragmented +packet. The number of packets field is set to 0, and as the payload is raw Theora data the Theora payload type field is set to 0. + + +
+ +
+ + +The C bit is set to 1 and the number of packets field is set to 0. For large Theora fragments there can be several of these type +of payload packets. The maximum packet size SHOULD be no greater than the path MTU, including all RTP and payload headers. The +sequence number has been incremented by one but the timestamp field remains the same as the initial packet. + + +
+ +
+ + +This is the last Theora fragment packet. The C and F bits are set and the packet count remains set to 0. As in the previous +packets the timestamp remains set to the first packet in the sequence and the sequence number has been incremented. + + +
+
+ + +
+ + +As there is no error correction within the Theora stream, packet loss will result in a loss of signal. Packet loss is more of an +issue for fragmented Theora packets as the client will have to cope with the handling of the C and F flags. If we use the +fragmented Theora packet example above and the first packet is lost the client SHOULD detect that the next packet has the packet +count field set to 0 and the C bit is set and MUST drop it. The next packet, which is the final fragmented packet, SHOULD +be dropped in the same manner, or buffered. Feedback reports on lost and dropped packets MUST be sent back via RTCP. + + + +If a particular multicast session has a large number of participants care must be taken to prevent an RTCP feedback implosion, +, in the event of packet loss from a large number of participants. + + +
+ +
+ + +To decode a Theora stream three configuration header blocks are needed. The first header, the Identification Header, indicates +the frame dimensions, quality, blocks used and the version of the Theora encoder used. The second header, the Comment Header, contains stream metadata and the third header, the Setup Header, details which contains dequantization and Huffman tables. + + + +As the RTP stream may change certain configuration data mid-session there are two different methods for delivering this +configuration data to a client, in-band and SDP which is detailed below. SDP delivery is used to set-up an initial +state for the client application and in-band is used to change state during the session. The changes may be due to +different metadata or Setup Header as well as different bitrates of the stream. + + + +Out of the two delivery vectors the use of an SDP attribute to indicate an URI where the configuration and Setup Header data +can be obtained is preferred as they can be fetched reliably using TCP. The in-band Setup Header delivery SHOULD +only be used in situations where the link between the client is unidirectional or if the SDP-based information is not available. + + + +Synchronizing the configuration and Setup Header to the RTP stream is critical. The 32 bit Setup Header Ident field is used +to indicate when a change in the stream has taken place. The client application MUST have in advance the correct configuration +and Setup Headers and if the client detects a change in the Ident value and does not have this information it MUST NOT +decode the raw Theora data. + + +
+ + +The three header data blocks are sent in-band with the packet type bits set to match the payload type. Normally the Setup Header +and Identification Header are sent once per session if the stream is an encoding of live video, as typically +the encoder state will not change, but the encoder state can change at the boundary of chained Theora video files. Metadata +can be sent at the start as well as any time during the life of the session. Clients MUST be capable of dealing with periodic +re-transmission of the configuration headers. + + +
+ + +The Identification Header is a short header with only a few fields used to declare the stream definitively as Theora and provide detailed information about the format of the fully decoded video data. + +
+ +
+ + +The fields listed above have the following meanings: + + + + + + VMAJ = The major version number. 8 bits. + VMIN = The minor version number. 8 bits. + VREV = The version revision number. 8 bits. + FMBW = The width of the frame in macro blocks. 16 bits. + FMBH = The height of the frame in macro blocks. 16 bits. + NSBS = The total number of super blocks in a frame. 32 bits. + NBS = The total number of blocks in a frame. 36 bits. + NMBS = The total number of macro blocks in a frame. 32 bits. + PICW = The width of the picture region in pixels. 20 bits. + PICH = The height of the picture region in pixels. 20 bits. + PICX = The X offset of the picture region in pixels. 8 bits. + PICY = The Y offset of the picture region in pixels. 8 bits. + FRN = The frame-rate numerator. 32 bits. + FRD = The frame-rate denominator. 32 bits. + PARN = The pixel aspect-ratio numerator. 24 bits. + PARD = The pixel aspect-ratio denominator. 24 bits. + CS = The color space. 8 bits. + PF = The pixel format. 2 bits. + NOMBR = The nominal bitrate of the stream, in bits per second. 24 bits. + QUAL = The quality hint. 6 bits. + KFGSHIFT = The amount to shift the key frame number by in the granule position. 5 bits. + + + +
+ +
+ + +The Theora Comment Header is the second of three header packets that begin a Theora stream. It is meant for short text comments, +not arbitrary metadata; arbitrary metadata belongs in a separate logical stream that provides greater structure and machine +parseability. The comment field is meant to be used much like someone jotting a quick note on the label of a video. It should be a +little information to remember the disc or tape by and explain it to others; a short, to-the-point text note that can be more than +a couple words, but isn't going to be more than a short paragraph. + + +
+ +
+ + +The format for the data takes the form of a 32 bit field denoting the number of user comments. Each of the user comments is prefixed by a 32 bit length field followed by the comment text encoded in UTF-8. + + +
+ +
+ + +The Theora setup header contains the limit values used to drive the loop filter, the base matrices and scale values used to build the dequantization tables, and the Huffman tables used to unpack the DCT tokens. Because the contents of this header are specific to Theora, no concessions have been made to keep the fields octet-aligned for easy parsing. + + +
+ +
+ + +
+ + +In order for different implementations of Theora RTP clients and servers to interoperate with each other a common format +for the production of the CRC32 hash is required. The polynomial is X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0. + + + +The following C code function SHOULD be used by implementations, if not then the code responsible for generating the CRC32 +value MUST use the polynomial function above. + + += 0; loop--) { + mask = -(crc & 1); + crc = (crc >> 1) ^ (0xEDB88320 & mask); + } + index++; + } + return ~crc; +} +]]> + + +
+ +
+
+ +
+ + +As mentioned above the RECOMMENDED delivery vector for Theora configuration data is via an SDP attribute as this retrieval method +can be performed using a reliable transport protocol. + + +
+ +
+ + +As the RTP headers are not required for this method of delivery the +structure of the configuration data is slightly different. The packed header starts with a 32 bit count field which details the number of packed headers that are contained in the bundle. Next is the packed header payload for each chained Theora file. + + +
+ +
+ +The key difference between the in-band format is there is no need for the payload header octet and Setup Header Ident field. +Below are examples of the packed headers format. + + +
+ +
+ + +The alignment of the packed Identification Header is slightly different from the RTP payload type as the payload header is not +used. + + +
+ +
+ + +The packed Comment Header also as a slightly different structure to that of the RTP payload type with the payload header not being +used. + + + +
+ +
+ + +The packed Setup Header also has a slightly different structure to that of the RTP payload type. The Setup Header Ident field +that is normally part of this structure is moved to the second field of the overall packed structure. + + +
+ + +The following IANA considerations MUST only be applied to the packed headers. + + + +MIME media type name: video + + +MIME subtype: theora-config + + + +Required Parameters: +None. + + + +Optional Parameters: +None. + + + +Encoding considerations: +This type is only defined for transfer via HTTP as specified in RFC XXXX. + + + +Security Considerations: +See Section 6 of RFC 3047. + + + +Interoperability considerations: none + + + +Published specification: +See RFC XXXX for details. + + +Applications which use this media type: +Theora encoded video, configuration data. + + + +Additional information: none + + + +Person & email address to contact for further information: +Phil Kerr: <phil@plus24.com> + + + +Intended usage: COMMON + + +Author/Change controller: +Author: Phil Kerr +Change controller: IETF AVT Working Group + + +
+
+ +
+ + +Setup Header caching allows clients that have previously connected to a stream to re-use the associated Setup Header and +configuration data. When a client receives a Setup Header it may store it locally and can compare the CRC32 key with that of the +new stream and begin decoding before it has received any of the headers. + + +
+ +
+ + +Unlike the loss of raw Theora payload data, loss of a configuration header can lead to a situation where it will not be possible +to successfully decode the stream. + + + +Out of the three headers, loss of either the Setup Header or Identification Headers MUST result in the halting of stream +decoding. Loss of the Comment header SHOULD NOT be regarded as fatal for decoding. Loss of any of the headers SHOULD be reported +to the client as well as a loss report sent via RTCP. + + +
+
+ + +
+ +MIME media type name: video + +MIME subtype: theora + +Required Parameters: + + +sampling: Determines the chroma subsampling format. + + +width: Determines the number of pixels per line. This is an integer between 1 and 1048561 and MUST be in multiples of 16. + + +height: Determines the number of lines per frame. This is an integer between 1 and 1048561 and MUST be in multiples of 16. + + +header: Indicates the URI of the decoding configuration headers. + + + +Optional Parameters: +None. + + + +Encoding considerations: +This type is only defined for transfer via RTP as specified in RFC XXXX. + + + +Security Considerations: +See Section 6 of RFC 3047. + + + +Interoperability considerations: none + + + +Published specification: +See the Theora documentation for details. + + +Applications which use this media type: +Video streaming and conferencing tools + + + +Additional information: none + + + +Person & email address to contact for further information: +Phil Kerr: <phil@plus24.com> + + + +Intended usage: COMMON + + +Author/Change controller: +Author: Phil Kerr +Change controller: IETF AVT Working Group + +
+ + +The information carried in the MIME media type specification has a specific mapping to fields in the Session Description +Protocol (SDP) , which is commonly used to describe RTP sessions. When SDP is used to specify +sessions the mapping are as follows: + + + + + +The MIME type ("video") goes in SDP "m=" as the media name. + + +The MIME subtype ("THEORA") goes in SDP "a=rtpmap" as the encoding name. + + +The parameter "rate" also goes in "a=rtpmap" as clock rate. + + +The parameter "channels" also goes in "a=rtpmap" as channel count. + + +The parameter "header" goes in the SDP "a=fmpt" attribute. + + + + +If the stream comprises chained Theora files the configuration and Setup Headers for each file SHOULD be packaged together +and passed to the client using the headers attribute if all the files to be played are known in advance. + + + +Example: + + + + +c=IN IP4/6 +m=video RTP/AVP 98 +a=rtpmap:98 theora/90000 +a=fmtp:98 sampling=YCbCr-4:2:2; width=1280; height=720; header=<URI of configuration header> + + +
+
+ + + + +
+ +RTP packets using this payload format are subject to the security considerations discussed in the RTP specification +. This implies that the confidentiality of the media stream is achieved by using +encryption. Because the data compression used with this payload format is applied end-to-end, encryption may be performed on the +compressed data. Where the size of a data block is set care MUST be taken to prevent buffer overflows in the client applications. + + +
+ +
+ + +Thanks to the AVT, Ogg Theora Communities / Xiph.org, Fluendo, Ralph Giles. + + +
+ +
+ + + + + + + +The Ogg Encapsulation Format Version 0 + + + + + + + +Key words for use in RFCs to Indicate Requirement Levels + + + + + + + +RTP: A Transport Protocol for real-time applications + + + + + + + + + + +RTP Profile for video and Video Conferences with Minimal Control. + + + + + + + + + +SDP: Session Description Protocol + + + + + + + + +Path MTU Discovery + + + + + + + +Path MTU Discovery for IP version 6 + + + + + + + +Extended RTP Profile for RTCP-based Feedback (RTP/AVPF) + + + + + + + + + + + +RTP Payload Format for Vorbis Encoded Audio - draft-ietf-avt-vorbis-rtp-00 + + + + + + + + + + + +libTheora: Available from the Xiph website, http://www.xiph.org + + + + + +Ogg Theora I spec: Codec setup and packet decode. http://www.xiph.org/ogg/Theora/doc/Theora-spec-ref.html + + + + + + +
diff --git a/libs/libtheora-1.1/doc/spec/Makefile.am b/libs/libtheora-1.1/doc/spec/Makefile.am new file mode 100644 index 00000000..ee1fb902 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/Makefile.am @@ -0,0 +1,81 @@ +## Process this file with automake to produce Makefile.in + +# makefile to generate the spec document from sources +# requires transfig and pdflatex + +built_docs = Theora.pdf + +if BUILD_SPEC +doc_DATA = $(built_docs) +endif + +SPEC_SRCS = spec.tex spec.bib + +FIG_SRCS = pic-frame.fig hilbert-mb.fig hilbert-block.fig xifish.fig \ + superblock.fig macroblock.fig raster-block.fig reference-frames.fig \ + pixel444.fig pixel422.fig pixel420.fig idct.fig fdct.fig \ + pic_even.fig pic_even_odd.fig pic_odd.fig pic_odd_even.fig \ + lflim.fig + +FIG_TEXS = $(FIG_SRCS:.fig=.tex) +FIG_AUXS = $(FIG_SRCS:.fig=.aux) +FIG_PDFS = $(FIG_SRCS:.fig=.pdf) + +# add any native-pdf figures here +FIG_OBJS = $(FIG_PDFS) + +EXTRA_DIST = $(built_docs) $(SPEC_SRCS) $(FIG_SRCS) ltablex.sty + +if BUILD_SPEC +# latex three times is the charm with references +# long tables require the .aux file to start from scratch +Theora.pdf : $(SPEC_SRCS) $(FIG_OBJS) vp3huff.tex + -$(RM) spec.aux + pdflatex -interaction nonstopmode spec.tex + bibtex spec.aux + pdflatex -interaction nonstopmode spec.tex + pdflatex -interaction nonstopmode spec.tex + mv spec.pdf $@ +else +Theora.pdf : + echo "*** Warning: Missing tools; $@ will not be built." +endif + +vp3huff.tex : vp3huff + ./vp3huff > $@ + +noinst_PROGRAMS = vp3huff +vp3huff_SOURCES = vp3huff.c + +figures : $(FIG_OBJS) + +# rules to generate latex and pdf versions of the xfig figures +.fig.tex: + fig2dev -L latex $< $@ + +.fig.pdf: + fig2dev -L pdf -p 0 $< $@ + +SUFFIXES = .fig .tex .pdf + +# clean targets +clean-local: + -$(RM) $(FIG_TEXS) + -$(RM) $(FIG_AUXS) + -$(RM) $(FIG_PDFS) + -$(RM) vp3huff + -$(RM) vp3huff.tex + -$(RM) vp3huff.aux + -$(RM) spec.aux + -$(RM) spec.log + -$(RM) spec.lof + -$(RM) spec.lot + -$(RM) spec.out + -$(RM) spec.bbl + -$(RM) spec.blg + -$(RM) spec.toc + +maintainer-clean-local: + -$(RM) $(built_docs) + +maintainerclean: maintainer-clean diff --git a/libs/libtheora-1.1/doc/spec/fdct.fig b/libs/libtheora-1.1/doc/spec/fdct.fig new file mode 100644 index 00000000..e35c758c --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/fdct.fig @@ -0,0 +1,371 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 1350 4650 1650 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1500 4800 75 75 1500 4800 1500 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1450 4800 1550 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1500 4850 1500 4750 +-6 +6 1350 450 1650 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1500 600 75 75 1500 600 1500 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1450 600 1550 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1500 650 1500 550 +-6 +6 1950 1050 2250 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 1200 75 75 2100 1200 2100 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 1200 2150 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 1250 2100 1150 +-6 +6 3150 2850 3450 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 3000 75 75 3300 3000 3300 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 3000 3350 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 3050 3300 2950 +-6 +6 3150 2250 3450 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 2400 75 75 3300 2400 3300 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 2400 3350 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 2450 3300 2350 +-6 +6 2550 3450 2850 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2700 3600 75 75 2700 3600 2700 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2650 3600 2750 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2700 3650 2700 3550 +-6 +6 2550 1650 2850 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2700 1800 75 75 2700 1800 2700 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2650 1800 2750 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2700 1850 2700 1750 +-6 +6 1950 4050 2250 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 4200 75 75 2100 4200 2100 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 4200 2150 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 4250 2100 4150 +-6 +6 2250 3600 2550 3900 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2400 3750 75 75 2400 3750 2400 3675 +4 1 0 40 -1 0 12 0.0000 4 15 60 2400 3800 -\001 +-6 +6 1650 4200 1950 4500 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1800 4350 75 75 1800 4350 1800 4275 +4 1 0 40 -1 0 12 0.0000 4 15 60 1800 4400 -\001 +-6 +6 1050 4800 1350 5100 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1200 4950 75 75 1200 4950 1200 4875 +4 1 0 40 -1 0 12 0.0000 4 15 60 1200 5000 -\001 +-6 +6 2850 3000 3150 3300 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3000 3150 75 75 3000 3150 3000 3075 +4 1 0 40 -1 0 12 0.0000 4 15 60 3000 3200 -\001 +-6 +6 4350 4050 4650 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 4200 75 75 4500 4200 4500 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 4200 4550 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 4250 4500 4150 +-6 +6 4350 3450 4650 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 3600 75 75 4500 3600 4500 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 3600 4550 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 3650 4500 3550 +-6 +6 4050 3300 4350 3600 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4200 3450 75 75 4200 3450 4200 3375 +4 1 0 40 -1 0 12 0.0000 4 15 60 4200 3500 -\001 +-6 +6 4350 2250 4650 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 2400 75 75 4500 2400 4500 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 2400 4550 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 2450 4500 2350 +-6 +6 4350 450 4650 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 600 75 75 4500 600 4500 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 600 4550 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 650 4500 550 +-6 +6 4050 2400 4350 2700 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4200 2550 75 75 4200 2550 4200 2475 +4 1 0 40 -1 0 12 0.0000 4 15 60 4200 2600 -\001 +-6 +6 4950 1050 5250 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 1200 75 75 5100 1200 5100 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 1200 5150 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 1250 5100 1150 +-6 +6 4950 1650 5250 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 1800 75 75 5100 1800 5100 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 1800 5150 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 1850 5100 1750 +-6 +6 4650 1800 4950 2100 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4800 1950 75 75 4800 1950 4800 1875 +4 1 0 40 -1 0 12 0.0000 4 15 60 4800 2000 -\001 +-6 +6 4725 3525 4875 4275 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4800 4200 25 25 4800 4200 4800 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4800 3600 25 25 4800 3600 4800 3575 +-6 +6 6150 4650 6450 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 4800 75 75 6300 4800 6300 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 4800 6350 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 4850 6300 4750 +-6 +6 6150 4050 6450 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 4200 75 75 6300 4200 6300 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 4200 6350 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 4250 6300 4150 +-6 +6 5850 3900 6150 4200 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6000 4050 75 75 6000 4050 6000 3975 +4 1 0 40 -1 0 12 0.0000 4 15 60 6000 4100 -\001 +-6 +6 6150 2850 6450 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 3000 75 75 6300 3000 6300 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 3000 6350 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 3050 6300 2950 +-6 +6 6150 3450 6450 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 3600 75 75 6300 3600 6300 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 3600 6350 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 3650 6300 3550 +-6 +6 5850 3600 6150 3900 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6000 3750 75 75 6000 3750 6000 3675 +4 1 0 40 -1 0 12 0.0000 4 15 60 6000 3800 -\001 +-6 +6 6150 1050 6450 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 1200 75 75 6300 1200 6300 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 1200 6350 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 1250 6300 1150 +-6 +6 6150 450 6450 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 600 75 75 6300 600 6300 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 600 6350 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 650 6300 550 +-6 +6 6150 2250 6450 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 2400 75 75 6300 2400 6300 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 2400 6350 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 2450 6300 2350 +-6 +6 6150 1650 6450 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 1800 75 75 6300 1800 6300 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 1800 6350 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 1850 6300 1750 +-6 +6 5850 1200 6150 1500 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6000 1350 75 75 6000 1350 6000 1275 +4 1 0 40 -1 0 12 0.0000 4 15 60 6000 1400 -\001 +-6 +6 7350 4650 7650 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7500 4800 75 75 7500 4800 7500 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7450 4800 7550 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7500 4850 7500 4750 +-6 +6 7350 2850 7650 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7500 3000 75 75 7500 3000 7500 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7450 3000 7550 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7500 3050 7500 2950 +-6 +6 7950 4050 8250 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 8100 4200 75 75 8100 4200 8100 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8050 4200 8150 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8100 4250 8100 4150 +-6 +6 7950 3450 8250 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 8100 3600 75 75 8100 3600 8100 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8050 3600 8150 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8100 3650 8100 3550 +-6 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 900 4800 25 25 900 4800 900 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 900 600 25 25 900 600 900 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 1200 25 25 1500 1200 1500 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 3000 25 25 2700 3000 2700 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 2400 25 25 2700 2400 2700 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2100 3600 25 25 2100 3600 2100 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 4200 25 25 1500 4200 1500 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 4200 25 25 3900 4200 3900 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 3600 25 25 3900 3600 3900 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 2400 25 25 3900 2400 3900 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 600 25 25 3900 600 3900 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 1200 25 25 4500 1200 4500 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 1800 25 25 4500 1800 4500 1775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 4800 25 25 5700 4800 5700 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 4200 25 25 5700 4200 5700 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 3600 25 25 5700 3600 5700 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 3000 25 25 5700 3000 5700 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 1200 25 25 5700 1200 5700 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 600 25 25 5700 600 5700 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 2400 25 25 5700 2400 5700 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5725 1800 25 25 5725 1800 5725 1775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6900 4800 25 25 6900 4800 6900 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6900 3000 25 25 6900 3000 6900 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 4200 25 25 7500 4200 7500 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 3600 25 25 7500 3600 7500 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 1200 25 25 7500 1200 7500 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 600 25 25 7500 600 7500 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2100 1800 25 25 2100 1800 2100 1775 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 600 8400 600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 2400 8400 2400 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 3000 8400 3000 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 4800 8400 4800 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 1200 8400 1200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 3600 8400 3600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 1800 8400 1800 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 4200 8400 4200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 900 4800 1500 600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 900 600 1500 4800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 1500 1200 2100 4275 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 1500 4200 2100 1200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2100 3600 2700 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 2400 3300 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2100 1800 2700 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 3000 3300 2400 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 3600 4500 4200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 4200 4500 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 600 4500 2400 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 2400 4500 600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 1800 5100 1200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 1200 5100 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 4200 6300 4800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 3600 6300 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 3000 6300 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 4800 6300 4200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5700 1200 6300 600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5700 600 6300 1200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5700 1800 6300 2400 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 5700 2400 6300 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6900 3000 7500 4800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6900 4800 7500 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 7500 4200 8100 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 7500 3600 8100 4200 +4 1 0 40 -1 0 12 0.0000 4 135 210 4800 4125 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 4800 3525 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 6000 2350 C6\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 6300 2275 -S6\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 6000 1750 C6\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 6300 2050 S6\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7200 2950 C7\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 7500 3375 S7\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7200 4750 C7\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 7500 4575 -S7\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7800 4150 C3\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 8100 4075 -S3\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7800 3550 C3\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 8100 3850 S3\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7500 1125 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 7500 525 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 675 0\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 1275 4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 1875 2\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 2475 6\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 3675 5\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 4275 3\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 4875 7\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 3075 1\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 675 0\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 1275 1\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 1875 2\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 2475 3\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 3075 4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 3675 5\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 4275 6\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 4875 7\001 diff --git a/libs/libtheora-1.1/doc/spec/hilbert-block.fig b/libs/libtheora-1.1/doc/spec/hilbert-block.fig new file mode 100644 index 00000000..8316c5d1 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/hilbert-block.fig @@ -0,0 +1,104 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 675 645 3825 3795 +4 1 0 50 0 1 12 0.0000 0 150 105 900 3660 0\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 3660 1\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 2760 2\001 +4 1 0 50 0 1 12 0.0000 0 150 105 900 2760 3\001 +4 1 0 50 0 1 12 0.0000 0 150 105 900 1860 4\001 +4 1 0 50 0 1 12 0.0000 0 150 105 900 960 5\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 960 6\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 1860 7\001 +4 1 0 50 0 1 12 0.0000 0 150 105 2700 1860 8\001 +4 1 0 50 0 1 12 0.0000 0 150 105 2700 960 9\001 +4 1 0 50 0 1 12 0.0000 0 150 210 3600 960 10\001 +4 1 0 50 0 1 12 0.0000 0 150 210 3600 1860 11\001 +4 1 0 50 0 1 12 0.0000 0 150 210 3600 2760 12\001 +4 1 0 50 0 1 12 0.0000 0 150 210 2700 2760 13\001 +4 1 0 50 0 1 12 0.0000 0 150 210 2700 3660 14\001 +4 1 0 50 0 1 12 0.0000 0 150 210 3600 3660 15\001 +-6 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 3600 1575 3600 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1800 3375 1800 2925 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1575 2700 1125 2700 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 900 2475 900 2025 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 900 1575 900 1125 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 900 1575 900 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1800 1125 1800 1575 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2025 1800 2475 1800 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2700 1575 2700 1125 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2925 900 3375 900 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3600 1125 3600 1575 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3600 2025 3600 2475 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3375 2700 2925 2700 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2700 2925 2700 3375 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2925 3600 3375 3600 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 450 1350 450 1350 1350 450 1350 450 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 450 2250 450 2250 1350 1350 1350 1350 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 450 3150 450 3150 1350 2250 1350 2250 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 450 4050 450 4050 1350 3150 1350 3150 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 1350 1350 1350 1350 2250 450 2250 450 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 1350 2250 1350 2250 2250 1350 2250 1350 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 1350 3150 1350 3150 2250 2250 2250 2250 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 1350 4050 1350 4050 2250 3150 2250 3150 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 2250 1350 2250 1350 3150 450 3150 450 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 2250 2250 2250 2250 3150 1350 3150 1350 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 2250 3150 2250 3150 3150 2250 3150 2250 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 2250 4050 2250 4050 3150 3150 3150 3150 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 3150 1350 3150 1350 4050 450 4050 450 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 3150 2250 3150 2250 4050 1350 4050 1350 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 3150 3150 3150 3150 4050 2250 4050 2250 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 3150 4050 3150 4050 4050 3150 4050 3150 3150 diff --git a/libs/libtheora-1.1/doc/spec/hilbert-mb.fig b/libs/libtheora-1.1/doc/spec/hilbert-mb.fig new file mode 100644 index 00000000..0ed12a76 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/hilbert-mb.fig @@ -0,0 +1,32 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 810 810 1890 1890 +4 1 0 50 0 1 12 0.0000 0 150 105 900 1860 0\001 +4 1 0 50 0 1 12 0.0000 0 150 105 900 960 1\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 960 2\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 1860 3\001 +-6 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 900 1575 900 1125 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 900 1575 900 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1800 1125 1800 1575 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 450 1350 450 1350 1350 450 1350 450 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 450 2250 450 2250 1350 1350 1350 1350 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 1350 1350 1350 1350 2250 450 2250 450 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 1350 2250 1350 2250 2250 1350 2250 1350 1350 diff --git a/libs/libtheora-1.1/doc/spec/idct.fig b/libs/libtheora-1.1/doc/spec/idct.fig new file mode 100644 index 00000000..2d4388c4 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/idct.fig @@ -0,0 +1,369 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +6 3150 4650 3450 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 4800 75 75 3300 4800 3300 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 4800 3350 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 4850 3300 4750 +-6 +6 3150 4050 3450 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 4200 75 75 3300 4200 3300 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 4200 3350 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 4250 3300 4150 +-6 +6 2850 3900 3150 4200 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3000 4050 75 75 3000 4050 3000 3975 +4 1 0 40 -1 0 12 0.0000 4 15 60 3000 4100 -\001 +-6 +6 3150 2850 3450 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 3000 75 75 3300 3000 3300 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 3000 3350 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 3050 3300 2950 +-6 +6 3150 3450 3450 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3300 3600 75 75 3300 3600 3300 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3250 3600 3350 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 3300 3650 3300 3550 +-6 +6 2850 3600 3150 3900 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 3000 3750 75 75 3000 3750 3000 3675 +4 1 0 40 -1 0 12 0.0000 4 15 60 3000 3800 -\001 +-6 +6 1950 1050 2250 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 1200 75 75 2100 1200 2100 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 1200 2150 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 1250 2100 1150 +-6 +6 1950 450 2250 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 600 75 75 2100 600 2100 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 600 2150 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 650 2100 550 +-6 +6 1950 2250 2250 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 2400 75 75 2100 2400 2100 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 2400 2150 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 2450 2100 2350 +-6 +6 1950 1650 2250 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 1800 75 75 2100 1800 2100 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 1800 2150 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 1850 2100 1750 +-6 +6 1650 1200 1950 1500 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1800 1350 75 75 1800 1350 1800 1275 +4 1 0 40 -1 0 12 0.0000 4 15 60 1800 1400 -\001 +-6 +6 6150 4650 6450 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 4800 75 75 6300 4800 6300 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 4800 6350 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 4850 6300 4750 +-6 +6 6150 450 6450 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6300 600 75 75 6300 600 6300 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6250 600 6350 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6300 650 6300 550 +-6 +6 6750 1050 7050 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6900 1200 75 75 6900 1200 6900 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6850 1200 6950 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6900 1250 6900 1150 +-6 +6 7950 2850 8250 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 8100 3000 75 75 8100 3000 8100 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8050 3000 8150 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8100 3050 8100 2950 +-6 +6 7950 2250 8250 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 8100 2400 75 75 8100 2400 8100 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8050 2400 8150 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 8100 2450 8100 2350 +-6 +6 7350 3450 7650 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7500 3600 75 75 7500 3600 7500 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7450 3600 7550 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7500 3650 7500 3550 +-6 +6 7350 1650 7650 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7500 1800 75 75 7500 1800 7500 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7450 1800 7550 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 7500 1850 7500 1750 +-6 +6 6750 4050 7050 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6900 4200 75 75 6900 4200 6900 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6850 4200 6950 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 6900 4250 6900 4150 +-6 +6 7050 3600 7350 3900 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7200 3750 75 75 7200 3750 7200 3675 +4 1 0 40 -1 0 12 0.0000 4 15 60 7200 3800 -\001 +-6 +6 6450 4200 6750 4500 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6600 4350 75 75 6600 4350 6600 4275 +4 1 0 40 -1 0 12 0.0000 4 15 60 6600 4400 -\001 +-6 +6 5850 4800 6150 5100 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 6000 4950 75 75 6000 4950 6000 4875 +4 1 0 40 -1 0 12 0.0000 4 15 60 6000 5000 -\001 +-6 +6 7650 3000 7950 3300 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 7800 3150 75 75 7800 3150 7800 3075 +4 1 0 40 -1 0 12 0.0000 4 15 60 7800 3200 -\001 +-6 +6 4950 4050 5250 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 4200 75 75 5100 4200 5100 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 4200 5150 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 4250 5100 4150 +-6 +6 4950 3450 5250 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 3600 75 75 5100 3600 5100 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 3600 5150 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 3650 5100 3550 +-6 +6 4650 3300 4950 3600 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4800 3450 75 75 4800 3450 4800 3375 +4 1 0 40 -1 0 12 0.0000 4 15 60 4800 3500 -\001 +-6 +6 4350 2250 4650 2550 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 2400 75 75 4500 2400 4500 2325 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 2400 4550 2400 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 2450 4500 2350 +-6 +6 4350 450 4650 750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4500 600 75 75 4500 600 4500 525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4450 600 4550 600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 4500 650 4500 550 +-6 +6 4050 2400 4350 2700 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4200 2550 75 75 4200 2550 4200 2475 +4 1 0 40 -1 0 12 0.0000 4 15 60 4200 2600 -\001 +-6 +6 4950 1050 5250 1350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 1200 75 75 5100 1200 5100 1125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 1200 5150 1200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 1250 5100 1150 +-6 +6 4950 1650 5250 1950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 5100 1800 75 75 5100 1800 5100 1725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5050 1800 5150 1800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 5100 1850 5100 1750 +-6 +6 1950 4050 2250 4350 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 4200 75 75 2100 4200 2100 4125 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 4200 2150 4200 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 4250 2100 4150 +-6 +6 1950 3450 2250 3750 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 2100 3600 75 75 2100 3600 2100 3525 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2050 3600 2150 3600 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 2100 3650 2100 3550 +-6 +6 1350 4650 1650 4950 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1500 4800 75 75 1500 4800 1500 4725 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1450 4800 1550 4800 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1500 4850 1500 4750 +-6 +6 1350 2850 1650 3150 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 1500 3000 75 75 1500 3000 1500 2925 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1450 3000 1550 3000 +2 1 0 1 0 7 40 -1 20 4.000 0 0 7 0 0 2 + 1500 3050 1500 2950 +-6 +6 4650 1800 4950 2100 +1 3 0 1 0 7 40 -1 20 4.000 1 0.0000 4800 1950 75 75 4800 1950 4800 1875 +4 1 0 40 -1 0 12 0.0000 4 15 60 4800 2000 -\001 +-6 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 4800 25 25 2700 4800 2700 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 4200 25 25 2700 4200 2700 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 3600 25 25 2700 3600 2700 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 2700 3000 25 25 2700 3000 2700 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 1200 25 25 1500 1200 1500 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 600 25 25 1500 600 1500 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 2400 25 25 1500 2400 1500 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1525 1800 25 25 1525 1800 1525 1775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3000 1200 25 25 3000 1200 3000 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3000 600 25 25 3000 600 3000 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 4800 25 25 5700 4800 5700 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 5700 600 25 25 5700 600 5700 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6300 1200 25 25 6300 1200 6300 1175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 3000 25 25 7500 3000 7500 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 7500 2400 25 25 7500 2400 7500 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6900 3600 25 25 6900 3600 6900 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6300 4200 25 25 6300 4200 6300 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 4200 25 25 4500 4200 4500 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 3600 25 25 4500 3600 4500 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4200 4200 25 25 4200 4200 4200 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4200 3600 25 25 4200 3600 4200 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 6900 1800 25 25 6900 1800 6900 1775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 2400 25 25 3900 2400 3900 2375 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 3900 600 25 25 3900 600 3900 575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 4200 25 25 1500 4200 1500 4175 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 1500 3600 25 25 1500 3600 1500 3575 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 900 4800 25 25 900 4800 900 4775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 900 3000 25 25 900 3000 900 2975 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 1800 25 25 4500 1800 4500 1775 +1 3 0 1 0 0 40 -1 20 4.000 1 0.0000 4500 1200 25 25 4500 1200 4500 1175 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 600 8400 600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 2400 8400 2400 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 3000 8400 3000 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 4800 8400 4800 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 1200 8400 1200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 4200 3300 4800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 3600 3300 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 3000 3300 3600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 3600 8400 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 2700 4800 3300 4200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 1800 8400 1800 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 4200 8400 4200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 1500 1200 2100 600 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 1500 600 2100 1200 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 1500 1800 2100 2400 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 1500 2400 2100 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 4800 6300 600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 5700 600 6300 4800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6300 1200 6900 4275 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6300 4200 6900 1200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6900 3600 7500 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 7500 2400 8100 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 6900 1800 7500 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 7500 3000 8100 2400 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 3600 5100 4200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 4200 5100 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 2400 4500 600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 3900 600 4500 2400 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 1800 5100 1200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 4500 1200 5100 1800 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 1500 4200 2100 3600 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 1500 3600 2100 4200 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 900 4800 1500 3000 +2 1 0 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 + 900 3000 1500 4800 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 675 0\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 1275 4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 1875 2\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 2475 6\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 3675 5\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 4275 3\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 4875 7\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 300 3075 1\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1800 2350 C6\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 2100 2275 S6\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1800 1750 C6\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 2100 2050 -S6\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 3000 1125 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 3000 525 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 675 0\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 1275 1\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 1875 2\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 2475 3\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 3075 4\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 3675 5\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 4275 6\001 +4 1 0 40 -1 0 12 0.0000 4 135 90 8700 4875 7\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 4200 4125 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 4200 3525 C4\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1800 4150 C3\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 2100 4075 S3\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1800 3550 C3\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 2100 3850 -S3\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1200 2950 C7\001 +4 1 0 40 -1 0 12 0.0000 4 135 255 1500 3375 -S7\001 +4 1 0 40 -1 0 12 0.0000 4 135 210 1200 4750 C7\001 +4 1 0 40 -1 0 12 0.0000 4 135 195 1500 4575 S7\001 diff --git a/libs/libtheora-1.1/doc/spec/lflim.fig b/libs/libtheora-1.1/doc/spec/lflim.fig new file mode 100644 index 00000000..c71dc7fe --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/lflim.fig @@ -0,0 +1,23 @@ +#FIG 3.2 Produced by xfig version 3.2.5 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 600 2400 5400 2400 +2 1 2 1 0 7 50 -1 -1 3.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 3000 4200 3000 600 +2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 6 + 600 2400 1200 2400 2100 3300 3900 1500 4800 2400 5400 2400 +4 1 0 50 -1 1 12 0.0000 0 195 615 1200 2325 (-2L,0)\001 +4 1 0 50 -1 1 12 0.0000 0 195 600 2100 3525 (-L,-L)\001 +4 0 0 50 -1 1 12 0.0000 0 150 360 3075 825 lflim\001 +4 1 0 50 -1 1 12 0.0000 0 195 480 3900 1425 (L,L)\001 +4 1 0 50 -1 1 12 0.0000 0 195 555 4800 2625 (2L,0)\001 +4 0 0 50 -1 1 12 0.0000 0 150 135 5250 2625 R\001 diff --git a/libs/libtheora-1.1/doc/spec/ltablex.sty b/libs/libtheora-1.1/doc/spec/ltablex.sty new file mode 100644 index 00000000..31a08479 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/ltablex.sty @@ -0,0 +1,237 @@ +%% +%% This is file ltablex.sty (v1.0, November 1995) +%% +%% +%% Author: Anil K. Goel (akgoel@uwaterloo.ca) +%% +%% +%% Copyright (C) QNX Software Systems Ltd. 1995 +%% All rights reserved. +%% Please send any comments/suggetions to: latex@qnx.com +%% +%% This system is distributed in the hope that it will be useful +%% to others, but WITHOUT ANY WARRANTY; without even the implied +%% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +%% +%% +%% The file modifies the tabularx environment to +%% combine the features of the tabularx package +%% (auto-sized columns in a fixed width table) +%% with those of the longtable package +%% (multi-page tables). +%% +%% The tables are typeset using the tabularx environment +%% and the longtable environment is used internally to +%% handle multi-page tables. The \setlongtables feature +%% is used, and, therefore, the document should be +%% run through latex twice. +%% +%% Another feature that has been added is to treat the X +%% columns like 'l' columns if the table contents would allow +%% that to happen without exceeding the specified width of +%% the table. In other words, the specified width is +%% treated as the maximum allowed and not the exact width +%% of the table. This feature is the default but can be +%% disabled (or enabled) with \keepXColumns (or \convertXColumns). +%% +%% Caveats: +%% . The document needs to be latexed a couple times in general. +%% . In general, it is necessary to remove the .aux file before +%% the first latex run on the document. +%% . The table should not be larger than TeX's memory capacity +%% +%% +%% Here is a a simple usage example: +%% +%% +%% \documentclass{article} +%% +%% \usepackage{ltablex} +%% +%% \textheight=4in +%% +%% \begin{document} +%% +%% % we want a table that is \textwidth long, has 4 columns, columns 1 +%% % and 3 are auto sized with the 3rd columns being 3 times wider than +%% % the first column. +%% % +%% +%% +%% \begin{tabularx}{\linewidth}% +%% {|>{\setlength{\hsize}{.5\hsize}\raggedright\arraybackslash}X| % col 1; auto-sized ragged right +%% c| % col 2; default centered +%% >{\setlength{\hsize}{1.5\hsize}\raggedleft\arraybackslash}X|% col 3; auto-sized ragged left +%% l|} % col 4; default left-justified +%% +%% \caption*{The Table Caption}\\ +%% \hline +%% F-Head1 & F-Head2 & F-Head3 & F-Head4\\ +%% \hline +%% \hline +%% \endfirsthead +%% \hline +%% Head1 & Head2 & Head3 & Head4\\ +%% \hline +%% \hline +%% \endhead +%% +%% \hline +%% \hline +%% Foot1 & Foot2 & Foot3 & Foot4\\ +%% \hline +%% \endfoot +%% +%% +%% \hline +%% \hline +%% L-Foot1 & L-Foot2 & L-Foot3 & L-Foot4\\ +%% \hline +%% \endlastfoot +%% +%% This is a very long sentence not likely to fit& +%% not too long& +%% This is another very long sentence not likely to fit& +%% not long\\ +%% +%% \hline +%% filler & filler & filler & filler\\ +%% +%% \hline +%% This is a very long sentence not likely to fit& +%% not too long& +%% This is another very long sentence not likely to fit& +%% not long\\ +%% +%% \hline +%% This is a very long sentence not likely to fit& +%% not too long& +%% This is another very long sentence not likely to fit& +%% not long\\ +%% +%% \hline +%% This is a very long sentence not likely to fit& +%% not too long& +%% This is another very long sentence not likely to fit& +%% not long\\ +%% +%% \end{tabularx} +%% +%% \begin{tabularx}{\linewidth}{|c|X|c|} +%% \hline +%% a &convert X to l & b\\ +%% \hline +%% \end{tabularx} +%% +%% \keepXColumns +%% \begin{tabularx}{\linewidth}{|c|X|c|} +%% \hline +%% a &retain X & b\\ +%% \hline +%% \end{tabularx} +%% +%% \convertXColumns +%% \begin{tabularx}{\linewidth}{|c|X|c|} +%% \hline +%% a &convert X to l & b\\ +%% \hline +%% \end{tabularx} +%% +%% +%% \end{document} + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{ltablex}[1995/11/06 v1.0 Modified tabularx] + +\RequirePackage{longtable}[1994/12/08] +\RequirePackage{tabularx}[1994/02/03] + +\newif\ifTX@convertX@ +\TX@convertX@true + +\newcommand\keepXColumns{ + \TX@convertX@false +} + +\newcommand\convertXColumns{ + \TX@convertX@true +} + +\renewcommand\TX@endtabularx{% + \expandafter\TX@newcol\expandafter{\tabularxcolumn{\TX@col@width}}% + \let\verb\TX@verb + \def\@elt##1{\global\value{##1}\the\value{##1}\relax}% + \edef\TX@ckpt{\cl@@ckpt}% + \let\@elt\relax + \TX@old@table=\maxdimen + \TX@col@width=\TX@target + \global\TX@cols=\@ne + \TX@typeout@ + {\@spaces Table Width\@spaces Column Width\@spaces X Columns}% + + % + % define \endhead, etc. to be \\ so that in this part + % of the process they are just rows + % + \let\savecaption\caption + \def\caption{\\} + \let\saveendhead\endhead + \def\endhead{\\} + \let\saveendfirsthead\endfirsthead + \def\endfirsthead{\\} + \let\saveendfoot\endfoot + \def\endfoot{\\} + \let\saveendlastfoot\endlastfoot + \def\endlastfoot{\\} + % + % + \ifTX@convertX@ + \TX@trial{\def\NC@rewrite@X{\NC@find l}} + \ifdim\wd\@tempboxa<\TX@target + \TX@newcol{l} + \else + \TX@convertX@false + \fi + \fi + + \ifTX@convertX@ + \relax + \else + \TX@trial{\def\NC@rewrite@X{% + \global\advance\TX@cols\@ne\NC@find p{\TX@col@width}}}% + \loop + \TX@arith + \ifTX@ + \TX@trial{}% + \repeat + \fi + {\let\@footnotetext\TX@ftntext\let\@xfootnotenext\TX@xftntext + % we may as well set \LTchunksize to be \maxdimen as the whole + % thing is already in memory anyway so we may as well do it in one + % chunk. if it is too big for one chunk we are already dead.. + \LTchunksize\maxdimen + % + % restore \endhead, etc. + % + \let\caption\savecaption + \let\endhead\saveendhead + \let\endfirsthead\saveendfirsthead + \let\endfoot\saveendfoot + \let\endlastfoot\saveendlastfoot + % + \expandafter\longtable + \the\toks@ + \endlongtable + }% + \global\TX@ftn\expandafter{\expandafter}\the\TX@ftn + \ifnum0=`{\fi}% + \end{tabularx} +} + + +% +% activate column width reading from the .aux file +% + + +\setlongtables diff --git a/libs/libtheora-1.1/doc/spec/macroblock.fig b/libs/libtheora-1.1/doc/spec/macroblock.fig new file mode 100644 index 00000000..3e20d932 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/macroblock.fig @@ -0,0 +1,37 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 702 1540 4867 1540 4867 4828 702 4828 702 1540 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4828 928 4828 928 4610 710 4610 710 4828 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 914 4610 1133 4610 1133 4391 914 4391 914 4610 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 723 4385 1133 4385 1133 4828 723 4828 723 4385 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4610 928 4610 928 4391 710 4391 710 4610 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 914 4828 1133 4828 1133 4610 914 4610 914 4828 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2068 857 6233 857 6233 4145 2068 4145 2068 857 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 1385 1198 5550 1198 5550 4487 1385 4487 1385 1198 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2089 3702 2499 3702 2499 4145 2089 4145 2089 3702 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1406 4043 1816 4043 1816 4487 1406 4487 1406 4043 +4 0 0 50 -1 0 5 0.0000 4 79 182 613 4943 (0,0)\001 +4 0 0 50 -1 0 5 0.0000 4 80 785 2055 833 Frame: chroma plane\001 +4 0 0 50 -1 0 5 0.0000 4 57 467 894 4009 Macroblock\001 +4 0 0 50 -1 0 5 0.0000 4 57 228 450 4521 Block\001 +4 0 0 50 -1 0 5 0.0000 4 57 228 450 4760 Block\001 +4 0 0 50 -1 0 5 0.0000 4 57 148 450 4863 8x8\001 +4 0 0 50 -1 0 5 0.0000 4 80 785 1235 1175 Frame: chroma plane\001 +4 0 0 50 -1 0 5 0.0000 4 80 694 621 1516 Frame: luma plane\001 diff --git a/libs/libtheora-1.1/doc/spec/pic-frame.fig b/libs/libtheora-1.1/doc/spec/pic-frame.fig new file mode 100644 index 00000000..d99ec7e1 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pic-frame.fig @@ -0,0 +1,75 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +0 32 #7f7f7f +6 250 236 5737 4724 +6 659 4520 1068 4724 +4 1 0 50 0 0 7 0.0000 0 75 450 864 4724 X Offset\001 +4 1 0 50 0 0 7 0.0000 0 90 375 864 4596 Picture\001 +-6 +6 250 3880 454 4290 +4 1 0 50 0 0 7 1.5708 0 90 375 327 4086 Picture\001 +4 1 0 50 0 0 7 1.5708 0 75 450 454 4086 Y Offset\001 +-6 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 608 301 608 454 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5466 301 5466 454 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 608 378 5466 378 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 608 4392 608 4546 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 1119 4392 1119 4546 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 608 4468 1119 4468 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 1119 4468 5211 4468 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5211 4392 5211 4546 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 404 4340 557 4340 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 404 3830 557 3830 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 404 761 557 761 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 480 3830 480 761 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5517 4340 5671 4340 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5517 506 5671 506 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 5594 4340 5594 506 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2 + 1 1 1.00 34.09 68.18 + 1 1 1.00 34.09 68.18 + 480 4340 480 3830 +2 2 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 + 608 506 5466 506 5466 4340 608 4340 608 506 +2 2 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 + 1119 761 5211 761 5211 3830 1119 3830 1119 761 +4 1 0 50 0 0 7 0.0000 0 90 720 3165 4596 Picture Width\001 +4 1 0 50 0 0 7 1.5708 0 105 690 5722 1912 Frame Height\001 +4 1 0 50 0 0 7 0.0000 0 90 660 2782 326 Frame Width\001 +4 1 0 50 0 0 7 1.5708 0 105 750 454 2295 Picture Height\001 +4 1 0 50 0 0 7 0.0000 0 75 315 2782 685 Frame\001 +4 1 0 50 0 0 7 0.0000 0 90 375 3165 2295 Picture\001 +4 0 0 50 0 0 7 0.0000 0 105 240 659 4290 (0,0)\001 +-6 diff --git a/libs/libtheora-1.1/doc/spec/pic_even.fig b/libs/libtheora-1.1/doc/spec/pic_even.fig new file mode 100644 index 00000000..041a43a1 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pic_even.fig @@ -0,0 +1,102 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 724 2025 945 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2244 945 2244 945 2025 732 2025 732 2244 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2475 945 2475 945 2256 732 2256 732 2475 +-6 +6 1665 2070 1888 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2267 1888 2267 1888 2070 1673 2070 1673 2267 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2475 1888 2475 1888 2278 1673 2278 1673 2475 +-6 +6 724 900 945 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1119 945 1119 945 900 732 900 732 1119 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1350 945 1350 945 1131 732 1131 732 1350 +-6 +6 6300 2070 6795 2520 +6 6300 2070 6570 2295 +6 6300 2070 6570 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6335 2295 6553 2295 6553 2076 6335 2076 6335 2295 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6335 2520 6553 2520 6553 2301 6335 2301 6335 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2295 6778 2295 6778 2076 6560 2076 6560 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2520 6778 2520 6778 2301 6560 2301 6560 2520 +-6 +6 4455 2070 4950 2520 +6 4455 2070 4725 2295 +6 4455 2070 4725 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2295 4708 2295 4708 2076 4490 2076 4490 2295 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2520 4708 2520 4708 2301 4490 2301 4490 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 2295 4933 2295 4933 2076 4715 2076 4715 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 2520 4933 2520 4933 2301 4715 2301 4715 2520 +-6 +6 4455 945 4950 1395 +6 4455 945 4725 1170 +6 4455 945 4725 1170 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1170 4708 1170 4708 951 4490 951 4490 1170 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1395 4708 1395 4708 1176 4490 1176 4490 1395 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 1170 4933 1170 4933 951 4715 951 4715 1170 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 1395 4933 1395 4933 1176 4715 1176 4715 1395 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2249 1800 3736 1800 3736 2947 2249 2947 2249 1800 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2385 1935 3600 1935 3600 2745 2385 2745 2385 1935 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2745 2610 2745 2610 2526 2397 2526 2397 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2745 3590 2745 3590 2548 3375 2548 3375 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 724 900 1888 900 1888 2475 724 2475 724 900 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 473 675 2003 675 2003 2925 473 2925 473 675 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2154 2610 2154 2610 1935 2397 1935 2397 2154 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 4005 720 7020 720 7020 2970 4005 2970 4005 720 +4 0 0 50 -1 0 24 0.0000 4 30 270 2835 2655 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 1080 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 765 1665 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 2430 2385 ...\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 450 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 2205 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 3943 3098 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 4545 2655 Pixels\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 5220 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 4680 1755 ...\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 2205 1665 Frame: chroma (4:2:0 case)\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 450 585 Frame: chroma (4:2:2 case)\001 +4 0 0 50 -1 0 9 0.0000 4 75 615 4005 630 Frame: luma\001 diff --git a/libs/libtheora-1.1/doc/spec/pic_even_odd.fig b/libs/libtheora-1.1/doc/spec/pic_even_odd.fig new file mode 100644 index 00000000..4b513b7f --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pic_even_odd.fig @@ -0,0 +1,88 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 724 2025 945 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2244 945 2244 945 2025 732 2025 732 2244 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2475 945 2475 945 2256 732 2256 732 2475 +-6 +6 1665 2070 1888 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2267 1888 2267 1888 2070 1673 2070 1673 2267 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2475 1888 2475 1888 2278 1673 2278 1673 2475 +-6 +6 4455 2070 4950 2520 +6 4455 2070 4725 2295 +6 4455 2070 4725 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2295 4708 2295 4708 2076 4490 2076 4490 2295 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2520 4708 2520 4708 2301 4490 2301 4490 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 2295 4933 2295 4933 2076 4715 2076 4715 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 2520 4933 2520 4933 2301 4715 2301 4715 2520 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2249 1800 3736 1800 3736 2947 2249 2947 2249 1800 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2385 1935 3600 1935 3600 2745 2385 2745 2385 1935 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2745 2610 2745 2610 2526 2397 2526 2397 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2745 3590 2745 3590 2548 3375 2548 3375 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 724 900 1888 900 1888 2475 724 2475 724 900 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 473 675 2003 675 2003 2925 473 2925 473 675 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2154 2610 2154 2610 1935 2397 1935 2397 2154 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 4005 720 7020 720 7020 2970 4005 2970 4005 720 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1170 4708 1170 4708 951 4490 951 4490 1170 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4715 1170 4933 1170 4933 951 4715 951 4715 1170 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2520 6778 2520 6778 2301 6560 2301 6560 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2295 6778 2295 6778 2076 6560 2076 6560 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4715 945 4933 945 4933 726 4715 726 4715 945 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4490 945 4708 945 4708 726 4490 726 4490 945 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 6785 2295 7003 2295 7003 2076 6785 2076 6785 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 6785 2520 7003 2520 7003 2301 6785 2301 6785 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1125 945 1125 945 906 732 906 732 1125 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 732 894 945 894 945 675 732 675 732 894 +4 0 0 50 -1 0 24 0.0000 4 30 270 2835 2655 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 1080 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 765 1665 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 2430 2385 ...\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 450 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 2205 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 3943 3098 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 4545 2655 Pixels\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 5220 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 4680 1755 ...\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 2205 1665 Frame: chroma (4:2:0 case)\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 450 585 Frame: chroma (4:2:2 case)\001 +4 0 0 50 -1 0 9 0.0000 4 75 615 4005 630 Frame: luma\001 diff --git a/libs/libtheora-1.1/doc/spec/pic_odd.fig b/libs/libtheora-1.1/doc/spec/pic_odd.fig new file mode 100644 index 00000000..da126010 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pic_odd.fig @@ -0,0 +1,90 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 724 2025 945 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2244 945 2244 945 2025 732 2025 732 2244 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2475 945 2475 945 2256 732 2256 732 2475 +-6 +6 1665 2070 1888 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2267 1888 2267 1888 2070 1673 2070 1673 2267 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2475 1888 2475 1888 2278 1673 2278 1673 2475 +-6 +6 724 900 945 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1119 945 1119 945 900 732 900 732 1119 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1350 945 1350 945 1131 732 1131 732 1350 +-6 +6 6300 2070 6795 2520 +6 6300 2070 6570 2295 +6 6300 2070 6570 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6335 2295 6553 2295 6553 2076 6335 2076 6335 2295 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6335 2520 6553 2520 6553 2301 6335 2301 6335 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2295 6778 2295 6778 2076 6560 2076 6560 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2520 6778 2520 6778 2301 6560 2301 6560 2520 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2249 1800 3736 1800 3736 2947 2249 2947 2249 1800 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2385 1935 3600 1935 3600 2745 2385 2745 2385 1935 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2745 2610 2745 2610 2526 2397 2526 2397 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2745 3590 2745 3590 2548 3375 2548 3375 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 724 900 1888 900 1888 2475 724 2475 724 900 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 473 675 2003 675 2003 2925 473 2925 473 675 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2154 2610 2154 2610 1935 2397 1935 2397 2154 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 4005 720 7020 720 7020 2970 4005 2970 4005 720 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2295 4708 2295 4708 2076 4490 2076 4490 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2520 4708 2520 4708 2301 4490 2301 4490 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1170 4708 1170 4708 951 4490 951 4490 1170 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1395 4708 1395 4708 1176 4490 1176 4490 1395 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 1170 4483 1170 4483 951 4265 951 4265 1170 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 1395 4483 1395 4483 1176 4265 1176 4265 1395 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 2295 4483 2295 4483 2076 4265 2076 4265 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 2520 4483 2520 4483 2301 4265 2301 4265 2520 +4 0 0 50 -1 0 24 0.0000 4 30 270 2835 2655 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 1080 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 765 1665 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 2430 2385 ...\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 450 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 2205 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 3943 3098 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 4545 2655 Pixels\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 5220 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 4680 1755 ...\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 2205 1665 Frame: chroma (4:2:0 case)\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 450 585 Frame: chroma (4:2:2 case)\001 +4 0 0 50 -1 0 9 0.0000 4 75 615 4005 630 Frame: luma\001 diff --git a/libs/libtheora-1.1/doc/spec/pic_odd_even.fig b/libs/libtheora-1.1/doc/spec/pic_odd_even.fig new file mode 100644 index 00000000..f1312952 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pic_odd_even.fig @@ -0,0 +1,84 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 724 2025 945 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2244 945 2244 945 2025 732 2025 732 2244 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 2475 945 2475 945 2256 732 2256 732 2475 +-6 +6 1665 2070 1888 2475 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2267 1888 2267 1888 2070 1673 2070 1673 2267 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1673 2475 1888 2475 1888 2278 1673 2278 1673 2475 +-6 +6 724 900 945 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1119 945 1119 945 900 732 900 732 1119 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 732 1350 945 1350 945 1131 732 1131 732 1350 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2249 1800 3736 1800 3736 2947 2249 2947 2249 1800 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2385 1935 3600 1935 3600 2745 2385 2745 2385 1935 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2745 2610 2745 2610 2526 2397 2526 2397 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3375 2745 3590 2745 3590 2548 3375 2548 3375 2745 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 724 900 1888 900 1888 2475 724 2475 724 900 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 473 675 2003 675 2003 2925 473 2925 473 675 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2397 2154 2610 2154 2610 1935 2397 1935 2397 2154 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 4005 720 7020 720 7020 2970 4005 2970 4005 720 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2295 4708 2295 4708 2076 4490 2076 4490 2295 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 2520 4708 2520 4708 2301 4490 2301 4490 2520 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 2295 4483 2295 4483 2076 4265 2076 4265 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 2520 4483 2520 4483 2301 4265 2301 4265 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4500 945 6795 945 6795 2520 4500 2520 4500 945 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2520 6778 2520 6778 2301 6560 2301 6560 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 6560 2295 6778 2295 6778 2076 6560 2076 6560 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 6785 2295 7003 2295 7003 2076 6785 2076 6785 2295 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 6785 2520 7003 2520 7003 2301 6785 2301 6785 2520 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4490 1170 4708 1170 4708 951 4490 951 4490 1170 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 945 4483 945 4483 726 4265 726 4265 945 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4265 1170 4483 1170 4483 951 4265 951 4265 1170 +2 2 0 1 0 11 50 -1 43 0.000 0 0 -1 0 0 5 + 4490 945 4708 945 4708 726 4490 726 4490 945 +4 0 0 50 -1 0 24 0.0000 4 30 270 2835 2655 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 1080 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 765 1665 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 2430 2385 ...\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 450 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 2205 3060 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 3943 3098 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 4545 2655 Pixels\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 5220 2295 ...\001 +4 0 0 50 -1 0 24 0.0000 4 30 270 4680 1755 ...\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 2205 1665 Frame: chroma (4:2:0 case)\001 +4 0 0 50 -1 0 9 0.0000 4 105 1335 450 585 Frame: chroma (4:2:2 case)\001 +4 0 0 50 -1 0 9 0.0000 4 75 615 4005 630 Frame: luma\001 diff --git a/libs/libtheora-1.1/doc/spec/pixel420.fig b/libs/libtheora-1.1/doc/spec/pixel420.fig new file mode 100644 index 00000000..56e91912 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pixel420.fig @@ -0,0 +1,56 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 675 4365 1170 4815 +6 675 4365 945 4590 +6 675 4365 945 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4590 928 4590 928 4371 710 4371 710 4590 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4815 928 4815 928 4596 710 4596 710 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4590 1153 4590 1153 4371 935 4371 935 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4815 1153 4815 1153 4596 935 4596 935 4815 +-6 +6 1125 4365 1646 4815 +6 1125 4365 1420 4590 +6 1125 4365 1420 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1163 4590 1401 4590 1401 4371 1163 4371 1163 4590 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1163 4815 1401 4815 1401 4596 1163 4596 1163 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1409 4590 1646 4590 1646 4371 1409 4371 1409 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1409 4815 1646 4815 1646 4596 1409 4596 1409 4815 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 1665 1350 4788 1350 4788 4153 1665 4153 1665 1350 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2700 900 5823 900 5823 3703 2700 3703 2700 900 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 702 2025 3825 2025 3825 4828 702 4828 702 2025 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1800 4005 2018 4005 2018 3786 1800 3786 1800 4005 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2160 4005 2378 4005 2378 3786 2160 3786 2160 4005 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2835 3555 3053 3555 3053 3336 2835 3336 2835 3555 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3195 3555 3413 3555 3413 3336 3195 3336 3195 3555 +4 0 0 50 -1 0 8 0.0000 4 105 1215 1485 1305 Frame: chroma plane Cb\001 +4 0 0 50 -1 0 8 0.0000 4 105 1200 2565 855 Frame: chroma plane Cr\001 +4 0 0 50 -1 0 8 0.0000 4 105 1035 540 1980 Frame: luma planeY'\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 765 4320 Pixels\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 613 4943 (0,0)\001 diff --git a/libs/libtheora-1.1/doc/spec/pixel422.fig b/libs/libtheora-1.1/doc/spec/pixel422.fig new file mode 100644 index 00000000..dbe008a3 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pixel422.fig @@ -0,0 +1,70 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 675 4365 1170 4815 +6 675 4365 945 4590 +6 675 4365 945 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4590 928 4590 928 4371 710 4371 710 4590 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4815 928 4815 928 4596 710 4596 710 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4590 1153 4590 1153 4371 935 4371 935 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4815 1153 4815 1153 4596 935 4596 935 4815 +-6 +6 1125 4365 1646 4815 +6 1125 4365 1420 4590 +6 1125 4365 1420 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1163 4590 1401 4590 1401 4371 1163 4371 1163 4590 +-6 +-6 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1163 4815 1401 4815 1401 4596 1163 4596 1163 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1409 4590 1646 4590 1646 4371 1409 4371 1409 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1409 4815 1646 4815 1646 4596 1409 4596 1409 4815 +-6 +6 1800 3690 2025 4140 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1807 3909 2025 3909 2025 3690 1807 3690 1807 3909 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1807 4140 2025 4140 2025 3921 1807 3921 1807 4140 +-6 +6 2160 3690 2385 4140 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2167 3909 2385 3909 2385 3690 2167 3690 2167 3909 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2167 4140 2385 4140 2385 3921 2167 3921 2167 4140 +-6 +6 3195 3240 3420 3690 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3202 3459 3420 3459 3420 3240 3202 3240 3202 3459 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3202 3690 3420 3690 3420 3471 3202 3471 3202 3690 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 1665 1350 4788 1350 4788 4153 1665 4153 1665 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2842 3459 3060 3459 3060 3240 2842 3240 2842 3459 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2700 900 5823 900 5823 3703 2700 3703 2700 900 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2842 3690 3060 3690 3060 3471 2842 3471 2842 3690 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 702 2025 3825 2025 3825 4828 702 4828 702 2025 +4 0 0 50 -1 0 8 0.0000 4 105 1215 1485 1305 Frame: chroma plane Cb\001 +4 0 0 50 -1 0 8 0.0000 4 105 1200 2565 855 Frame: chroma plane Cr\001 +4 0 0 50 -1 0 8 0.0000 4 105 1035 540 1980 Frame: luma planeY'\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 765 4320 Pixels\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 613 4943 (0,0)\001 diff --git a/libs/libtheora-1.1/doc/spec/pixel444.fig b/libs/libtheora-1.1/doc/spec/pixel444.fig new file mode 100644 index 00000000..75655e8a --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/pixel444.fig @@ -0,0 +1,44 @@ +#FIG 3.2 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 702 2025 3825 2025 3825 4828 702 4828 702 2025 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 1665 1350 4788 1350 4788 4153 1665 4153 1665 1350 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 2700 900 5823 900 5823 3703 2700 3703 2700 900 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4590 928 4590 928 4371 710 4371 710 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4590 1153 4590 1153 4371 935 4371 935 4590 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 935 4815 1153 4815 1153 4596 935 4596 935 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 710 4815 928 4815 928 4596 710 4596 710 4815 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1700 3915 1918 3915 1918 3696 1700 3696 1700 3915 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1925 3915 2143 3915 2143 3696 1925 3696 1925 3915 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1925 4140 2143 4140 2143 3921 1925 3921 1925 4140 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1700 4140 1918 4140 1918 3921 1700 3921 1700 4140 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2735 3465 2953 3465 2953 3246 2735 3246 2735 3465 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2960 3465 3178 3465 3178 3246 2960 3246 2960 3465 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2960 3690 3178 3690 3178 3471 2960 3471 2960 3690 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2735 3690 2953 3690 2953 3471 2735 3471 2735 3690 +4 0 0 50 -1 0 8 0.0000 4 105 1215 1485 1305 Frame: chroma plane Cb\001 +4 0 0 50 -1 0 8 0.0000 4 105 1200 2565 855 Frame: chroma plane Cr\001 +4 0 0 50 -1 0 8 0.0000 4 105 1035 540 1980 Frame: luma planeY'\001 +4 0 0 50 -1 0 7 0.0000 4 75 285 765 4320 Pixels\001 +4 0 0 50 -1 0 7 0.0000 4 90 210 613 4943 (0,0)\001 diff --git a/libs/libtheora-1.1/doc/spec/raster-block.fig b/libs/libtheora-1.1/doc/spec/raster-block.fig new file mode 100644 index 00000000..cebaf02b --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/raster-block.fig @@ -0,0 +1,91 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 900 1575 900 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 450 1350 450 1350 1350 450 1350 450 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 450 2250 450 2250 1350 1350 1350 1350 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 450 3150 450 3150 1350 2250 1350 2250 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 450 4050 450 4050 1350 3150 1350 3150 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 1350 1350 1350 1350 2250 450 2250 450 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 1350 2250 1350 2250 2250 1350 2250 1350 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 1350 3150 1350 3150 2250 2250 2250 2250 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 1350 4050 1350 4050 2250 3150 2250 3150 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 2250 1350 2250 1350 3150 450 3150 450 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 2250 2250 2250 2250 3150 1350 3150 1350 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 2250 3150 2250 3150 3150 2250 3150 2250 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 2250 4050 2250 4050 3150 3150 3150 3150 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 3150 1350 3150 1350 4050 450 4050 450 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1350 3150 2250 3150 2250 4050 1350 4050 1350 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2250 3150 3150 3150 3150 4050 2250 4050 2250 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 3150 3150 4050 3150 4050 4050 3150 4050 3150 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4050 450 4950 450 4950 1350 4050 1350 4050 450 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4050 1350 4950 1350 4950 2250 4050 2250 4050 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4050 2250 4950 2250 4950 3150 4050 3150 4050 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4050 3150 4950 3150 4950 4050 4050 4050 4050 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4950 3150 5850 3150 5850 4050 4950 4050 4950 3150 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4950 2250 5850 2250 5850 3150 4950 3150 4950 2250 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4950 1350 5850 1350 5850 2250 4950 2250 4950 1350 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4950 450 5850 450 5850 1350 4950 1350 4950 450 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 3600 1575 3600 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2925 3600 3375 3600 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 2025 3600 2475 3600 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 1125 2655 1575 2655 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 4770 3600 5220 3600 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5445 3510 900 2880 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 + 1 1 1.00 60.00 120.00 + 5400 1800 855 1170 +4 1 0 50 0 1 12 0.0000 0 150 105 900 3660 0\001 +4 1 0 50 0 1 12 0.0000 0 150 105 1800 3660 1\001 +4 1 0 50 0 1 12 0.0000 0 150 105 2700 3660 2\001 +4 0 0 50 -1 0 20 0.0000 4 30 225 3555 3645 ...\001 +4 0 0 50 -1 0 20 0.0000 4 30 225 945 1845 ...\001 +4 0 0 50 -1 0 12 0.0000 4 150 330 5310 3645 m-1\001 +4 0 0 50 -1 0 12 0.0000 4 150 435 5175 2655 2m-1\001 +4 1 0 50 0 1 12 0.0000 0 105 165 900 2760 m\001 +4 1 0 50 0 1 12 0.0000 0 195 690 855 1035 (n-1)*m\001 +4 0 0 50 -1 0 12 0.0000 4 150 540 5085 900 n*m-1\001 diff --git a/libs/libtheora-1.1/doc/spec/reference-frames.fig b/libs/libtheora-1.1/doc/spec/reference-frames.fig new file mode 100644 index 00000000..8026e56e --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/reference-frames.fig @@ -0,0 +1,46 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 2 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 + 1980 450 2430 450 2430 900 1980 900 1980 450 +2 2 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 + 2520 450 2970 450 2970 900 2520 900 2520 450 +2 2 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 + 4140 450 4590 450 4590 900 4140 900 4140 450 +2 2 1 2 0 7 50 -1 -1 4.000 0 0 -1 0 0 5 + 1440 450 1890 450 1890 900 1440 900 1440 450 +2 2 1 2 0 7 50 -1 15 4.000 0 0 -1 0 0 5 + 3600 450 4050 450 4050 900 3600 900 3600 450 +2 2 1 2 0 7 50 -1 41 4.000 0 0 -1 0 0 5 + 3060 450 3510 450 3510 900 3060 900 3060 450 +2 2 0 2 0 7 50 -1 41 0.000 0 0 -1 0 0 5 + 900 450 1350 450 1350 900 900 900 900 450 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3780 990 3780 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 3240 990 3240 1395 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 1 2 + 0 0 1.00 60.00 120.00 + 1125 990 1125 1395 +4 0 0 50 -1 0 20 0.0000 4 30 225 4770 675 ...\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 900 405 Intra\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 1440 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 1980 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 2520 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 3060 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 3600 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 150 420 4140 405 Inter\001 +4 0 0 50 -1 0 12 0.0000 4 120 630 3690 1575 current\001 +4 0 0 50 -1 0 12 0.0000 4 150 840 2745 1575 reference\001 +4 0 0 50 -1 0 12 0.0000 4 150 510 2925 1755 frame\001 +4 0 0 50 -1 0 12 0.0000 4 150 510 3690 1755 frame\001 +4 0 0 50 -1 0 12 0.0000 4 195 570 855 1575 golden\001 +4 0 0 50 -1 0 12 0.0000 4 150 510 900 1800 frame\001 diff --git a/libs/libtheora-1.1/doc/spec/spec.bib b/libs/libtheora-1.1/doc/spec/spec.bib new file mode 100644 index 00000000..cf62cebf --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/spec.bib @@ -0,0 +1,120 @@ +@MANUAL{rfc2044, + author="Francois Yergeau", + title="{RFC} 2044: {UTF}-8, a transformation format of Unicode and {ISO} + 10646", + month=oct, + year=1996, + note="\url{http://www.ietf.org/rfc/rfc2044.txt}" +} + +@ARTICLE{CSF77, + author="Wen-Hsiung Chen and C. Harrison Smith and S. C. Fralick", + title="A Fast Computational Algorithm for the Discrete Cosine Transform", + journal="{IEEE} Transactions on Communications", + volume="COM-25", + number=9, + pages="1004--1011", + month=sep, + year=1977 +} + +@MISC{Mel04, + author="Mike Melanson", + title="{VP3} Bitstream Format and Decoding Process", + howpublished="\url{http://www.multimedia.cx/vp3-format.txt}", + month=mar, + year=2004 +} + +@MISC{Poyn97, + author="Charles Poynton", + title="Frequently-Asked Questions about Gamma", + howpublished="\url{http://www.poynton.com/GammaFAQ.html}", + month=feb, + year=1997 +} + +@MANUAL{rec470, + key="ITU470", + title="Reccomendation {ITU-R} {BT}.470-6: Conventional Television Systems", + edition="1970, revised", + organization="International Telecommunications Union", + address="1211 Geneva 20, Switzerland", + year=1998 +} + +@MANUAL{rec601, + key="ITU601", + title="Reccomendation {ITU-R} {BT}.601-5: Studio Encoding Parameters of + Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios", + edition="1982, revised", + organization="International Telecommunications Union", + address="1211 Geneva 20, Switzerland", + year=1995 +} + +@MANUAL{rec709, + key="ITU709", + title="Recommendation {ITU-R} {BT}.709-5: Parameter values for the {HDTV} + standards for production and international programme exchange", + edition="1990, revised", + organization="International Telecommunications Union", + address="1211 Geneva 20, Switzerland", + year=2002 +} + +@MANUAL{smpte170m, + key="SMPTE170M", + title="{SMPTE-170M}: Television --- Composite Analog Video Signal --- {NTSC} + for Studio Applications", + organization="Society of Motion Pciture and Television Engineers", + year=1994 +} + +@MANUAL{smpte240m, + key="SMPTE240M", + title="{SMPTE-240M}: Television --- Signal Parameters --- 1125-Line + High-Definition Production", + organization="Society of Motion Pciture and Television Engineers", + year=1999 +} + +@MANUAL{vorbis, + title="{Vorbis~I} specification", + organization="{Xiph.Org Foundation}", + year=2002, + note="\url{http://www.xiph.org/ogg/vorbis/doc/}" +} + +@MANUAL{rfc2119, + author="Scott Bradner", + title="{RFC} 2119: Key words for use in {RFC}s to Indicate Requirement + Levels", + month=mar, + year=1997, + note="\url{http://www.ietf.org/rfc/rfc2119.txt}" +} + +@MANUAL{rfc3533, + author="Silvia Pfeiffer", + title="{RFC} 3533: The {Ogg} Encapsulation Format Version 0", + month=may, + year=2003, + note="\url{http://www.ietf.org/rfc/rfc3533.txt}" +} + +@MANUAL{rfc3534, + author="Linus Walleij", + title="{RFC} 3534: The {application/ogg} Media Type", + month=may, + year=2003, + note="\url{http://www.ietf.org/rfc/rfc3534.txt}" +} + +@MANUAL{rfc3550, + author="H. Schulzrinne, S. Casner, R. Frederick, V. Jacobson", + title="RTP: A Transport Protocol for Real-Time Applications", + month=jul, + year=2003, + note="\url{http://www.ietf.org/rfc/rfc3550.txt}" +} diff --git a/libs/libtheora-1.1/doc/spec/spec.tex b/libs/libtheora-1.1/doc/spec/spec.tex new file mode 100644 index 00000000..da29ed58 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/spec.tex @@ -0,0 +1,8194 @@ +\documentclass[9pt,letterpaper]{book} + +\usepackage{latexsym} +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{bm} +\usepackage{textcomp} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{tabularx} +\usepackage{longtable} +\usepackage{ltablex} +\usepackage{wrapfig} +\usepackage[pdfpagemode=None,pdfstartview=FitH,pdfview=FitH,colorlinks=true]% + {hyperref} + +\newtheorem{theorem}{Theorem}[section] +\newcommand{\idx}[1]{{\ensuremath{\mathit{#1}}}} +\newcommand{\qti}{\idx{qti}} +\newcommand{\qtj}{\idx{qtj}} +\newcommand{\pli}{\idx{pli}} +\newcommand{\plj}{\idx{plj}} +\newcommand{\qi}{\idx{qi}} +\newcommand{\ci}{\idx{ci}} +\newcommand{\bmi}{\idx{bmi}} +\newcommand{\bmj}{\idx{bmj}} +\newcommand{\qri}{\idx{qri}} +\newcommand{\qrj}{\idx{qrj}} +\newcommand{\hti}{\idx{hti}} +\newcommand{\sbi}{\idx{sbi}} +\newcommand{\bi}{\idx{bi}} +\newcommand{\bj}{\idx{bj}} +\newcommand{\mbi}{\idx{mbi}} +\newcommand{\mbj}{\idx{mbj}} +\newcommand{\mi}{\idx{mi}} +\newcommand{\cbi}{\idx{cbi}} +\newcommand{\qii}{\idx{qii}} +\newcommand{\ti}{\idx{ti}} +\newcommand{\tj}{\idx{tj}} +\newcommand{\rfi}{\idx{rfi}} +\newcommand{\zzi}{\idx{zzi}} +\newcommand{\ri}{\idx{ri}} +%This somewhat odd construct ensures that \bitvar{\qi}, etc., will set the +% qi in bold face, even though it is in a \mathit font, yet \bitvar{VAR} will +% set VAR in a bold, roman font. +\newcommand{\bitvar}[1]{\ensuremath{\mathbf{\bm{#1}}}} +\newcommand{\locvar}[1]{\ensuremath{\mathrm{#1}}} +\newcommand{\term}[1]{{\em #1}} +\newcommand{\bin}[1]{\ensuremath{\mathtt{b#1}}} +\newcommand{\hex}[1]{\ensuremath{\mathtt{0x#1}}} +\newcommand{\ilog}{\ensuremath{\mathop{\mathrm{ilog}}\nolimits}} +\newcommand{\round}{\ensuremath{\mathop{\mathrm{round}}\nolimits}} +\newcommand{\sign}{\ensuremath{\mathop{\mathrm{sign}}\nolimits}} +\newcommand{\lflim}{\ensuremath{\mathop{\mathrm{lflim}}\nolimits}} + +%Section-based table, figure, and equation numbering. +\numberwithin{equation}{chapter} +\numberwithin{figure}{chapter} +\numberwithin{table}{chapter} + +%Provide section numbering for \paragraph. +\makeatletter +\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}% + {-3.25ex plus -1ex minus -0.2ex}% + {1.5ex plus 0.2ex}% + {\normalfont\normalsize\bfseries}} +\makeatother +\stepcounter{secnumdepth} +\stepcounter{tocdepth} + +\keepXColumns + +\pagestyle{headings} +\bibliographystyle{alpha} + +\title{Theora Specification} +\author{Xiph.Org Foundation} +\date{\today} + + +\begin{document} + +\frontmatter + +\begin{titlepage} +\maketitle +\end{titlepage} +\thispagestyle{empty} +\cleardoublepage + +\pagenumbering{roman} + +\thispagestyle{plain} +\tableofcontents +\cleardoublepage + +\thispagestyle{plain} +\listoffigures +\cleardoublepage + +\thispagestyle{plain} +\listoftables +\cleardoublepage + +\thispagestyle{plain} +\markboth{{\sc Notation and Conventions}}{{\sc Notation and Conventions}} +\chapter*{Notation and Conventions} + +All parameters either passed in or out of a decoding procedure are given in + \bitvar{bold\ face}. + +The prefix \bin{} indicates that the following value is to be interpreted as a + binary number (base 2). +\begin{verse} +{\bf Example:} The value \bin{1110100} is equal to the decimal value 116. +\end{verse} + +The prefix \hex{} indicates the following value is to be interpreted as a + hexadecimal number (base 16). +\begin{verse} +{\bf Example:} The value \hex{74} is equal to the decimal value 116. +\end{verse} + +All arithmetic defined by this specification is exact. +However, any real numbers that do arise will always be converted back to + integers again in short order. +The entire specification can be implemented using only normal integer + operations. +All operations are to be implemented with sufficiently large integers so that + overflow cannot occur. +Where the result of a computation is to be truncated to a fixed-sized binary + representation, this will be explicitly noted. +The size given for all variables is the maximum number of bits needed to store + any value in that variable. +Intermediate computations involving that variable may require more bits. + +The following operators are defined: + +\begin{description} +\item[$|a|$] +The absolute value of a number $a$. +\begin{align*} +|a| & = \left\{\begin{array}{ll} +-a, & a < 0 \\ +a, & a \ge 0 +\end{array}\right. +\end{align*} + +\item[$a*b$] +Multiplication of a number $a$ by a number $b$. +\item[$\frac{a}{b}$] +Exact division of a number $a$ by a number $b$, producing a potentially + non-integer result. + +\item[$\left\lfloor a\right\rfloor$] +The largest integer less than or equal to a real number $a$. + +\item[$\left\lceil a\right\rceil$] +The smallest integer greater than or equal to a real number $a$. + +\item[$a//b$] +Integer division of $a$ by $b$. +\begin{align*} +a//b & = \left\{\begin{array}{ll} +\left\lceil\frac{a}{b}\right\rceil, & a < 0 \\ +\left\lfloor\frac{a}{b}\right\rfloor, & a \ge 0 +\end{array}\right. +\end{align*} + +\item[$a\%b$] +The remainder from the integer division of $a$ by $b$. +\begin{align*} +a\%b & = a-|b|*\left\lfloor\frac{a}{|b|}\right\rfloor +\end{align*} +Note that with this definition, the result is always non-negative and less than + $|b|$. + +\item[$a<>b$] +The value obtained by right-shifting the two's complement integer $a$ by $b$ + bits, filling in the leftmost bits of the new value with $0$ if $a$ is + non-negative and $1$ if $a$ is negative. +This is {\em not} equivalent to integer division of $a$ by $2^b$. +Instead, +\begin{align*} +a>>b & = \left\lfloor\frac{a}{2^b}\right\rfloor. +\end{align*} + +\item[$\round(a)$] +Rounds a number $a$ to the nearest integer, with ties rounded away from $0$. +\begin{align*} +\round(a) = \left\{\begin{array}{ll} +\lceil a-\frac{1}{2}\rceil & a \le 0 \\ +\lfloor a+\frac{1}{2}\rfloor & a > 0 +\end{array}\right. +\end{align*} + +\item[$\sign(a)$] +Returns the sign of a given number. +\begin{align*} +\sign(a) = \left\{\begin{array}{ll} +-1 & a < 0 \\ +0 & a = 0 \\ +1 & a > 0 +\end{array}\right. +\end{align*} + +\item[$\ilog(a)$] +The minimum number of bits required to store a positive integer $a$ in + two's complement notation, or $0$ for a non-positive integer $a$. +\begin{align*} +\ilog(a) = \left\{\begin{array}{ll} +0, & a \le 0 \\ +\left\lfloor\log_2{a}\right\rfloor+1, & a > 0 +\end{array}\right. +\end{align*} + +\begin{verse} +{\bf Examples:} +\begin{itemize} +\item $\ilog(-1)=0$ +\item $\ilog(0)=0$ +\item $\ilog(1)=1$ +\item $\ilog(2)=2$ +\item $\ilog(3)=2$ +\item $\ilog(4)=3$ +\item $\ilog(7)=3$ +\end{itemize} +\end{verse} + +\item[$\min(a,b)$] +The minimum of two numbers $a$ and $b$. + +\item[$\max(a,b)$] +The maximum of two numbers $a$ and $b$. + +\end{description} +\cleardoublepage + + +\thispagestyle{plain} +\markboth{{\sc Key words}}{{\sc Key words}} +\chapter*{Key words} + +%We can't rewrite this, because this is text required by RFC 2119, so we use +% some emergency stretching to get it typeset properly. +\setlength{\emergencystretch}{2em} +The key words ``MUST'', ``MUST NOT'', ``REQUIRED'', ``SHALL'', ``SHALL NOT'', + ``SHOULD'', ``SHOULD NOT'', ``RECOMMENDED'', ``MAY'', and ``OPTIONAL'' in this + document are to be intrepreted as described in RFC 2119 \cite{rfc2119}.\par +\setlength{\emergencystretch}{0em} + +Where such assertions are placed on the contents of a Theora bitstream itself, + implementations should be prepared to encounter bitstreams that do not follow + these requirements. +An application's behavior in the presecence of such non-conforming bitstreams + is not defined by this specification, but any reasonable method of handling + them MAY be used. +By way of example, applications MAY discard the current frame, retain the + current output thus far, or attempt to continue on by assuming some default + values for the erroneous bits. +When such an error occurs in the bitstream headers, an application MAY refuse + to decode the entire stream. +An application SHOULD NOT allow such non-conformant bitstreams to overflow + buffers and potentially execute arbitrary code, as this represents a serious + security risk. + +An application MUST, however, ensure any bits marked as reserved have the value + zero, and refuse to decode the stream if they do not. +These are used as place holders for future bitstream features with which the + current bitstream is forward-compatible. +Such features may not increment the bitstream version number, and can only be + recognized by checking the value of these reserved bits. + +\cleardoublepage + + + +\mainmatter + +\pagenumbering{arabic} +\setcounter{page}{1} + +\chapter{Introduction} + +Theora is a general purpose, lossy video codec. +It is based on the VP3 video codec produced by On2 Technologies + (\url{http://www.on2.com/}). +On2 donated the VP3.1 source code to the Xiph.Org Foundation and released it + under a BSD-like license. +On2 also made an irrevocable, royalty-free license grant for any patent claims + it might have over the software and any derivatives. +No formal specification exists for the VP3 format beyond this source code, + however Mike Melanson maintains a detailed description \cite{Mel04}. +Portions of this specification were adopted from that text with permission. + +\section{VP3 and Theora} + +Theora contains a superset of the features that were available in the original + VP3 codec. +Content encoded with VP3.1 can be losslessly transcoded into the Theora format. +Theora content cannot, in general, be losslessly transcoded into the VP3 + format. +If a feature is not available in the original VP3 format, this is mentioned + when that feature is defined. +A complete list of these features appears in Appendix~\ref{app:vp3-compat}. +%TODO: VP3 - theora comparison in appendix + +\section{Video Formats} + +Theora currently supports progressive video data of arbitrary dimensions at a + constant frame rate in one of several $Y'C_bC_r$ color spaces. +The precise definition the supported color spaces appears in + Section~\ref{sec:colorspaces}. +Three different chroma subsampling formats are supported: 4:2:0, 4:2:2, + and 4:4:4. +The precise details of each of these formats and their sampling locations are + described in Section~\ref{sec:pixfmts}. + +The Theora format does not support interlaced material, variable frame rates, + bit-depths larger than 8 bits per component, nor alternate color spaces such + as RGB or arbitrary multi-channel spaces. +Black and white content can be efficiently encoded, however, because the + uniform chroma planes compress well. +Support for interlaced material is planned for a future version. +\begin{verse} +{\bf Note:} Infrequently changing frame rates---as when film and video + sequences are cut together---can be supported in the Ogg container format by + chaining several Theora streams together. +\end{verse} +Support for increased bit depths or additional color spaces is not planned. + +\section{Classification} + +Theora is a block-based lossy transform codec that utilizes an + $8\times 8$ Type-II Discrete Cosine Transform and block-based motion + compensation. +This places it in the same class of codecs as MPEG-1, -2, -4, and H.263. +The details of how individual blocks are organized and how DCT coefficients are + stored in the bitstream differ substantially from these codecs, however. +Theora supports only intra frames (I frames in MPEG) and inter frames (P frames + in MPEG). +There is no equivalent to the bi-predictive frames (B frames) found in MPEG + codecs. + +\section{Assumptions} + +The Theora codec design assumes a complex, psychovisually-aware encoder and a + simple, low-complexity decoder. +%TODO: Talk more about implementation complexity. + +Theora provides none of its own framing, synchronization, or protection against + transmission errors. +An encoder is solely a method of accepting input video frames and + compressing these frames into raw, unformatted `packets'. +The decoder then accepts these raw packets in sequence, decodes them, and + synthesizes a fascimile of the original video frames. +Theora is a free-form variable bit rate (VBR) codec, and packets have no + minimum size, maximum size, or fixed/expected size. + +Theora packets are thus intended to be used with a transport mechanism that + provides free-form framing, synchronization, positioning, and error correction + in accordance with these design assumptions, such as Ogg (for file transport) + or RTP (for network multicast). +For the purposes of a few examples in this document, we will assume that Theora + is embedded in an Ogg stream specifically, although this is by no means a + requirement or fundamental assumption in the Theora design. + +The specification for embedding Theora into an Ogg transport stream is given in + Appendix~\ref{app:oggencapsulation}. + +\section{Codec Setup and Probability Model} + +Theora's heritage is the proprietary commerical codec VP3, and it retains a + fair amount of inflexibility when compared to Vorbis \cite{vorbis}, the first + Xiph.Org codec, which began as a research codec. +However, to provide additional scope for encoder improvement, Theora adopts + some of the configurable aspects of decoder setup that are present in Vorbis. +This configuration data is not available in VP3, which uses hardcoded values + instead. + +Theora makes the same controversial design decision that Vorbis made to include + the entire probability model for the DCT coefficients and all the quantization + parameters in the bitstream headers. +This is often several hundred fields. +It is therefore impossible to decode any frame in the stream without + having previously fetched the codec info and codec setup headers. + +\begin{verse} +{\bf Note:} Theora {\em can} initiate decode at an arbitrary intra-frame packet + within a bitstream so long as the codec has been initialized with the setup + headers. +\end{verse} + +Thus, Theora headers are both required for decode to begin and relatively large + as bitstream headers go. +The header size is unbounded, although as a rule-of-thumb less than 16kB is + recommended, and Xiph.Org's reference encoder follows this suggestion. +%TODO: Is 8kB enough? My setup header is 7.4kB, that doesn't leave much room +% for comments. +%RG: the lesson from vorbis is that as small as possible is really +% important in some applications. Practically, what's acceptable +% depends a great deal on the target bitrate. I'd leave 16 kB in the +% spec for now. fwiw more than 1k of comments is quite unusual. + +Our own design work indicates that the primary liability of the required header + is in mindshare; it is an unusual design and thus causes some amount of + complaint among engineers as this runs against current design trends and + points out limitations in some existing software/interface designs. +However, we find that it does not fundamentally limit Theora's suitable + application space. + +%silvia: renamed +%\subsection{Format Specification} +\section{Format Conformance} + +The Theora format is well-defined by its decode specification; any encoder that + produces packets that are correctly decoded by an implementation following + this specification may be considered a proper Theora encoder. +A decoder must faithfully and completely implement the specification defined + herein %, except where noted, + to be considered a conformant Theora decoder. +A decoder need not be implemented strictly as described, but the + actual decoder process MUST be {\em entirely mathematically equivalent} + to the described process. +Where appropriate, a non-normative description of encoder processes is + included. +These sections will be marked as such, and a proper Theora encoder is not + bound to follow them. + +%TODO: \subsection{Hardware Profile} + + +\chapter{Coded Video Structure} + +Theora's encoding and decoding process is based on $8\times 8$ blocks of + pixels. +This sections describes how a video frame is laid out, divided into + blocks, and how those blocks are organized. + +\section{Frame Layout} + +A video frame in Theora is a two-dimensional array of pixels. +Theora, like VP3, uses a right-handed coordinate system, with the origin in the + lower-left corner of the frame. +This is contrary to many video formats which use a left-handed coordinate + system with the origin in the upper-left corner of the frame. +%INT: This means that for interlaced material, the definition of `even fields' +%INT: and `odd fields' may be reversed between Theora and other video codecs. +%INT: This document will always refer to them as `top fields' and `bottom +%INT: fields'. + +Theora divides the pixel array up into three separate \term{color planes}, one + for each of the $Y'$, $C_b$, and $C_r$ components of the pixel. +The $Y'$ plane is also called the \term{luma plane}, and the $C_b$ and $C_r$ + planes are also called the \term{chroma planes}. +Each plane is assigned a numerical value, as shown in + Table~\ref{tab:color-planes}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{cl}\toprule +Index & Color Plane \\\midrule +$0$ & $Y'$ \\ +$1$ & $C_b$ \\ +$2$ & $C_r$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Color Plane Indices} +\label{tab:color-planes} +\end{table} + +In some pixel formats, the chroma planes are subsampled by a factor of two + in one or both directions. +This means that the width or height of the chroma planes may be half that of + the total frame width and height. +The luma plane is never subsampled. + +\section{Picture Region} + +An encoded video frame in Theora is required to have a width and height that + are multiples of sixteen, making an integral number of blocks even when the + chroma planes are subsampled. +However, inside a frame a smaller \term{picture region} may be defined + to present material whose dimensions are not a multiple of sixteen pixels, as + shown in Figure~\ref{fig:pic-frame}. +The picture region can be offset from the lower-left corner of the frame by up + to 255 pixels in each direction, and may have an arbitrary width and height, + provided that it is contained entirely within the coded frame. +It is this picture region that contains the actual video data. +The portions of the frame which lie outside the picture region may contain + arbitrary image data, so the frame must be cropped to the picture region + before display. +The picture region plays no other role in the decode process, which operates on + the entire video frame. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{pic-frame} +\end{center} +\caption{Location of frame and picture regions} +\label{fig:pic-frame} +\end{figure} + +\section{Blocks and Super Blocks} +\label{sec:blocks-and-sbs} + +Each color plane is subdivided into \term{blocks} of $8\times 8$ pixels. +Blocks are grouped into $4\times 4$ arrays called \term{super blocks} as + shown in Figure~\ref{fig:superblock}. +Each color plane has its own set of blocks and super blocks. +If the chroma planes are subsampled, they are still divided into $8\times 8$ + blocks of pixels; there are just fewer blocks than in the luma plane. +The boundaries of blocks and super blocks in the luma plane do not necessarily + coincide with those of the chroma planes, if the chroma planes have been + subsampled. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{superblock} +\end{center} +\caption{Subdivision of a frame into blocks and super blocks} +\label{fig:superblock} +\end{figure} + +Blocks are accessed in two different orders in the various decoder processes. +The first is \term{raster order}, illustrated in Figure~\ref{fig:raster-block}. +This accesses each block in row-major order, starting in the lower left of the + frame and continuing along the bottom row of the entire frame, followed by the + next row up, starting on the left edge of the frame, etc. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{raster-block} +\end{center} +\caption{Raster ordering of $n\times m$ blocks} +\label{fig:raster-block} +\end{figure} + +The second is \term{coded order}. +In coded order, blocks are accessed by super block. +Within each frame, super blocks are traversed in raster order, + similar to raster order for blocks. +Within each super block, however, blocks are accessed in a Hilbert curve + pattern, illustrated in Figure~\ref{fig:hilbert-block}. +If a color plane does not contain a complete super block on the top or right + sides, the same ordering is still used, simply with any blocks outside the + frame boundary ommitted. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{hilbert-block} +\end{center} +\caption{Hilbert curve ordering of blocks within a super block} +\label{fig:hilbert-block} +\end{figure} + +To illustrate this ordering, consider a frame that is 240 pixels wide and + 48 pixels high. +Each row of the luma plane has 30 blocks and 8 super blocks, and there are 6 + rows of blocks and two rows of super blocks. + +%When accessed in raster order, each block in the luma plane is assigned the +% following indices: + +%\vspace{\baselineskip} +%\begin{center} +%\begin{tabular}{|ccccccc|}\hline +%150 & 151 & 152 & 153 & $\ldots$ & 178 & 179 \\ +%120 & 121 & 122 & 123 & $\ldots$ & 148 & 149 \\\hline +% 90 & 91 & 92 & 93 & $\ldots$ & 118 & 119 \\ +% 60 & 61 & 62 & 63 & $\ldots$ & 88 & 89 \\ +% 30 & 31 & 32 & 33 & $\ldots$ & 58 & 59 \\ +% 0 & 1 & 2 & 3 & $\ldots$ & 28 & 29 \\\hline +%\end{tabular} +%\end{center} +%\vspace{\baselineskip} + +When accessed in coded order, each block in the luma plane is assigned the + following indices: + +\vspace{\baselineskip} +\begin{center} +\begin{tabular}{|cccc|c|cc|}\hline +123 & 122 & 125 & 124 & $\ldots$ & 179 & 178 \\ +120 & 121 & 126 & 127 & $\ldots$ & 176 & 177 \\\hline + 5 & 6 & 9 & 10 & $\ldots$ & 117 & 118 \\ + 4 & 7 & 8 & 11 & $\ldots$ & 116 & 119 \\ + 3 & 2 & 13 & 12 & $\ldots$ & 115 & 114 \\ + 0 & 1 & 14 & 15 & $\ldots$ & 112 & 113 \\\hline +\end{tabular} +\end{center} +\vspace{\baselineskip} + +Here the index values specify the order in which the blocks would be accessed. +The indices of the blocks are numbered continuously from one color plane to the + next. +They do not reset to zero at the start of each plane. +Instead, the numbering increases continuously from the $Y'$ plane to the $C_b$ + plane to the $C_r$ plane. +The implication is that the blocks from all planes are treated as a unit during + the various processing steps. + +Although blocks are sometimes accessed in raster order, in this document the + index associated with a block is {\em always} its index in coded order. + +\section{Macro Blocks} +\label{sec:mbs} + +A macro block contains a $2\times 2$ array of blocks in the luma plane + {\em and} the co-located blocks in the chroma planes, as shown in + Figure~\ref{fig:macroblock}. +Thus macro blocks can represent anywhere from six to twelve blocks, depending + on how the chroma planes are subsampled. +This is in contrast to super blocks, which only contain blocks from a single + color plane. +% the whole super vs. macro blocks thing is a little confusing, and it can be +% hard to remember which is what initially. A figure would/will help here, +% but I tried to add some text emphasizing the difference in terms of +% functionality. +%TBT: At this point we haven't described any functionality yet. +%TBT: As far as the reader knows, the only purpose of the blocks, macro blocks +%TBT: and super blocks is for data organization---and for blocks and super +%TBT: blocks, this is essentially true. +%TBT: So lets restrict the differences we emphasize to those of data +%TBT: organization, which the sentence I just added above does. +Macro blocks contain information about coding mode and motion vectors for the + corresponding blocks in all color planes. + +\begin{figure}[htbp] + \begin{center} + \includegraphics{macroblock} + \end{center} + \caption{Subdivision of a frame into macro blocks} + \label{fig:macroblock} +\end{figure} + +Macro blocks are also accessed in a \term{coded order}. +This coded order proceeds by examining each super block in the luma plane in + raster order, and traversing the four macro blocks inside using a smaller + Hilbert curve, as shown in Figure~\ref{fig:hilbert-mb}. +%r: I rearranged the wording to make a more formal idiom here +If the luma plane does not contain a complete super block on the top or right + sides, the same ordering is still used, with any macro blocks outside + the frame boundary simply omitted. +Because the frame size is constrained to be a multiple of 16, there are never + any partial macro blocks. +Unlike blocks, macro blocks need never be accessed in a pure raster order. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{hilbert-mb} +\end{center} +\caption{Hilbert curve ordering of macro blocks within a super block} +\label{fig:hilbert-mb} +\end{figure} + +Using the same frame size as the example above, there are 15 macro blocks in + each row and 3 rows of macro blocks. +The macro blocks are assigned the following indices: + +\vspace{\baselineskip} +\begin{center} +\begin{tabular}{|cc|cc|c|cc|c|}\hline +30 & 31 & 32 & 33 & $\cdots$ & 42 & 43 & 44 \\\hline + 1 & 2 & 5 & 6 & $\cdots$ & 25 & 26 & 29 \\ + 0 & 3 & 4 & 7 & $\cdots$ & 24 & 27 & 28 \\\hline +\end{tabular} +\end{center} +\vspace{\baselineskip} + +\section{Coding Modes and Prediction} + +Each block is coded using one of a small, fixed set of \term{coding modes} that + define how the block is predicted from previous frames. +A block is predicted using one of two \term{reference frames}, selected + according to the coding mode. +A reference frame is the fully decoded version of a previous frame in the + stream. +The first available reference frame is the previous intra frame, called the + \term{golden frame}. +The second available reference frame is the previous frame, whether it was an + intra frame or an inter frame. +If the previous frame was an intra frame, then both reference frames are the + same. +See Figure~\ref{fig:reference-frames} for an illustration of the reference + frames used for an intra frame that does not follow an intra frame. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{reference-frames} +\end{center} +\caption{Example of reference frames for an inter frame} +\label{fig:reference-frames} +\end{figure} + +Two coding modes in particular are worth mentioning here. +The INTRA mode is used for blocks that are not predicted from either reference + frame. +This is the only coding mode allowed in intra frames. +The INTER\_NOMV coding mode uses the co-located contents of the block in the + previous frame as the predictor. +This is the default coding mode. + +\section{DCT Coefficients} +\label{sec:dct-coeffs} + +A \term{residual} is added to the predicted contents of a block to form the + final reconstruction. +The residual is stored as a set of quantized coefficients from an integer + approximation of a two-dimensional Type II Discrete Cosine Transform. +The DCT takes an $8\times 8$ array of pixel values as input and returns an + $8\times 8$ array of coefficient values. +The \term{natural ordering} of these coefficients is defined to be row-major + order, from lowest to highest frequency. +They are also often indexed in \term{zig-zag order}, as shown in + Figure~\ref{tab:zig-zag}. + +\begin{figure}[htbp] +\begin{center} +\begin{tabular}[c]{rr|c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c@{}c} + &\multicolumn{1}{r}{} & && &&&&&$c$&&& && && \\ + &\multicolumn{1}{r}{} &0&&1&&2&&3&&4&&5&&6&&7 \\\cline{3-17} + &0 & 0 &$\rightarrow$& 1 && 5 &$\rightarrow$& 6 && 14 &$\rightarrow$& 15 && 27 &$\rightarrow$& 28 \\[-0.5\defaultaddspace] + & & &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$& \\ + &1 & 2 & & 4 && 7 & & 13 && 16 & & 26 && 29 & & 42 \\[-0.5\defaultaddspace] + & &$\downarrow$&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&$\downarrow$ \\ + &2 & 3 & & 8 && 12 & & 17 && 25 & & 30 && 41 & & 43 \\[-0.5\defaultaddspace] + & & &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$& \\ + &3 & 9 & & 11 && 18 & & 24 && 31 & & 40 && 44 & & 53 \\[-0.5\defaultaddspace] +$r$&&$\downarrow$&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&$\downarrow$ \\ + &4 & 10 & & 19 && 23 & & 32 && 39 & & 45 && 52 & & 54 \\[-0.5\defaultaddspace] + & & &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$& \\ + &5 & 20 & & 22 && 33 & & 38 && 46 & & 51 && 55 & & 60 \\[-0.5\defaultaddspace] + & &$\downarrow$&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&&$\swarrow$&&$\nearrow$&$\downarrow$ \\ + &6 & 21 & & 34 && 37 & & 47 && 50 & & 56 && 59 & & 61 \\[-0.5\defaultaddspace] + & & &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$&&$\nearrow$& &$\swarrow$& \\ + &7 & 35 &$\rightarrow$& 36 && 48 &$\rightarrow$& 49 && 57 &$\rightarrow$& 58 && 62 &$\rightarrow$& 63 +\end{tabular} +\end{center} +\caption{Zig-zag order} +\label{tab:zig-zag} +\end{figure} + +\begin{verse} +{\bf Note:} the row and column indices refer to {\em frequency number} and not + pixel locations. +The frequency numbers are defined independently of the memory organization of + the pixels. +They have been written from top to bottom here to follow conventional notation, + despite the right-handed coordinate system Theora uses for pixel locations. +%RG: I'd rather we were internally consistent and put dc at the lower left. +Many implementations of the DCT operate `in-place'. +That is, they return DCT coefficients in the same memory buffer that the + initial pixel values were stored in. +Due to the right-handed coordinate system used for pixel locations in Theora, + one must note carefully how both pixel values and DCT coefficients are + organized in memory in such a system. +\end{verse} + +DCT coefficient $(0,0)$ is called the \term{DC coefficient}. +All the other coefficients are called \term{AC coefficients}. + + +\chapter{Decoding Overview} + +This section provides a high level description of the Theora codec's + construction. +A bit-by-bit specification appears beginning in Section~\ref{sec:bitpacking}. +The later sections assume a high-level understanding of the Theora decode + process, which is provided below. + +\section{Decoder Configuration} + +Decoder setup consists of configuration of the quantization matrices and the + Huffman codebooks for the DCT coefficients, and a table of limit values for + the deblocking filter. +The remainder of the decoding pipeline is not configurable. + +\subsection{Global Configuration} + +The global codec configuration consists of a few video related fields, such as + frame rate, frame size, picture size and offset, aspect ratio, color space, + pixel format, and a version number. +The version number is divided into a major version, a minor version, amd a + minor revision number. +%r: afaik the released vp3 codec called itself 3.1 and is compatible w/ theora +%r: even though we received the in-progress 3.2 codebase +For the format defined in this specification, these are `3', `2', and + `1', respectively, in reference to Theora's origin as a successor to + the VP3.1 format. + +\subsection{Quantization Matrices} + +Theora allows up to 384 different quantization matrices to be defined, one for + each \term{quantization type}, \term{color plane} ($Y'$, $C_b$, or $C_r$), and + \term{quantization index}, \qi, which ranges from zero to 63, inclusive. +There are currently two quantization types defined, which depend on the coding + mode of the block being dequantized, as shown in Table~\ref{tab:quant-types}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{cl}\toprule +Quantization Type & Usage \\\midrule +$0$ & INTRA-mode blocks \\ +$1$ & Blocks in any other mode. \\ +\bottomrule\end{tabular} +\end{center} +\caption{Quantization Type Indices} +\label{tab:quant-types} +\end{table} + +%r: I think 'nominally' is more specific than 'generally' here +The quantization index, on the other hand, nominally represents a progressive + range of quality levels, from low quality near zero to high quality near 63. +However, the interpretation is arbitrary, and it is possible, for example, to + partition the scale into two completely separate ranges with 32 levels each + that are meant to represent different classes of source material, or any + other arrangement that suits the encoder's requirements. + +Each quantization matrix is an $8\times 8$ matrix of 16-bit values, which is + used to quantize the output of the $8\times 8$ DCT\@. +Quantization matrices are specified using three components: a + \term{base matrix} and two \term{scale values}. +The first scale value is the \term{DC scale}, which is applied to the DC + component of the base matrix. +The second scale value is the \term{AC scale}, which is applied to all the + other components of the base matrix. +There are 64 DC scale values and 64 AC scale values, one for each \qi\ value. + +There are 64 elements in each base matrix, one for each DCT coefficient. +They are stored in natural order (cf. Section~\ref{sec:dct-coeffs}). +There is a separate set of base matrices for each quantization type and each + color plane, with up to 64 possible base matrices in each set, one for each + \qi\ value. +%r: we will mention that the given matricies must bound the \qi range +%r: in the detailed section. it's not important at this level. +Typically the bitstream contains matrices for only a sparse subset of the + possible \qi\ values. +The base matrices for the remainder of the \qi\ values are computed using + linear interpolation. +This configuration allows the encoder to adjust the quantization matrices to + approximate the complex, non-linear response of the human visual system to + different quantization errors. + +Finally, because the in-loop deblocking filter strength depends on the strength + of the quantization matrices defined in this header, a table of 64 \term{loop + filter limit values} is defined, one for each \qi\ value. + +The precise specification of how all of this information is decoded appears in + Section~\ref{sub:loop-filter-limits} and Section~\ref{sub:quant-params}. + +\subsection{Huffman Codebooks} + +Theora uses 80 configurable binary Huffman codes to represent the 32 tokens + used to encode DCT coefficients. +Each of the 32 token values has a different semantic meaning and is used to + represent single coefficient values, zero runs, combinations of the two, and + \term{End-Of-Block markers}. + +The 80 codes are divided up into five groups of 16, with each group + corresponding to a set of DCT coefficient indices. +The first group corresponds to the DC coefficient, while the remaining four + groups correspond to different subsets of the AC coefficients. +Within each frame, two pairs of 4-bit codebook indices are stored. +The first pair selects which codebooks to use from the DC coefficient group for + the $Y'$ coefficients and the $C_b$ and $C_r$ coefficients. +The second pair selects which codebooks to use from {\em all four} of the AC + coefficient groups for the $Y'$ coefficients and the $C_b$ and $C_r$ + coefficients. + +The precise specification of how the codebooks are decoded appears in + Section~\ref{sub:huffman-tables}. + +\section{High-Level Decode Process} + +\subsection{Decoder Setup} + +Before decoding can begin, a decoder MUST be initialized using the bitstream + headers corresponding to the stream to be decoded. +Theora uses three header packets; all are required, in order, by this + specification. +Once set up, decode may begin at any intra-frame packet---or even inter-frame + packets, provided the appropriate decoded reference frames have already been + decoded and cached---belonging to the Theora stream. +In Theora I, all packets after the three initial headers are intra-frame or + inter-frame packets. + +The header packets are, in order, the identification header, the comment + header, and the setup header. + +\paragraph{Identification Header} + +The identification header identifies the stream as Theora, provides a version + number, and defines the characteristics of the video stream such as frame + size. +A complete description of the identification header appears in + Section~\ref{sec:idheader}. + +\paragraph{Comment Header} + +The comment header includes user text comments (`tags') and a vendor string + for the application/library that produced the stream. +The format of the comment header is the same as that used in the Vorbis I and + Speex codecs, with slight modifications due to the use of a different bit + packing mechanism. +A complete description of how the comment header is coded appears in + Section~\ref{sec:commentheader}, along with a suggested set of tags. + +\paragraph{Setup Header} + +The setup header includes extensive codec setup information, including the + complete set of quantization matrices and Huffman codebooks needed to decode + the DCT coefficients. +A complete description of the setup header appears in + Section~\ref{sec:setupheader}. + +\subsection{Decode Procedure} + +The decoding and synthesis procedure for all video packets is fundamentally the + same, with some steps omitted for intra frames. +\begin{itemize} +\item +Decode packet type flag. +\item +Decode frame header. +\item +Decode coded block information (inter frames only). +\item +Decode macro block mode information (inter frames only). +\item +Decode motion vectors (inter frames only). +\item +Decode block-level \qi\ information. +\item +Decode DC coefficient for each coded block. +\item +Decode 1st AC coefficient for each coded block. +\item +Decode 2nd AC coefficient for each coded block. +\item +$\ldots$ +\item +Decode 63rd AC coefficient for each coded block. +\item Perform DC coefficient prediction. +\item Reconstruct coded blocks. +\item Copy uncoded bocks. +\item Perform loop filtering. +\end{itemize} + +\begin{verse} +{\bf Note:} clever rearrangement of the steps in this process is possible. +As an example, in a memory-constrained environment, one can make multiple + passes through the DCT coefficients to avoid buffering them all in memory. +On the first pass, the starting location of each coefficient is identified, and + then 64 separate get pointers are used to read in the 64 DCT coefficients + required to reconstruct each coded block in sequence. +This operation produces entirely equivalent output and is naturally perfectly + legal. +It may even be a benefit in non-memory-constrained environments due to a + reduced cache footprint. +\end{verse} + +Theora makes equivalence easy to check by defining all decoding operations in + terms of exact integer operations. +No floating-point math is required, and in particular, the implementation of + the iDCT transform MUST be followed precisely. +This prevents the decoder mismatch problem commonly associated with codecs that + provide a less rigorous transform specification. +Such a mismatch problem would be devastating to Theora, since a single rounding + error in one frame could propagate throughout the entire succeeding frame due + to DC prediction. + +\paragraph{Packet Type Decode} + +Theora uses four packet types. +The first three packet types mark each of the three Theora headers described + above. +The fourth packet type marks a video packet. +All other packet types are reserved; packets marked with a reserved type should + be ignored. + +Additionally, zero-length packets are treated as if they were an inter +frame with no blocks coded. That is, as a duplicate frame. + +\paragraph{Frame Header Decode} + +The frame header contains some global information about the current frame. +The first is the frame type field, which specifies if this is an intra frame or + an inter frame. +Inter frames predict their contents from previously decoded reference frames. +Intra frames can be independently decoded with no established reference frames. + +The next piece of information in the frame header is the list of \qi\ values + allowed in the frame. +Theora allows from one to three different \qi\ values to be used in a single + frame, each of which selects a set of six quantization matrices, one for each + quantization type (inter or intra), and one for each color plane. +The first \qi\ value is {\em always} used when dequantizing DC coefficients. +The \qi\ value used when dequantizing AC coefficients, however, can vary from + block to block. +VP3, in contrast, only allows a single \qi\ value per frame for both the DC and + AC coefficients. + +\paragraph{Coded Block Information} + +This stage determines which blocks in the frame are coded and which are + uncoded. +A \term{coded block list} is constructed which lists all the coded blocks in + coded order. +For intra frames, every block is coded, and so no data needs to be read from + the packet. + +\paragraph{Macro Block Mode Information} + +For intra frames, every block is coded in INTRA mode, and this stage is + skipped. +In inter frames a \term{coded macro block list} is constructed from the coded + block list. +Any macro block which has at least one of its luma blocks coded is considered + coded; all other macro blocks are uncoded, even if they contain coded chroma + blocks. +A coding mode is decoded for each coded macro block, and assigned to all its + constituent coded blocks. +All coded chroma blocks in uncoded macro blocks are assigned the INTER\_NOMV + coding mode. + +\paragraph{Motion Vectors} + +Intra frames are coded entirely in INTRA mode, and so this stage is skipped. +Some inter coding modes, however, require one or more motion vectors to be + specified for each macro block. +These are decoded in this stage, and an appropriate motion vector is assigned + to each coded block in the macro block. + +\paragraph{Block-Level \qi\ Information} + +If a frame allows multiple \qi\ values, the \qi\ value assigned to each block + is decoded here. +Frames that use only a single \qi\ value have nothing to decode. + +\paragraph{DCT Coefficients} + +Finally, the quantized DCT coefficients are decoded. +A list of DCT coefficients in zig-zag order for a single block is represented + by a list of tokens. +A token can take on one of 32 different values, each with a different semantic + meaning. +A single token can represent a single DCT coefficient, a run of zero + coefficients within a single block, a combination of a run of zero + coefficients followed by a single non-zero coefficient, an + \term{End-Of-Block marker}, or a run of EOB markers. +EOB markers signify that the remainder of the block is one long zero run. +Unlike JPEG and MPEG, there is no requirement for each block to end with + a special marker. +If non-EOB tokens yield values for all 64 of the coefficients in a block, then + no EOB marker occurs. + +Each token is associated with a specific \term{token index} in a block. +For single-coefficient tokens, this index is the zig-zag index of the token in + the block. +For zero-run tokens, this index is the zig-zag index of the {\em first} + coefficient in the run. +For combination tokens, the index is again the zig-zag index of the first + coefficient in the zero run. +For EOB markers, which signify that the remainder of the block is one long zero + run, the index is the zig-zag index of the first zero coefficient in that run. +For EOB runs, the token index is that of the first EOB marker in the run. +Due to zero runs and EOB markers, a block does not have to have a token for + every zig-zag index. + +Tokens are grouped in the stream by token index, not by the block they + originate from. +This means that for each zig-zag index in turn, the tokens with that index from + {\em all} the coded blocks are coded in coded block order. +When decoding, a current token index is maintained for each coded block. +This index is advanced by the number of coefficients that are added to the + block as each token is decoded. +After fully decoding all the tokens with token index \ti, the current token + index of every coded block will be \ti\ or greater. + +If an EOB run of $n$ blocks is decoded at token index \ti, then it ends the + next $n$ blocks in coded block order whose current token index is equal to + \ti, but not greater. +If there are fewer than $n$ blocks with a current token index of \ti, then the + decoder goes through the coded block list again from the start, ending blocks + with a current token index of $\ti+1$, and so on, until $n$ blocks have been + ended. + +Tokens are read by parsing a Huffman code that depends on \ti\ and the color + plane of the next coded block whose current token index is equal to \ti, but + not greater. +The Huffman codebooks are selected on a per-frame basis from the 80 codebooks + defined in the setup header. +Many tokens have a fixed number of \term{extra bits} associated with them. +These bits are read from the packet immediately after the token is decoded. +These are used to define things such as coefficient magnitude, sign, and the + length of runs. + +\paragraph{DC Prediction} + +After the coefficients for each block are decoded, the quantized DC value of + each block is adjusted based on the DC values of its neighbors. +This adjustment is performed by scanning the blocks in raster order, not coded + block order. + +\paragraph{Reconstruction} + +Finally, using the coding mode, motion vector (if applicable), quantized + coefficient list, and \qi\ value defined for each block, all the coded blocks + are reconstructed. +The DCT coefficients are dequantized, an inverse DCT transform is applied, and + the predictor is formed from the coding mode and motion vector and added to + the result. + +\paragraph{Loop Filtering} + +To complete the reconstructed frame, an ``in-loop'' deblocking filter is + applied to the edges of all coded blocks. + + +\chapter{Video Formats} + +This section gives a precise description of the video formats that Theora is + capable of storing. +The Theora bitstream is capable of handling video at any arbitrary resolution + up to $1048560\times 1048560$. +Such video would require almost three terabytes of storage per frame for + uncompressed data, so compliant decoders MAY refuse to decode images with + sizes beyond their capabilities. +%TODO: What MUST a "compliant" decoder accept? +%TODO: What SHOULD a decoder use for an upper bound? (derive from total amount +%TODO: of memory and memory bandwidth) +%TODO: Any lower limits? +%TODO: We really need hardware device profiles, but such things should be +%TODO: developed with input from the hardware community. +%TODO: And even then sometimes they're useless + +The remainder of this section talks about two specific aspects of the video + format: the color space and the pixel format. +The first describes how color is represented and how to transform that color + representation into a device independent color space such as CIE $XYZ$ (1931). +The second describes the various schemes for sampling the color values in time + and space. + +\section{Color Space Conventions} + +There are a large number of different color standards used in digital video. +Since Theora is a lossy codec, it restricts itself to only a few of them to + simplify playback. +Unlike the alternate method of describing all the parameters of the color + model, this allows a few dedicated routines for color conversion to be written + and heavily optimized in a decoder. +More flexible conversion functions should instead be specified in an encoder, + where additional computational complexity is more easily tolerated. +The color spaces were selected to give a fair representation of color standards + in use around the world today. +Most of the standards that do not exactly match one of these can be converted + to one fairly easily. + +All Theora color spaces are $Y'C_bC_r$ color spaces with one luma channel and + two chroma channels. +Each channel contains 8-bit discrete values in the range $0\ldots255$, which + represent non-linear gamma pre-corrected signals. +The Theora identification header contains an 8-bit value that describes the + color space. +This merely selects one of the color spaces available from an enumerated list. +Currently, only two color spaces are defined, with a third possibility that + indicates the color space is ``unknown". + +\section{Color Space Conversions and Parameters} +\label{sec:color-xforms} + +The parameters which describe the conversions between each color space are + listed below. +These are the parameters needed to map colors from the encoded $Y'C_bC_r$ + representation to the device-independent color space CIE $XYZ$ (1931). +These parameters define abstract mathematical conversion functions which are + infinitely precise. +The accuracy and precision with which the conversions are performed in a real + system is determined by the quality of output desired and the available + processing power. +Exact decoder output is defined by this specification only in the original + $Y'C_bC_r$ space. + +\begin{description} +\item[$Y'C_bC_r$ to $Y'P_bP_r$:] +\vspace{\baselineskip}\hfill + +This conversion takes 8-bit discrete values in the range $[0\ldots255]$ and + maps them to real values in the range $[0\ldots1]$ for Y and + $[-\frac{1}{2}\ldots\frac{1}{2}]$ for $P_b$ and $P_r$. +Because some values may fall outside the offset and excursion defined for each + channel in the $Y'C_bC_r$ space, the results may fall outside these ranges in + $Y'P_bP_r$ space. +No clamping should be done at this stage. + +\begin{align} +Y'_\mathrm{out} & = + \frac{Y'_\mathrm{in}-\mathrm{Offset}_Y}{\mathrm{Excursion}_Y} \\ +P_b & = + \frac{C_b-\mathrm{Offset}_{C_b}}{\mathrm{Excursion}_{C_b}} \\ +P_r & = + \frac{C_r-\mathrm{Offset}_{C_r}}{\mathrm{Excursion}_{C_r}} +\end{align} + +Parameters: $\mathrm{Offset}_{Y,C_b,C_r}$, $\mathrm{Excursion}_{Y,C_b,C_r}$. + +\item[$Y'P_bP_r$ to $R'G'B'$:] +\vspace{\baselineskip}\hfill + +This conversion takes the one luma and two chroma channel representation and + maps it to the non-linear $R'G'B'$ space used to drive actual output devices. +Values should be clamped into the range $[0\ldots1]$ after this stage. + +\begin{align} +R' & = Y'+2(1-K_r)P_r \\ +G' & = Y'-2\frac{(1-K_b)K_b}{1-K_b-K_r}P_b-2\frac{(1-K_r)K_r}{1-K_b-K_r}P_r\\ +B' & = Y'+2(1-K_b)P_b +\end{align} + +Parameters: $K_b,K_r$. + +\item[$R'G'B'$ to $RGB$ (Output device gamma correction):] +\vspace{\baselineskip}\hfill + +This conversion takes the non-linear $R'G'B'$ voltage levels and maps them to + linear light levels produced by the actual output device. +Note that this conversion is only that of the output device, and its inverse is + {\em not} that used by the input device. +Because a dim viewing environment is assumed in most television standards, the + overall gamma between the input and output devices is usually around $1.1$ to + $1.2$, and not a strict $1.0$. + +For calibration with actual output devices, the model +\begin{align} +L & =(E'+\Delta)^\gamma +\end{align} + should be used, with $\Delta$ the free parameter and $\gamma$ held fixed to + the value specified in this document. +The conversion function presented here is an idealized version with $\Delta=0$. + +\begin{align} +R & = R'^\gamma \\ +G & = G'^\gamma \\ +B & = B'^\gamma +\end{align} + +Parameters: $\gamma$. + +\item[$RGB$ to $R'G'B'$ (Input device gamma correction):] +\vspace{\baselineskip}\hfill + +%TODO: Tag section as non-normative + +This conversion takes linear light levels and maps them to the non-linear + voltage levels produced in the actual input device. +This information is merely informative. +It is not required for building a decoder or for converting between the various + formats and the actual output capabilities of a particular device. + +A linear segment is introduced on the low end to reduce noise in dark areas of + the image. +The rest of the scale is adjusted so that the power segment of the curve + intersects the linear segment with the proper slope, and so that it still maps + 0 to 0 and 1 to 1. + +\begin{align} +R' & = \left\{ +\begin{array}{ll} +\alpha R, & 0\le R<\delta \\ +(1+\epsilon)R^\beta-\epsilon, & \delta\le R\le1 +\end{array}\right. \\ +G' & = \left\{ +\begin{array}{ll} +\alpha G, & 0\le G<\delta \\ +(1+\epsilon)G^\beta-\epsilon, & \delta\le G\le1 +\end{array}\right. \\ +B' & = \left\{ +\begin{array}{ll} +\alpha B, & 0\le B<\delta \\ +(1+\epsilon)B^\beta-\epsilon, & \delta\le B\le1 +\end{array}\right. +\end{align} + +Parameters: $\beta$, $\alpha$, $\delta$, $\epsilon$. + +\item[$RGB$ to CIE $XYZ$ (1931):] +\vspace{\baselineskip}\hfill + +This conversion maps a device-dependent linear RGB space to the + device-independent linear CIE $XYZ$ space. +The parameters are the CIE chromaticity coordinates of the three + primaries---red, green, and blue---as well as the chromaticity coordinates + of the white point of the device. +This is how hardware manufacturers and standards typically describe a + particular $RGB$ space. +The math required to convert these parameters into a useful transformation + matrix is reproduced below. + +\begin{align} +F & = +\left[\begin{array}{ccc} +\frac{x_r}{y_r} & \frac{x_g}{y_g} & \frac{x_b}{y_b} \\ +1 & 1 & 1 \\ +\frac{1-x_r-y_r}{y_r} & \frac{1-x_g-y_g}{y_g} & \frac{1-x_b-y_b}{y_b} +\end{array}\right] \\ +\left[\begin{array}{c} +s_r \\ +s_g \\ +s_b +\end{array}\right] & = +F^{-1}\left[\begin{array}{c} +\frac{x_w}{y_w} \\ +1 \\ +\frac{1-x_w-y_w}{y_w} +\end{array}\right] \\ +\left[\begin{array}{c} +X \\ +Y \\ +Z +\end{array}\right] & = +F\left[\begin{array}{c} +s_rR \\ +s_gG \\ +s_bB +\end{array}\right] +\end{align} +Parameters: $x_r,x_g,x_b,x_w, y_r,y_g,y_b,y_w$. + +\end{description} + +\section{Available Color Spaces} +\label{sec:colorspaces} + +These are the color spaces currently defined for use by Theora video. +Each one has a short name, with which it is referred to in this document, and + a more detailed specification of the standards from which its parameters are + derived. +Some standards do not specify all the parameters necessary. +For these unspecified parameters, this document serves as the definition of + what should be used when encoding or decoding Theora video. + +\subsection{Rec.~470M (Rec.~ITU-R~BT.470-6 System M/NTSC with + Rec.~ITU-R~BT.601-5)} +\label{sec:470m} + +This color space is used by broadcast television and DVDs in much of the + Americas, Japan, Korea, and the Union of Myanmar \cite{rec470}. +This color space may also be used for System M/PAL (Brazil), with an + appropriate conversion supplied by the encoder to compensate for the + different gamma value. +See Section~\ref{sec:470bg} for an appropriate gamma value to assume for M/PAL + input. + +In the US, studio monitors are adjusted to a D65 white point + ($x_w,y_w=0.313,0.329$). +In Japan, studio monitors are adjusted to a D white of 9300K + ($x_w,y_w=0.285,0.293$). + +Rec.~470 does not specify a digital encoding of the color signals. +For Theora, Rec.~ITU-R~BT.601-5 \cite{rec601} is used, starting from the + $R'G'B'$ signals specified by Rec.~470. + +Rec.~470 does not specify an input gamma function. +For Theora, the Rec.~709 \cite{rec709} input function is assumed. +This is the same as that specified by SMPTE 170M \cite{smpte170m}, which claims + to reflect modern practice in the creation of NTSC signals circa 1994. + +The parameters for all the color transformations defined in + Section~\ref{sec:color-xforms} are given in Table~\ref{tab:470m}. + +\begin{table}[htb] +\begin{align*} +\mathrm{Offset}_{Y,C_b,C_r} & = (16, 128, 128) \\ +\mathrm{Excursion}_{Y,C_b,C_r} & = (219, 224, 224) \\ +K_r & = 0.299 \\ +K_b & = 0.114 \\ +\gamma & = 2.2 \\ +\beta & = 0.45 \\ +\alpha & = 4.5 \\ +\delta & = 0.018 \\ +\epsilon & = 0.099 \\ +x_r,y_r & = 0.67, 0.33 \\ +x_g,y_g & = 0.21, 0.71 \\ +x_b,y_b & = 0.14, 0.08 \\ +\text{(Illuminant C) } x_w,y_w & = 0.310, 0.316 \\ +\end{align*} +\caption{Rec.~470M Parameters} +\label{tab:470m} +\end{table} + +\subsection{Rec.~470BG (Rec.~ITU-R~BT.470-6 Systems B and G with + Rec.~ITU-R~BT.601-5)} +\label{sec:470bg} + +This color space is used by the PAL and SECAM systems in much of the rest of + the world \cite{rec470} +This can be used directly by systems (B, B1, D, D1, G, H, I, K, N)/PAL and (B, + D, G, H, K, K1, L)/SECAM\@. + +\begin{verse} +{\bf Note:} the Rec.~470BG chromaticity values are different from those + specified in Rec.~470M\@. +When PAL and SECAM systems were first designed, they were based upon the same + primaries as NTSC\@. +However, as methods of making color picture tubes have changed, the primaries + used have changed as well. +The U.S. recommends using correction circuitry to approximate the existing, + standard NTSC primaries. +Current PAL and SECAM systems have standardized on primaries in accord with + more recent technology. +\end{verse} + +Rec.~470 provisionally permits the use of the NTSC chromaticity values (given + in Section~\ref{sec:470m}) with legacy PAL and SECAM equipment. +In Theora, material must be decoded assuming the new PAL and SECAM primaries. +Material intended for display on old legacy devices should be converted by the + decoder. + +The official Rec.~470BG specifies a gamma value of $\gamma=2.8$. +However, in practice this value is unrealistically high \cite{Poyn97}. +Rec.~470BG states that the overall system gamma should be approximately + $\gamma\beta=1.2$. +Since most cameras pre-correct with a gamma value of $\beta=0.45$, + this suggests an output device gamma of approximately $\gamma=2.67$. +This is the value recommended for use with PAL systems in Theora. + +Rec.~470 does not specify a digital encoding of the color signals. +For Theora, Rec.~ITU-R~BT.601-5 \cite{rec601} is used, starting from the + $R'G'B'$ signals specified by Rec.~470. + +Rec.~470 does not specify an input gamma function. +For Theora, the Rec 709 \cite{rec709} input function is assumed. + +The parameters for all the color transformations defined in + Section~\ref{sec:color-xforms} are given in Table~\ref{tab:470bg}. + +\begin{table}[htb] +\begin{align*} +\mathrm{Offset}_{Y,C_b,C_r} & = (16, 128, 128) \\ +\mathrm{Excursion}_{Y,C_b,C_r} & = (219, 224, 224) \\ +K_r & = 0.299 \\ +K_b & = 0.114 \\ +\gamma & = 2.67 \\ +\beta & = 0.45 \\ +\alpha & = 4.5 \\ +\delta & = 0.018 \\ +\epsilon & = 0.099 \\ +x_r,y_r & = 0.64, 0.33 \\ +x_g,y_g & = 0.29, 0.60 \\ +x_b,y_b & = 0.15, 0.06 \\ +\text{(D65) } x_w,y_w & = 0.313, 0.329 \\ +\end{align*} +\caption{Rec.~470BG Parameters} +\label{tab:470bg} +\end{table} + +\section{Pixel Formats} +\label{sec:pixfmts} + +Theora supports several different pixel formats, each of which uses different + subsampling for the chroma planes relative to the luma plane. +A decoder may need to recover a full resolution chroma plane with samples + co-sited with the luma plane in order to convert to RGB for display or perform + other processing. +Decoders can assume that the chroma signal satisfies the Nyquist-Shannon + sampling theorem. +The ideal low-pass reconstruction filter this implies is not practical, but any + suitable approximation can be used, depending on the available computing + power. +Decoders MAY simply use a box filter, assigning to each luma sample the chroma + sample closest to it. +Encoders would not go wrong in assuming that this will be the most common + approach. + +\subsection{4:4:4 Subsampling} +\label{sec:444} + +All three color planes are stored at full resolution---each pixel has a $Y'$, + a $C_b$ and a $C_r$ value (see Figure~\ref{fig:pixel444}). +The samples in the different planes are all at co-located sites. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{pixel444} +\end{center} +\caption{Pixels encoded 4:4:4} +\label{fig:pixel444} +\end{figure} + +% Figure. +%YRB YRB +% +% +% +%YRB YRB +% +% +% + + +\subsection{4:2:2 Subsampling} +\label{sec:422} + +The $C_b$ and $C_r$ planes are stored with half the horizontal resolution of + the $Y'$ plane. +Thus, each of these planes has half the number of horizontal blocks as the luma + plane (see Figure~\ref{fig:pixel422}). +Similarly, they have half the number of horizontal super blocks, rounded up. +Macro blocks are defined across color planes, and so their number does not + change, but each macro block contains half as many chroma blocks. + +The chroma samples are vertically aligned with the luma samples, but + horizontally centered between two luma samples. +Thus, each luma sample has a unique closest chroma sample. +A horizontal phase shift may be required to produce signals which use different + horizontal chroma sampling locations for compatibility with different systems. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{pixel422} +\end{center} +\caption{Pixels encoded 4:2:2} +\label{fig:pixel422} +\end{figure} + +% Figure. +%Y RB Y Y RB Y +% +% +% +%Y RB Y Y RB Y +% +% +% + +\subsection{4:2:0 Subsampling} +\label{sec:420} + +The $C_b$ and $C_r$ planes are stored with half the horizontal and half the + vertical resolution of the $Y'$ plane. +Thus, each of these planes has half the number of horizontal blocks and half + the number of vertical blocks as the luma plane, for a total of one quarter + the number of blocks (see Figure~\ref{fig:pixel420}). +Similarly, they have half the number of horizontal super blocks and half the + number of vertical super blocks, rounded up. +Macro blocks are defined across color planes, and so their number does not + change, but each macro block contains within it one quarter as many + chroma blocks. + +The chroma samples are vertically and horizontally centered between four luma + samples. +Thus, each luma sample has a unique closest chroma sample. +This is the same sub-sampling pattern used with JPEG, MJPEG, and MPEG-1, and + was inherited from VP3. +A horizontal or vertical phase shift may be required to produce signals which + use different chroma sampling locations for compatibility with different + systems. + +\begin{figure}[htbp] +\begin{center} +\includegraphics{pixel420} +\end{center} +\caption{Pixels encoded 4:2:0} +\label{fig:pixel420} +\end{figure} + +% Figure. +%Y Y Y Y +% +% RB RB +% +%Y Y Y Y +% +% +% +%Y Y Y Y +% +% RB RB +% +%Y Y Y Y +% +% +% + +\subsection{Subsampling and the Picture Region} + +Although the frame size must be an integral number of macro blocks, and thus + both the number of pixels and the number of blocks in each direction must be + even, no such requirement is made of the picture region. +Thus, when using subsampled pixel formats, careful attention must be paid to + which chroma samples correspond to which luma samples. + +As mentioned above, for each pixel format, there is a unique chroma sample that + is the closest to each luma sample. +When cropping the chroma planes to the picture region, all the chroma samples + corresponding to a luma sample in the cropped picture region must be included. +Thus, when dividing the width or height of the picture region by two to obtain + the size of the subsampled chroma planes, they must be rounded up. + +Furthermore, the sampling locations are defined relative to the frame, + {\em not} the picture region. +When using the 4:2:2 and 4:2:0 formats, the locations of chroma samples + relative to the luma samples depends on whether or not the X offset of the + picture region is odd. +If the offset is even, each column of chroma samples corresponds to two columns + of luma samples (see Figure~\ref{fig:pic_even} for an example). +The only exception is if the width is odd, in which case the last column + corresponds to only one column of luma samples (see Figure~\ref{fig:pic_even_odd}). +If the offset is odd, then the first column of chroma samples corresponds to + only one column of luma samples, while the remaining columns each correspond + to two (see Figure~\ref{fig:pic_odd}). +In this case, if the width is even, the last column again corresponds to only + one column of luma samples (see Figure~\ref{fig:pic_odd_even}). + +A similar process is followed with the rows of a picture region of odd height + encoded in the 4:2:0 format. +If the Y offset is even, each row of chroma samples corresponds to two rows of + luma samples (see Figure~\ref{fig:pic_even}), except with an odd height, where + the last row corresponds to one row of chroma luna samples only (see + Figure~\ref{fig:pic_even_odd}). +If the offset is odd, then it is the first row of chroma samples which + corresponds to only one row of luma samples, while the remaining rows each + correspond to two (Figure~\ref{fig:pic_odd}), except with an even height, + where the last row also corresponds to one (Figure~\ref{fig:pic_odd_even}). + +Encoders should be aware of these differences in the subsampling when using an + even or odd offset. +In the typical case, with an even width and height, where one expects two rows + or columns of luma samples for every row or column of chroma samples, the + encoder must take care to ensure that the offsets used are both even. + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{pic_even} +\end{center} +\caption{Pixel correspondence between color planes with even picture + offset and even picture size} +\label{fig:pic_even} +\end{figure} + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{pic_even_odd} +\end{center} +\caption{Pixel correspondence with even picture offset and + odd picture size} +\label{fig:pic_even_odd} +\end{figure} + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{pic_odd} +\end{center} +\caption{Pixel correspondence with odd picture offset and + odd picture size} +\label{fig:pic_odd} +\end{figure} + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{pic_odd_even} +\end{center} +\caption{Pixel correspondence with odd picture offset and + even picture size} +\label{fig:pic_odd_even} +\end{figure} + + +\chapter{Bitpacking Convention} +\label{sec:bitpacking} + +\section{Overview} + +The Theora codec uses relatively unstructured raw packets containing + binary integer fields of arbitrary width. +Logically, each packet is a bitstream in which bits are written one-by-one by + the encoder and then read one-by-one in the same order by the decoder. +Most current binary storage arrangements group bits into a native storage unit + of eight bits (octets), sixteen bits, thirty-two bits, or less commonly other + fixed sizes. +The Theora bitpacking convention specifies the correct mapping of the logical + packet bitstream into an actual representation in fixed-width units. + +\subsection{Octets and Bytes} + +In most contemporary architectures, a `byte' is synonymous with an `octect', + that is, eight bits. +For purposes of the bitpacking convention, a byte implies the smallest native + integer storage representation offered by a platform. +Modern file systems invariably offer bytes as the fundamental atom of storage. + +The most ubiquitous architectures today consider a `byte' to be an octet. +Note, however, that the Theora bitpacking convention is still well defined for + any native byte size; an implementation can use the native bit-width of a + given storage system. +This document assumes that a byte is one octet for purposes of example only. + +\subsection{Words and Byte Order} + +A `word' is an integer size that is a grouped multiple of the byte size. +Most architectures consider a word to be a group of two, four, or eight bytes. +Each byte in the word can be ranked by order of `significance', e.g.\ the + significance of the bits in each byte when storing a binary integer in the + word. +Several byte orderings are possible in a word. +The common ones are +\begin{itemize} +\item{Big-endian:} +in which the most significant byte comes first, e.g.\ 3-2-1-0, +\item{Little-endian:} +in which the least significant byte comes first, e.g.\ 0-1-2-3, and +\item{Mixed-endian:} +one of the less-common orderings that cannot be put into the above two + categories, e.g.\ 3-1-2-0 or 0-2-1-3. +\end{itemize} + +The Theora bitpacking convention specifies storage and bitstream manipulation + at the byte, not word, level. +Thus host word ordering is of a concern only during optimization, when writing + code that operates on a word of storage at a time rather than a byte. +Logically, bytes are always encoded and decoded in order from byte zero through + byte $n$. + +\subsection{Bit Order} + +A byte has a well-defined `least significant' bit (LSb), which is the only bit + set when the byte is storing the two's complement integer value $+1$. +A byte's `most significant' bit (MSb) is at the opposite end. +Bits in a byte are numbered from zero at the LSb to $n$ for the MSb, where + $n=7$ in an octet. + +\section{Coding Bits into Bytes} + +The Theora codec needs to encode arbitrary bit-width integers from zero to 32 + bits wide into packets. +These integer fields are not aligned to the boundaries of the byte + representation; the next field is read at the bit position immediately + after the end of the previous field. + +The decoder logically unpacks integers by first reading the MSb of a binary + integer from the logical bitstream, followed by the next most significant + bit, etc., until the required number of bits have been read. +When unpacking the bytes into bits, the decoder begins by reading the MSb of + the integer to be read from the most significant unread bit position of the + source byte, followed by the next-most significant bit position of the + destination integer, and so on up to the requested number of bits. +Note that this differs from the Vorbis I codec, which + begins decoding with the LSb of the source integer, reading it from the + LSb of the source byte. +When all the bits of the current source byte are read, decoding continues with + the MSb of the next byte. +Any unfilled bits in the last byte of the packet MUST be cleared to zero by the + encoder. + +\subsection{Signedness} + +The binary integers decoded by the above process may be either signed or + unsigned. +This varies from integer to integer, and this specification + indicates how each value should be interpreted as it is read. +That is, depending on context, the three bit binary pattern \bin{111} can be + taken to represent either `$7$' as an unsigned integer or `$-1$' as a signed, + two's complement integer. + +\subsection{Encoding Example} + +The following example shows the state of an (8-bit) byte stream after several + binary integers are encoded, including the location of the put pointer for the + next bit to write to and the total length of the stream in bytes. + +Encode the 4 bit unsigned integer value `12' (\bin{1100}) into an empty byte + stream. + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{}& &&&&$\downarrow$&&&& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & + 0 & 0 & 0 & 0 & $\leftarrow$ \\ +byte 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +byte 2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +byte 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +\multicolumn{1}{c|}{$\vdots$}&\multicolumn{8}{c}{$\vdots$}& \\ +byte $n$ & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 1 byte +\end{tabular} +\vspace{\baselineskip} + +Continue by encoding the 3 bit signed integer value `-1' (\bin{111}). + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{} &&&&&&&&$\downarrow$& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & + \textbf{1} & \textbf{1} & \textbf{1} & 0 & $\leftarrow$ \\ +byte 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +byte 2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +byte 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +\multicolumn{1}{c|}{$\vdots$}&\multicolumn{8}{c}{$\vdots$}& \\ +byte $n$ & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 1 byte +\end{tabular} +\vspace{\baselineskip} + +Continue by encoding the 7 bit integer value `17' (\bin{0010001}). + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{} &&&&&&&$\downarrow$&& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & + \textbf{1} & \textbf{1} & \textbf{1} & \textbf{0} & \\ +byte 1 & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & + \textbf{0} & \textbf{1} & 0 & 0 & $\leftarrow$ \\ +byte 2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +byte 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \\ +\multicolumn{1}{c|}{$\vdots$}&\multicolumn{8}{c}{$\vdots$}& \\ +byte $n$ & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 2 bytes +\end{tabular} +\vspace{\baselineskip} + +Continue by encoding the 13 bit integer value `6969' (\bin{11011\ 00111001}). + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{} &&&&$\downarrow$&&&&& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & + \textbf{1} & \textbf{1} & \textbf{1} & \textbf{0} & \\ +byte 1 & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{0} & + \textbf{0} & \textbf{1} & \textbf{1} & \textbf{1} & \\ +byte 2 & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & + \textbf{0} & \textbf{1} & \textbf{1} & \textbf{1} & \\ +byte 3 & \textbf{0} & \textbf{0} & \textbf{1} & + 0 & 0 & 0 & 0 & 0 & $\leftarrow$ \\ +\multicolumn{1}{c|}{$\vdots$}&\multicolumn{8}{c}{$\vdots$}& \\ +byte $n$ & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 4 bytes +\end{tabular} +\vspace{\baselineskip} + +\subsection{Decoding Example} + +The following example shows the state of the (8-bit) byte stream encoded in the + previous example after several binary integers are decoded, including the + location of the get pointer for the next bit to read. + +Read a two bit unsigned integer from the example encoded above. + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{} &&&$\downarrow$&&&&&& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & 0 & 0 & 1 & 1 & 1 & 0 & $\leftarrow$ \\ +byte 1 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 1 & \\ +byte 2 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & \\ +byte 3 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 4 bytes +\end{tabular} +\vspace{\baselineskip} + +Value read: 3 (\bin{11}). + +Read another two bit unsigned integer from the example encoded above. + +\begin{tabular}{r|ccccccccl} +\multicolumn{1}{r}{} &&&&&$\downarrow$&&&& \\ + & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\\cline{1-9} +byte 0 & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & + 1 & 1 & 1 & 0 & $\leftarrow$ \\ +byte 1 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 1 & \\ +byte 2 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & \\ +byte 3 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & +byte stream length: 4 bytes +\end{tabular} +\vspace{\baselineskip} + +Value read: 0 (\bin{00}). + +Two things are worth noting here. +\begin{itemize} +\item +Although these four bits were originally written as a single four-bit integer, + reading some other combination of bit-widths from the bitstream is well + defined. +No artificial alignment boundaries are maintained in the bitstream. +\item +The first value is the integer `$3$' only because the context stated we were + reading an unsigned integer. +Had the context stated we were reading a signed integer, the returned value + would have been the integer `$-1$'. +\end{itemize} + +\subsection{End-of-Packet Alignment} + +The typical use of bitpacking is to produce many independent byte-aligned + packets which are embedded into a larger byte-aligned container structure, + such as an Ogg transport bitstream. +Externally, each bitstream encoded as a byte stream MUST begin and end on a + byte boundary. +Often, the encoded packet bitstream is not an integer number of bytes, and so + there is unused space in the last byte of a packet. + +%r: I think the generality here is necessary to be consistent with our assertions +%r: elsewhere about being independent of transport and byte width +When a Theora encoder produces packets for embedding in a byte-aligned + container, unused space in the last byte of a packet is always zeroed during + the encoding process. +Thus, should this unused space be read, it will return binary zeroes. +There is no marker pattern or stuffing bits that will allow the decoder to + obtain the exact size, in bits, of the original bitstream. +This knowledge is not required for decoding. + +Attempting to read past the end of an encoded packet results in an + `end-of-packet' condition. +Any further read operations after an `end-of-packet' condition shall also + return `end-of-packet'. +Unlike Vorbis, Theora does not use truncated packets as a normal mode of + operation. +Therefore if a decoder encounters the `end-of-packet' condition during normal + decoding, it may attempt to use the bits that were read to recover as much of + encoded data as possible, signal a warning or error, or both. + +\subsection{Reading Zero Bit Integers} + +Reading a zero bit integer returns the value `$0$' and does not increment + the stream pointer. +Reading to the end of the packet, but not past the end, so that an + `end-of-packet' condition is not triggered, and then reading a zero bit + integer shall succeed, returning `$0$', and not trigger an `end-of-packet' + condition. +Reading a zero bit integer after a previous read sets the `end-of-packet' + condition shall fail, also returning `end-of-packet'. + +\chapter{Bitstream Headers} +\label{sec:headers} + +A Theora bitstream begins with three header packets. +The header packets are, in order, the identification header, the comment + header, and the setup header. +All are required for decode compliance. +An end-of-packet condition encountered while decoding the identification or + setup header packets renders the stream undecodable. +An end-of-packet condition encountered while decode the comment header is a + non-fatal error condition, and MAY be ignored by a decoder. + +\paragraph{VP3 Compatibility} + +VP3 relies on the headers provided by its container, usually either AVI or + Quicktime. +As such, several parameters available in these headers are not available to VP3 + streams. +These are indicated as they appear in the sections below. + +\section{Common Header Decode} +\label{sub:common-header} + +\begin{figure}[Htbp] +\begin{center} +\begin{verbatim} + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | header type | `t' | `h' | `e' | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | `o' | `r' | `a' | data... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | ... header-specific data ... | + | ... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +\end{verbatim} +\end{center} +\caption{Common Header Packet Layout} +\label{fig:commonheader} +\end{figure} + + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{HEADERTYPE} & Integer & 8 & No & The type of the header being + decoded. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:} None. +\medskip + +Each header packet begins with the same header fields, which are decoded as + follows: + +\begin{enumerate} +\item +Read an 8-bit unsigned integer as \bitvar{HEADERTYPE}. +If the most significant bit of this integer is not set, then stop. +This is not a header packet. +\item +Read 6 8-bit unsigned integers. +If these do not have the values \hex{74}, \hex{68}, \hex{65}, \hex{6F}, + \hex{72}, and \hex{61}, respectively, then stop. +This stream is not decodable by this specification. +These values correspond to the ASCII values of the characters `t', `h', `e', + `o', `r', and `a'. +\end{enumerate} + +Decode continues according to \bitvar{HEADERTYPE}. +The identification header is type \hex{80}, the comment header is type + \hex{81}, and the setup header is type \hex{82}. +These packets must occur in the order: identification, comment, setup. +%r: I clarified the initial-bit scheme here +%TBT: Dashes let the reader know they'll have to pick up the rest of the +%TBT: sentence after the explanatory phrase. +%TBT: Otherwise it just sounds like the bit must exist. +All header packets have the most significant bit of the type + field---which is the initial bit in the packet---set. +This distinguishes them from video data packets in which the first bit + is unset. +% extra header packets are a feature Dan argued for way back when for +% backward-compatible extensions (and icc colourspace for example) +% I think it's reasonable +%TBT: You can always just stick more stuff in the setup header. +Packets with other header types (\hex{83}--\hex{FF}) are reserved and MUST be + ignored. + +\section{Identification Header Decode} +\label{sec:idheader} + +\begin{figure}[Htbp] +\begin{center} +\begin{verbatim} + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | 0x80 | `t' | `h' | `e' | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | `o' | `r' | `a' | VMAJ | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | VMIN | VREV | FMBW | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | FMBH | PICW... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | ...PICW | PICH | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | PICX | PICY | FRN... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | ...FRN | FRD... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | ...FRD | PARN... | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | ...PARN | PARD | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | CS | NOMBR | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | QUAL | KFGSHIFT| PF| Res | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +\end{verbatim} +\end{center} +\caption{Identification Header Packet} +\label{fig:idheader} +\end{figure} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{VMAJ} & Integer & 8 & No & The major version number. \\ +\bitvar{VMIN} & Integer & 8 & No & The minor version number. \\ +\bitvar{VREV} & Integer & 8 & No & The version revision number. \\ +\bitvar{FMBW} & Integer & 16 & No & The width of the frame in macro + blocks. \\ +\bitvar{FMBH} & Integer & 16 & No & The height of the frame in macro + blocks. \\ +\bitvar{NSBS} & Integer & 32 & No & The total number of super blocks in a + frame. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{NMBS} & Integer & 32 & No & The total number of macro blocks in a + frame. \\ +\bitvar{PICW} & Integer & 20 & No & The width of the picture region in + pixels. \\ +\bitvar{PICH} & Integer & 20 & No & The height of the picture region in + pixels. \\ +\bitvar{PICX} & Integer & 8 & No & The X offset of the picture region in + pixels. \\ +\bitvar{PICY} & Integer & 8 & No & The Y offset of the picture region in + pixels. \\ +\bitvar{FRN} & Integer & 32 & No & The frame-rate numerator. \\ +\bitvar{FRD} & Integer & 32 & No & The frame-rate denominator. \\ +\bitvar{PARN} & Integer & 24 & No & The pixel aspect-ratio numerator. \\ +\bitvar{PARD} & Integer & 24 & No & The pixel aspect-ratio denominator. \\ +\bitvar{CS} & Integer & 8 & No & The color space. \\ +\bitvar{PF} & Integer & 2 & No & The pixel format. \\ +\bitvar{NOMBR} & Integer & 24 & No & The nominal bitrate of the stream, in + bits per second. \\ +\bitvar{QUAL} & Integer & 6 & No & The quality hint. \\ +\bitvar{KFGSHIFT} & Integer & 5 & No & The amount to shift the key frame + number by in the granule position. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:} None. +\medskip + +The identification header is a short header with only a few fields used to + declare the stream definitively as Theora and provide detailed information + about the format of the fully decoded video data. +The identification header is decoded as follows: + +\begin{enumerate} +\item +Decode the common header fields according to the procedure described in + Section~\ref{sub:common-header}. +If \bitvar{HEADERTYPE} returned by this procedure is not \hex{80}, then stop. +This packet is not the identification header. +\item +Read an 8-bit unsigned integer as \bitvar{VMAJ}. +If \bitvar{VMAJ} is not $3$, then stop. +This stream is not decodable according to this specification. +\item +Read an 8-bit unsigned integer as \bitvar{VMIN}. +If \bitvar{VMIN} is not $2$, then stop. +This stream is not decodable according to this specification. +\item +Read an 8-bit unsigned integer as \bitvar{VREV}. +If \bitvar{VREV} is greater than $1$, then this stream +may contain optional features or interpretational changes +documented in a future version of this specification. +Regardless of the value of \bitvar{VREV}, the stream is decodable +according to this specification. +\item +Read a 16-bit unsigned integer as \bitvar{FMBW}. +This MUST be greater than zero. +This specifies the width of the coded frame in macro blocks. +The actual width of the frame in pixels is $\bitvar{FMBW}*16$. +\item +Read a 16-bit unsigned integer as \bitvar{FMBH}. +This MUST be greater than zero. +This specifies the height of the coded frame in macro blocks. +The actual height of the frame in pixels is $\bitvar{FMBH}*16$. +\item +Read a 24-bit unsigned integer as \bitvar{PICW}. +This MUST be no greater than $(\bitvar{FMBW}*16)$. +Note that 24 bits are read, even though only 20 bits are sufficient to specify + any value of the picture width. +This is done to preserve octet alignment in this header, to allow for a + simplified parser implementation. +\item +Read a 24-bit unsigned integer as \bitvar{PICH}. +This MUST be no greater than $(\bitvar{FMBH}*16)$. +Together with \bitvar{PICW}, this specifies the size of the displayable picture + region within the coded frame. +See Figure~\ref{fig:pic-frame}. +Again, 24 bits are read instead of 20. +\item +Read an 8-bit unsigned integer as \bitvar{PICX}. +This MUST be no greater than $(\bitvar{FMBW}*16-\bitvar{PICX})$. +\item +Read an 8-bit unsigned integer as \bitvar{PICY}. +This MUST be no greater than $(\bitvar{FMBH}*16-\bitvar{PICY})$. +Together with \bitvar{PICX}, this specifies the location of the lower-left + corner of the displayable picture region. +See Figure~\ref{fig:pic-frame}. +\item +Read a 32-bit unsigned integer as \bitvar{FRN}. +This MUST be greater than zero. +\item +Read a 32-bit unsigned integer as \bitvar{FRD}. +This MUST be greater than zero. +Theora is a fixed-frame rate video codec. +Frames are sampled at the constant rate of $\frac{\bitvar{FRN}}{\bitvar{FRD}}$ + frames per second. +The presentation time of the first frame is at zero seconds. +No mechanism is provided to specify a non-zero offset for the initial + frame. +\item +Read a 24-bit unsigned integer as \bitvar{PARN}. +\item +Read a 24-bit unsigned integer as \bitvar{PARD}. +Together with \bitvar{PARN}, these specify the aspect ratio of the pixels + within a frame, defined as the ratio of the physical width of a pixel to its + physical height. +This is given by the ratio $\bitvar{PARN}:\bitvar{PARD}$. +If either of these fields are zero, this indicates that pixel aspect ratio + information was not available to the encoder. +In this case it MAY be specified by the application via an external means, or + a default value of $1:1$ MAY be used. +\item +Read an 8-bit unsigned integer as \bitvar{CS}. +This is a value from an enumerated list of the available color spaces, given in + Table~\ref{tab:colorspaces}. +The `Undefined' value indicates that color space information was not available + to the encoder. +It MAY be specified by the application via an external means. +If a reserved value is given, a decoder MAY refuse to decode the stream. +\begin{table}[htbp] +\begin{center} +\begin{tabular*}{215pt}{cl@{\extracolsep{\fill}}c}\toprule +Value & Color Space \\\midrule +$0$ & Undefined. \\ +$1$ & Rec.~470M (see Section~\ref{sec:470m}). \\ +$2$ & Rec.~470BG (see Section~\ref{sec:470bg}). \\ +$3$ & Reserved. \\ +$\vdots$ & \\ +$255$ & \\ +\bottomrule\end{tabular*} +\end{center} +\caption{Enumerated List of Color Spaces} +\label{tab:colorspaces} +\end{table} +\item +Read a 24-bit unsigned integer as \bitvar{NOMBR} signifying a rate in bits +per second. Rates equal to or greater than $2^{24}-1$ bits per second are +represented as $2^{24}-1$. +The \bitvar{NOMBR} field is used only as a hint. +For pure VBR streams, this value may be considerably off. +The field MAY be set to zero to indicate that the encoder did not care to +speculate. +\item +Read a 6-bit unsigned integer as \bitvar{QUAL}. +This value is used to provide a hint as to the relative quality of the stream + when compared to others produced by the same encoder. +Larger values indicate higher quality. +This can be used, for example, to select among several streams containing the + same material encoded with different settings. +\item +Read a 5-bit unsigned integer as \bitvar{KFGSHIFT}. +The \bitvar{KFGSHIFT} is used to partition the granule position associated with + each packet into two different parts. +The frame number of the last key frame, starting from zero, is stored in the + upper $64-\bitvar{KFGSHIFT}$ bits, while the lower \bitvar{KFGSHIFT} bits + contain the number of frames since the last keyframe. +Complete details on the granule position mapping are specified in Section~REF. +\item +Read a 2-bit unsigned integer as \bitvar{PF}. +The \bitvar{PF} field contains a value from an enumerated list of the available + pixel formats, given in Table~\ref{tab:pixel-formats}. +If the reserved value $1$ is given, stop. +This stream is not decodable according to this specification. + +\begin{table}[htbp] +\begin{center} +\begin{tabular*}{215pt}{cl@{\extracolsep{\fill}}c}\toprule +Value & Pixel Format \\\midrule +$0$ & 4:2:0 (see Section~\ref{sec:420}). \\ +$1$ & Reserved. \\ +$2$ & 4:2:2 (see Section~\ref{sec:422}). \\ +$3$ & 4:4:4 (see Section~\ref{sec:444}). \\ +\bottomrule\end{tabular*} +\end{center} +\caption{Enumerated List of Pixel Formats} +\label{tab:pixel-formats} +\end{table} + +\item +Read a 3-bit unsigned integer. +These bits are reserved. +If this value is not zero, then stop. +This stream is not decodable according to this specification. +\item +Assign \bitvar{NSBS} a value according to \bitvar{PF}, as given by + Table~\ref{tab:nsbs-for-pf}. + +\begin{table}[bt] +\begin{center} +\begin{tabular}{cc}\toprule +\bitvar{PF} & \bitvar{NSBS} \\\midrule +$0$ & $\begin{aligned} +&((\bitvar{FMBW}+1)//2)*((\bitvar{FMBH}+1)//2)\\ +& +2*((\bitvar{FMBW}+3)//4)*((\bitvar{FMBH}+3)//4) +\end{aligned}$ \\\midrule +$2$ & $\begin{aligned} +&((\bitvar{FMBW}+1)//2)*((\bitvar{FMBH}+1)//2)\\ +& +2*((\bitvar{FMBW}+3)//4)*((\bitvar{FMBH}+1)//2) +\end{aligned}$ \\\midrule +$3$ & $3*((\bitvar{FMBW}+1)//2)*((\bitvar{FMBH}+1)//2)$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Number of Super Blocks for each Pixel Format} +\label{tab:nsbs-for-pf} +\end{table} + +\item +Assign \bitvar{NBS} a value according to \bitvar{PF}, as given by + Table~\ref{tab:nbs-for-pf}. + +\begin{table}[tb] +\begin{center} +\begin{tabular}{cc}\toprule +\bitvar{PF} & \bitvar{NBS} \\\midrule +$0$ & $6*\bitvar{FMBW}*\bitvar{FMBH}$ \\\midrule +$2$ & $8*\bitvar{FMBW}*\bitvar{FMBH}$ \\\midrule +$3$ & $12*\bitvar{FMBW}*\bitvar{FMBH}$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Number of Blocks for each Pixel Format} +\label{tab:nbs-for-pf} +\end{table} + +\item +Assign \bitvar{NMBS} the value $(\bitvar{FMBW}*\bitvar{FMBH})$. + +\end{enumerate} + +\paragraph{VP3 Compatibility} + +VP3 does not correctly handle frame sizes that are not a multiple of 16. +Thus, \bitvar{PICW} and \bitvar{PICH} should be set to the frame width and + height in pixels, respectively, and \bitvar{PICX} and \bitvar{PICY} should be + set to zero. +VP3 headers do not specify a color space. +VP3 only supports the 4:2:0 pixel format. + +\section{Comment Header} +\label{sec:commentheader} + +The Theora comment header is the second of three header packets that begin a + Theora stream. +It is meant for short text comments, not aribtrary metadata; arbitrary metadata + belongs in a separate logical stream that provides greater structure and + machine parseability. + +%r: I tried to morph this a little more in the direction of our +% application space +The comment field is meant to be used much like someone jotting a quick note on + the label of a video. +It should be a little information to remember the disc or tape by and explain it to + others; a short, to-the-point text note that can be more than a couple words, + but isn't going to be more than a short paragraph. +The essentials, in other words, whatever they turn out to be, e.g.: + +%TODO: Example + +The comment header is stored as a logical list of eight-bit clean vectors; the + number of vectors is bounded at $2^{32}-1$ and the length of each vector is + limited to $2^{32}-1$ bytes. +The vector length is encoded; the vector contents themselves are not null + terminated. +In addition to the vector list, there is a single vector for a vendor name, + also eight-bit clean with a length encoded in 32 bits. +%TODO: The 1.0 release of libtheora sets the vendor string to ... + +\subsection{Comment Length Decode} +\label{sub:comment-len} + +\begin{figure} +\begin{center} +\begin{tabular}{ | c | c | } + \hline + 4 byte length & + UTF-8 encoded string ...\\ + \hline +\end{tabular} +\end{center} +\caption{Length encoded string layout} +\label{fig:comment-len} +\end{figure} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{LEN} & Integer & 32 & No & A single 32-bit length value. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{LEN0} & Integer & 8 & No & The first octet of the string length. \\ +\locvar{LEN1} & Integer & 8 & No & The second octet of the string length. \\ +\locvar{LEN2} & Integer & 8 & No & The third octet of the string length. \\ +\locvar{LEN3} & Integer & 8 & No & The fourth octet of the string + length. \\ +\bottomrule\end{tabularx} +\medskip + +A single comment vector is decoded as follows: + +\begin{enumerate} +\item +Read an 8-bit unsigned integer as \locvar{LEN0}. +\item +Read an 8-bit unsigned integer as \locvar{LEN1}. +\item +Read an 8-bit unsigned integer as \locvar{LEN2}. +\item +Read an 8-bit unsigned integer as \locvar{LEN3}. +\item +Assign \bitvar{LEN} the value $(\locvar{LEN0}+(\locvar{LEN1}<<8)+ + (\locvar{LEN2}<<16)+(\locvar{LEN3}<<24))$. +This construction is used so that on platforms with 8-bit bytes, the memory + organization of the comment header is identical with that of Vorbis I, + allowing for common parsing code despite the different bit packing + conventions. +\end{enumerate} + +\subsection{Comment Header Decode} + +\begin{figure} +\begin{center} +\begin{tabular}{ | c | } + \hline + vendor string \\ \hline + number of comments \\ \hline + comment string \\ \hline + comment string \\ \hline + ... \\ + \hline +\end{tabular} +\end{center} +\caption{Comment Header Layout} +\label{fig:commentheader} +\end{figure} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{VENDOR} & \multicolumn{3}{l}{String} & The vendor string. \\ +\bitvar{NCOMMENTS} & Integer & 32 & No & The number of user + comments. \\ +\bitvar{COMMENTS} & \multicolumn{3}{l}{String Array} & A list of + \bitvar{NCOMMENTS} user comment values. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\ci} & Integer & 32 & No & The index of the current user + comment. \\ +\bottomrule\end{tabularx} +\medskip + +The complete comment header is decoded as follows: + +\begin{enumerate} +\item +Decode the common header fields according to the procedure described in + Section~\ref{sub:common-header}. +If \bitvar{HEADERTYPE} returned by this procedure is not \hex{81}, then stop. +This packet is not the comment header. +\item +Decode the length of the vendor string using the procedure given in + Section~\ref{sub:comment-len} into \bitvar{LEN}. +\item +Read \bitvar{LEN} 8-bit unsigned integers. +\item +Set the string \bitvar{VENDOR} to the contents of these octets. +\item +Decode the number of user comments using the procedure given in + Section~\ref{sub:comment-len} into \bitvar{LEN}. +\item +Assign \bitvar{NCOMMENTS} the value stored in \bitvar{LEN}. +\item +For each consecutive value of \locvar{\ci} from $0$ to + $(\bitvar{NCOMMENTS}-1)$, inclusive: +\begin{enumerate} +\item +Decode the length of the current user comment using the procedure given in + Section~\ref{sub:comment-len} into \bitvar{LEN}. +\item +Read \bitvar{LEN} 8-bit unsigned integers. +\item +Set the string $\bitvar{COMMENTS}[\locvar{\ci}]$ to the contents of these + octets. +\end{enumerate} +\end{enumerate} + +The comment header comprises the entirety of the second header packet. +Unlike the first header packet, it is not generally the only packet on the + second page and may span multiple pages. +The length of the comment header packet is (practically) unbounded. +The comment header packet is not optional; it must be present in the stream + even if it is logically empty. + +%TODO: \paragraph{VP3 Compatibility} + +\subsection{User Comment Format} + +The user comment vectors are structured similarly to a UNIX environment + variable. +That is, comment fields consist of a field name and a corresponding value and + look like: +\begin{center} +\begin{tabular}{rcl} +$\bitvar{COMMENTS}[0]$ & = & ``TITLE=the look of Theora" \\ +$\bitvar{COMMENTS}[1]$ & = & ``DIRECTOR=me" +\end{tabular} +\end{center} + +The field name is case-insensitive and MUST consist of ASCII characters + \hex{20} through \hex{7D}, \hex{3D} (`=') excluded. +ASCII \hex{41} through \hex{5A} inclusive (characters `A'--`Z') are to be + considered equivalent to ASCII \hex{61} through \hex{7A} inclusive + (characters `a'--`z'). +An entirely empty field name---one that is zero characters long---is not + disallowed. + +The field name is immediately followed by ASCII \hex{3D} (`='); this equals + sign is used to terminate the field name. + +The data immediately after \hex{3D} until the end of the vector is the eight-bit + clean value of the field contents encoded as a UTF-8 string~\cite{rfc2044}. + +Field names MUST NOT be `internationalized'; this is a concession to + simplicity, not an attempt to exclude the majority of the world that doesn't + speak English. +Applications MAY wish to present internationalized versions of the standard + field names listed below to the user, but they are not to be stored in the + bitstream. +Field {\em contents}, however, use the UTF-8 character encoding to allow easy + representation of any language. + +Individual `vendors' MAY use non-standard field names within reason. +The proper use of comment fields as human-readable notes has already been + explained. +Abuse will be discouraged. + +There is no vendor-specific prefix to `non-standard' field names. +Vendors SHOULD make some effort to avoid arbitrarily polluting the common + namespace. +%"and other bodies"? +%If you're going to be that vague, you might as well not say anything at all. +Xiph.Org and other bodies will generally collect and rationalize the more + useful tags to help with standardization. + +Field names are not restricted to occur only once within a comment header. +%TODO: Example + +\paragraph{Field Names} + +%r should this be an appendix? + +Below is a proposed, minimal list of standard field names with a description of + their intended use. +No field names are mandatory; a comment header may contain one or more, all, or + none of the names in this list. + +\begin{description} +\item{TITLE:} Video name. +\item{ARTIST:} Filmmaker or other creator name. +\item{VERSION:} Subtitle, remix info, or other text distinguishing + versions of a video. +\item{DATE:} Date associated with the video. Implementations SHOULD attempt + to parse this field as an ISO 8601 date for machine interpretation and + conversion. +\item{LOCATION:} Location associated with the video. This is usually the + filming location for non-fiction works. +\item{COPYRIGHT:} Copyright statement. +\item{LICENSE:} Copyright and other licensing information. + Implementations wishing to do automatic parsing of e.g + of distribution terms SHOULD look here for a URL uniquely defining + the license. If no instance of this field is present, or if no + instance contains a parseable URL, and implementation MAY look + in the COPYRIGHT field for such a URL. +\item{ORGANIZATION:} Studio name, Publisher, or other organization + involved in the creation of the video. + +\item{DIRECTOR:} Director or Filmmaker credit, similar to ARTIST. +\item{PRODUCER:} Producer credit for the video. +\item{COMPOSER:} Music credit for the video. +\item{ACTOR:} Acting credit for the video. + +\item{TAG:} subject or category tag, keyword, or other content + classification labels. The value of each instance of this + field SHOULD be treated as a single label, with multiple + instances of the field for multiple tags. The value of + a single field SHOULD NOT be parsed into multiple tags + based on some internal delimeter. +\item{DESCRIPTION:} General description, summary, or blurb. +\end{description} + +\section{Setup Header} +\label{sec:setupheader} + +The Theora setup header contains the limit values used to drive the loop + filter, the base matrices and scale values used to build the dequantization + tables, and the Huffman tables used to unpack the DCT tokens. +Because the contents of this header are specific to Theora, no concessions have + been made to keep the fields octet-aligned for easy parsing. + +\begin{figure} +\begin{center} +\begin{tabular}{ | c | } + \hline + common header block \\ \hline + loop filter table resolution \\ \hline + loop filter table \\ \hline + scale table resolution \\ \hline + AC scale table \\ \hline + DC scale table \\ \hline + number of base matricies \\ \hline + base quatization matricies \\ \hline + ... \\ \hline + quant range interpolation table \\ \hline + DCT token Huffman tables \\ + \hline +\end{tabular} +\end{center} +\caption{Setup Header structure} +\label{fig:setupheader} +\end{figure} + +\subsection{Loop Filter Limit Table Decode} +\label{sub:loop-filter-limits} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{LFLIMS} & \multicolumn{1}{p{40pt}}{Integer array} & + 7 & No & A 64-element array of loop filter limit + values. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\qi} & Integer & 6 & No & The quantization index. \\ +\locvar{NBITS} & Integer & 3 & No & The size of values being read in the + current table. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure decodes the table of loop filter limit values used to drive the + loop filter, which is described in Section~\ref{sub:loop-filter-limits}. +It is decoded as follows: + +\begin{enumerate} +\item +Read a 3-bit unsigned integer as \locvar{NBITS}. +\item +For each consecutive value of \locvar{\qi} from $0$ to $63$, inclusive: +\begin{enumerate} +\item +Read an \locvar{NBITS}-bit unsigned integer as $\bitvar{LFLIMS}[\locvar{\qi}]$. +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The loop filter limit values are hardcoded in VP3. +The values used are given in Appendix~\ref{app:vp3-loop-filter-limits}. + +\subsection{Quantization Parameters Decode} +\label{sub:quant-params} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + the DC coefficient for each \qi\ value. \\ +\bitvar{NBMS} & Integer & 10 & No & The number of base matrices. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values are used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values are used. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\qti} & Integer & 1 & No & A quantization type index. +See Table~\ref{tab:quant-types}.\\ +\locvar{\qtj} & Integer & 1 & No & A quantization type index. \\ +\locvar{\pli} & Integer & 2 & No & A color plane index. +See Table~\ref{tab:color-planes}.\\ +\locvar{\plj} & Integer & 2 & No & A color plane index. \\ +\locvar{\qi} & Integer & 6 & No & The quantization index. \\ +\locvar{\ci} & Integer & 6 & No & The DCT coefficient index. \\ +\locvar{\bmi} & Integer & 9 & No & The base matrix index. \\ +\locvar{\qri} & Integer & 6 & No & The quant range index. \\ +\locvar{NBITS} & Integer & 5 & No & The size of fields to read. \\ +\locvar{NEWQR} & Integer & 1 & No & Flag that indicates a new set of quant + ranges will be defined. \\ +\locvar{RPQR} & Integer & 1 & No & Flag that indicates the quant ranges to + copy will come from the same color plane. \\ +\bottomrule\end{tabularx} +\medskip + +The AC scale and DC scale values are defined in two simple tables with 64 + values each, one for each \qi\ value. +The same scale values are used for every quantization type and color plane. + +The base matrices for all quantization types and color planes are stored in a + single table. +These are then referenced by index in several sets of \term{quant ranges}. +The purpose of the quant ranges is to specify which base matrices are used for + which \qi\ values. + +A set of quant ranges is defined for each quantization type and color plane. +To save space in the header, bit flags allow a set of quant ranges to be copied + from a previously defined set instead of being specified explicitly. +Every set except the first one can be copied from the immediately preceding + set. +Similarly, if the quantization type is not $0$, the set can be copied from the + set defined for the same color plane for the preceding quantization type. +This formulation allows compact representation of, for example, the same + set of quant ranges in both chroma channels, as is done in the original VP3, + or the same set of quant ranges in INTRA and INTER modes. + +Each quant range is defined by a size and two base matrix indices, one for each + end of the range. +The base matrix for the end of one range is used as the start of the next + range, so that for $n$ ranges, $n+1$ base matrices are specified. +The base matrices for the \qi\ values between the two endpoints of the range + are generated by linear interpolation. + +%TODO: figure + +The location of the endpoints of each range is encoded by their size. +The \qi\ value for the left end-point is the sum of the sizes of all preceding + ranges, and the \qi\ value for the right end-point adds the size of the + current range. +Thus the sum of the sizes of all the ranges MUST be 63, so that the last range + falls on the last possible \qi\ value. + +The complete set of quantization parameters are decoded as follows: + +\begin{enumerate} +\item +Read a 4-bit unsigned integer. +Assign \locvar{NBITS} the value read, plus one. +\item +For each consecutive value of \locvar{\qi} from $0$ to $63$, inclusive: +\begin{enumerate} +\item +Read an \locvar{NBITS}-bit unsigned integer as + $\bitvar{ACSCALE}[\locvar{\qi}]$. +\end{enumerate} +\item +Read a 4-bit unsigned integer. +Assign \locvar{NBITS} the value read, plus one. +\item +For each consecutive value of \locvar{\qi} from $0$ to $63$, inclusive: +\begin{enumerate} +\item +Read an \locvar{NBITS}-bit unsigned integer as + $\bitvar{DCSCALE}[\locvar{\qi}]$. +\end{enumerate} +\item +Read a 9-bit unsigned integer. +Assign \bitvar{NBMS} the value decoded, plus one. +\bitvar{NBMS} MUST be no greater than 384. +\item +For each consecutive value of \locvar{\bmi} from $0$ to $(\bitvar{NBMS}-1)$, + inclusive: +\begin{enumerate} +\item +For each consecutive value of \locvar{\ci} from $0$ to $63$, inclusive: +\begin{enumerate} +\item +Read an 8-bit unsigned integer as $\bitvar{BMS}[\locvar{\bmi}][\locvar{\ci}]$. +\end{enumerate} +\end{enumerate} +\item +For each consecutive value of \locvar{\qti} from $0$ to $1$, inclusive: +\begin{enumerate} +\item +For each consecutive value of \locvar{\pli} from $0$ to $2$, inclusive: +\begin{enumerate} +\item +If $\locvar{\qti}>0$ or $\locvar{\pli}>0$, read a 1-bit unsigned integer as + \locvar{NEWQR}. +\item +Else, assign \locvar{NEWQR} the value one. +\item +If \locvar{NEWQR} is zero, then we are copying a previously defined set of + quant ranges. +In that case: +\begin{enumerate} +\item +If $\locvar{\qti}>0$, read a 1-bit unsigned integer as \locvar{RPQR}. +\item +Else, assign \locvar{RPQR} the value zero. +\item +If \locvar{RPQR} is one, assign \locvar{\qtj} the value $(\locvar{\qti}-1)$ + and assign \locvar{\plj} the value \locvar{\pli}. +This selects the set of quant ranges defined for the same color plane as this + one, but for the previous quantization type. +\item +Else assign \locvar{\qtj} the value $(3*\locvar{\qti}+\locvar{\pli}-1)//3$ and + assign \locvar{\plj} the value $(\locvar{\pli}+2)\%3$. +This selects the most recent set of quant ranges defined. +\item +Assign $\bitvar{NQRS}[\locvar{\qti}][\locvar{\pli}]$ the value + $\bitvar{NQRS}[\locvar{\qtj}][\locvar{\plj}]$. +\item +Assign $\bitvar{QRSIZES}[\locvar{\qti}][\locvar{\pli}]$ the values in + $\bitvar{QRSIZES}[\locvar{\qtj}][\locvar{\plj}]$. +\item +Assign $\bitvar{QRBMIS}[\locvar{\qti}][\locvar{\pli}]$ the values in + $\bitvar{QRBMIS}[\locvar{\qtj}][\locvar{\plj}]$. +\end{enumerate} +\item +Else, \locvar{NEWQR} is one, which indicates that we are defining a new set of + quant ranges. +In that case: +\begin{enumerate} +\item +Assign $\locvar{\qri}$ the value zero. +\item +Assign $\locvar{\qi}$ the value zero. +\item +Read an $\ilog(\bitvar{NBMS}-1)$-bit unsigned integer as\\ + $\bitvar{QRBMIS}[\locvar{\qti}][\locvar{\pli}][\locvar{\qri}]$. +If this is greater than or equal to \bitvar{NBMS}, stop. +The stream is undecodable. +\item +\label{step:qr-loop} +Read an $\ilog(62-\locvar{\qi})$-bit unsigned integer. +Assign\\ $\bitvar{QRSIZES}[\locvar{\qti}][\locvar{\pli}][\locvar{\qri}]$ the value + read, plus one. +\item +Assign \locvar{\qi} the value $\locvar{\qi}+ + \bitvar{QRSIZES}[\locvar{\qti}][\locvar{\pli}][\locvar{\qri}]$. +\item +Assign \locvar{\qri} the value $\locvar{\qri}+1$. +\item +Read an $\ilog(\bitvar{NBMS}-1)$-bit unsigned integer as\\ + $\bitvar{QRBMIS}[\locvar{\qti}][\locvar{\pli}][\locvar{\qri}]$. +\item +If \locvar{\qi} is less than 63, go back to step~\ref{step:qr-loop}. +\item +If \locvar{\qi} is greater than 63, stop. +The stream is undecodable. +\item +Assign $\bitvar{NQRS}[\locvar{\qti}][\locvar{\pli}]$ the value \locvar{\qri}. +\end{enumerate} +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The quantization parameters are hardcoded in VP3. +The values used are given in Appendix~\ref{app:vp3-quant-params}. + +\subsection{Computing a Quantization Matrix} +\label{sub:quant-mat} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + the DC coefficient for each \qi\ value. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values are used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values are used. \\ +\bitvar{\qti} & Integer & 1 & No & A quantization type index. +See Table~\ref{tab:quant-types}.\\ +\bitvar{\pli} & Integer & 2 & No & A color plane index. +See Table~\ref{tab:color-planes}.\\ +\bitvar{\qi} & Integer & 6 & No & The quantization index. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{QMAT} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of quantization + values for each DCT coefficient in natural order. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\ci} & Integer & 6 & No & The DCT coefficient index. \\ +\locvar{\bmi} & Integer & 9 & No & The base matrix index. \\ +\locvar{\bmj} & Integer & 9 & No & The base matrix index. \\ +\locvar{\qri} & Integer & 6 & No & The quant range index. \\ +\locvar{QISTART} & Integer & 6 & No & The left end-point of the \qi\ range. \\ +\locvar{QIEND } & Integer & 6 & No & The right end-point of the \qi\ range. \\ +\locvar{BM} & \multicolumn{1}{p{40pt}}{Integer array} & + 8 & No & A 64-element array containing the + interpolated base matrix. \\ +\locvar{QMIN} & Integer & 16 & No & The minimum quantization value allowed + for the current coefficient. \\ +\locvar{QSCALE} & Integer & 16 & No & The current scale value. \\ +\bottomrule\end{tabularx} +\medskip + +The following procedure can be used to generate a single quantization matrix + for a given quantization type, color plane, and \qi\ value, given the + quantization parameters decoded in Section~\ref{sub:quant-params}. + +Note that the product of the scale value and the base matrix value is in units + of $100$ths of a pixel value, and thus is divided by $100$ to return it to + units of a single pixel value. +This value is then scaled by four, to match the scaling of the DCT output, + which is also a factor of four larger than the orthonormal version of the + transform. + +\begin{enumerate} +\item +Assign \locvar{\qri} the index of a quant range such that +\begin{displaymath} +\bitvar{\qi} \ge \sum_{\qrj=0}^{\locvar{\qri}-1} + \bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\qrj], +\end{displaymath} + and +\begin{displaymath} +\bitvar{\qi} \le \sum_{\qrj=0}^{\locvar{\qri}} + \bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\qrj], +\end{displaymath} + where summation from $0$ to $-1$ is defined to be zero. +If there is more than one such value of $\locvar{\qri}$, i.e., if \bitvar{\qi} + lies on the boundary between two quant ranges, then the output will be the + same regardless of which one is chosen. +\item +Assign \locvar{QISTART} the value +\begin{displaymath} +\sum_{\qrj=0}^{\qri-1} \bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\qrj]. +\end{displaymath} +\item +Assign \locvar{QIEND} the value +\begin{displaymath} +\sum_{\qrj=0}^{\qri} \bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\qrj]. +\end{displaymath} +\item +Assign \locvar{\bmi} the value + $\bitvar{QRBMIS}[\bitvar{\qti}][\bitvar{\pli}][\qri]$. +\item +Assign \locvar{\bmj} the value + $\bitvar{QRBMIS}[\bitvar{\qti}][\bitvar{\pli}][\qri+1]$. +\item +For each consecutive value of \locvar{\ci} from $0$ to $63$, inclusive: +\begin{enumerate} +\item +Assign $\locvar{BM}[\locvar{\ci}]$ the value +\begin{displaymath} +\begin{split} +(&2*(\locvar{QIEND}-\bitvar{\qi})*\bitvar{BMS}[\locvar{\bmi}][\locvar{\ci}]\\ + &+2*(\bitvar{\qi}- + \locvar{QISTART})*\bitvar{BMS}[\locvar{\bmj}][\locvar{\ci}]\\ + &+\bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\locvar{\qri}])// + (2*\bitvar{QRSIZES}[\bitvar{\qti}][\bitvar{\pli}][\locvar{\qri}]) +\end{split} +\end{displaymath} +\item +Assign \locvar{QMIN} the value given by Table~\ref{tab:qmin} according to + \bitvar{\qti} and \locvar{\ci}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{clr}\toprule +Coefficient & \multicolumn{1}{c}{\bitvar{\qti}} + & \locvar{QMIN} \\\midrule +$\locvar{\ci}=0$ & $0$ (Intra) & $16$ \\ +$\locvar{\ci}>0$ & $0$ (Intra) & $8$ \\ +$\locvar{\ci}=0$ & $1$ (Inter) & $32$ \\ +$\locvar{\ci}>0$ & $1$ (Inter) & $16$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Minimum Quantization Values} +\label{tab:qmin} +\end{table} + +\item +If \locvar{\ci} equals zero, assign $\locvar{QSCALE}$ the value + $\bitvar{DCSCALE}[\bitvar{\qi}]$. +\item +Else, assign $\locvar{QSCALE}$ the value + $\bitvar{ACSCALE}[\bitvar{\qi}]$. +\item +Assign $\bitvar{QMAT}[\locvar{\ci}]$ the value +\begin{displaymath} +\max(\locvar{QMIN}, + \min((\locvar{QSCALE}*\locvar{BM}[\locvar{\ci}]//100)*4,4096)). +\end{displaymath} +\end{enumerate} +\end{enumerate} + +\subsection{DCT Token Huffman Tables} +\label{sub:huffman-tables} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{HTS} & \multicolumn{3}{l}{Huffman table array} + & An 80-element array of Huffman tables + with up to 32 entries each. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{HBITS} & Bit string & 32 & No & A string of up to 32 bits. \\ +\locvar{TOKEN} & Integer & 5 & No & A single DCT token value. \\ +\locvar{ISLEAF} & Integer & 1 & No & Flag that indicates if the current + node of the tree being decoded is a leaf node. \\ +\bottomrule\end{tabularx} +\medskip + +The Huffman tables used to decode DCT tokens are stored in the setup header in + the form of a binary tree. +This enforces the requirements that the code be full---so that any sequence of + bits will produce a valid sequence of tokens---and that the code be + prefix-free so that there is no ambiguity when decoding. + +One more restriction is placed on the tables that is not explicitly enforced by + the bitstream syntax, but nevertheless must be obeyed by compliant encoders. +There must be no more than 32 entries in a single table. +Note that this restriction along with the fullness requirement limit the + maximum size of a single Huffman code to 32 bits. +It is probably a good idea to enforce this latter consequence explicitly when + implementing the decoding procedure as a recursive algorithm, so as to prevent + a possible stack overflow given an invalid bitstream. + +Although there are 32 different DCT tokens, and thus a normal table will have + exactly 32 entries, this is not explicitly required. +It is allowable to use a Huffman code that omits some---but not all---of the + possible token values. +It is also allowable, if not particularly useful, to specify multiple codes for + the same token value in a single table. +Note also that token values may appear in the tree in any order. +In particular, it is not safe to assume that token value zero (which ends a + single block), has a Huffman code of all zeros. + +The tree is decoded as follows: + +\begin{enumerate} +\item +For each consecutive value of \locvar{\hti} from $0$ to $79$, inclusive: +\begin{enumerate} +\item +Set \locvar{HBITS} to the empty string. +\item +\label{step:huff-tree-loop} +If \locvar{HBITS} is longer than 32 bits in length, stop. +The stream is undecodable. +\item +Read a 1-bit unsigned integer as \locvar{ISLEAF}. +\item +If \locvar{ISLEAF} is one: +\begin{enumerate} +\item +If the number of entries in table $\bitvar{HTS}[\locvar{\hti}]$ is already 32, + stop. +The stream is undecodable. +\item +Read a 5-bit unsigned integer as \locvar{TOKEN}. +\item +Add the pair $(\locvar{HBITS},\locvar{TOKEN})$ to Huffman table + $\bitvar{HTS}[\locvar{\hti}]$. +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Add a `0' to the end of \locvar{HBITS}. +\item +Decode the `0' sub-tree using this procedure, starting from + step~\ref{step:huff-tree-loop}. +\item +Remove the `0' from the end of \locvar{HBITS} and add a `1' to the end of + \locvar{HBITS}. +\item +Decode the `1' sub-tree using this procedure, starting from + step~\ref{step:huff-tree-loop}. +\item +Remove the `1' from the end of \locvar{HBITS}. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The DCT token Huffman tables are hardcoded in VP3. +The values used are given in Appendix~\ref{app:vp3-huffman-tables}. + +\subsection{Setup Header Decode} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{LFLIMS} & \multicolumn{1}{p{40pt}}{Integer array} & + 7 & No & A 64-element array of loop filter limit + values. \\ +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + the DC coefficient for each \qi\ value. \\ +\bitvar{NBMS} & Integer & 10 & No & The number of base matrices. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values will be used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values will be used. \\ +\bitvar{HTS} & \multicolumn{3}{l}{Huffman table array} + & An 80-element array of Huffman tables + with up to 32 entries each. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:} None. +\medskip + +The complete setup header is decoded as follows: + +\begin{enumerate} +\item +Decode the common header fields according to the procedure described in + Section~\ref{sub:common-header}. +If \bitvar{HEADERTYPE} returned by this procedure is not \hex{82}, then stop. +This packet is not the setup header. +\item +Decode the loop filter limit value table using the procedure given in + Section~\ref{sub:loop-filter-limits} into \bitvar{LFLIMS}. +\item +Decode the quantization parameters using the procedure given in + Section~\ref{sub:quant-params}. +The results are stored in \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{NBMS}, + \bitvar{BMS}, \bitvar{NQRS}, \bitvar{QRSIZES}, and \bitvar{QRBMIS}. +\item +Decode the DCT token Huffman tables using the procedure given in + Section~\ref{sub:huffman-tables} into \bitvar{HTS}. +\end{enumerate} + +\chapter{Frame Decode} + +This section describes the complete procedure necessary to decode a single + frame. +This begins with the frame header, followed by coded block flags, macro block + modes, motion vectors, block-level \qi\ values, and finally the DCT residual + tokens, which are used to reconstruct the frame. + +\section{Frame Header Decode} +\label{sub:frame-header} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{FTYPE} & Integer & 1 & No & The frame type. \\ +\bitvar{NQIS} & Integer & 2 & No & The number of \qi\ values. \\ +\bitvar{QIS} & \multicolumn{1}{p{40pt}}{Integer array} & + 6 & No & An \bitvar{NQIS}-element array of + \qi\ values. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{MOREQIS} & Integer & 1 & No & A flag indicating there are more + \qi\ values to be decoded. \\ +\bottomrule\end{tabularx} +\medskip + +The frame header selects which type of frame is being decoded, intra or inter, + and contains the list of \qi\ values that will be used in this frame. +The first \qi\ value will be used for {\em all} DC coefficients in all blocks. +This is done to ensure that DC prediction, which is done in the quantized + domain, works as expected. +The AC coefficients, however, can be dequantized using any \qi\ value on the + list, selected on a block-by-block basis. + +\begin{enumerate} +\item +Read a 1-bit unsigned integer. +If the value read is not zero, stop. +This is not a data packet. +\item +Read a 1-bit unsigned integer as \bitvar{FTYPE}. +This is the type of frame being decoded, as given in + Table~\ref{tab:frame-type}. +If this is the first frame being decoded, this MUST be zero. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{cl}\toprule +\bitvar{FTYPE} & Frame Type \\\midrule +$0$ & Intra frame \\ +$1$ & Inter frame \\ +\bottomrule\end{tabular} +\end{center} +\caption{Frame Type Values} +\label{tab:frame-type} +\end{table} + +\item +Read in a 6-bit unsigned integer as $\bitvar{QIS}[0]$. +\item +Read a 1-bit unsigned integer as \locvar{MOREQIS}. +\item +If \locvar{MOREQIS} is zero, set \bitvar{NQIS} to 1. +\item +Otherwise: +\begin{enumerate} +\item +Read in a 6-bit unsigned integer as $\bitvar{QIS}[1]$. +\item +Read a 1-bit unsigned integer as \locvar{MOREQIS}. +\item +If \locvar{MOREQIS} is zero, set \bitvar{NQIS} to 2. +\item +Otherwise: +\begin{enumerate} +\item +Read in a 6-bit unsigned integer as $\bitvar{QIS}[2]$. +\item +Set \bitvar{NQIS} to 3. +\end{enumerate} +\end{enumerate} +\item +If \bitvar{FTYPE} is 0, read a 3-bit unsigned integer. +These bits are reserved. +If this value is not zero, stop. +This frame is not decodable according to this specification. +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The precise format of the frame header is substantially different in Theora + than in VP3. +The original VP3 format includes a larger number of unused, reserved bits that + are required to be zero. +The original VP3 frame header also can contain only a single \qi\ value, + because VP3 does not support block-level \qi\ values and uses the same + \qi\ value for all the coefficients in a frame. + +\section{Run-Length Encoded Bit Strings} + +Two variations of run-length encoding are used to store sequences of bits for + the block coded flags and the block-level \qi\ values. +The procedures to decode these bit sequences are specified in the following two + sections. + +\subsection{Long-Run Bit String Decode} +\label{sub:long-run} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{NBITS} & Integer & 36 & No & The number of bits to decode. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{BITS} & Bit string & & & The decoded bits. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{LEN} & Integer & 36 & No & The number of bits decoded so far. \\ +\locvar{BIT} & Integer & 1 & No & The value associated with the current + run. \\ +\locvar{RLEN} & Integer & 13 & No & The length of the current run. \\ +\locvar{RBITS} & Integer & 4 & No & The number of extra bits needed to + decode the run length. \\ +\locvar{RSTART} & Integer & 6 & No & The start of the possible run-length + values for a given Huffman code. \\ +\locvar{ROFFS} & Integer & 12 & No & The offset from \locvar{RSTART} of the + run-length. \\ +\bottomrule\end{tabularx} +\medskip + +There is no practical limit to the number of consecutive 0's and 1's that can + be decoded with this procedure. +In reality, the run length is limited by the number of blocks in a single + frame, because more will never be requested. +A separate procedure described in Section~\ref{sub:short-run} is used when + there is a known limit on the maximum size of the runs. + +For the first run, a single bit value is read, and then a Huffman-coded + representation of a run length is decoded, and that many copies of the bit + value are appended to the bit string. +For each consecutive run, the value of the bit is toggled instead of being read + from the bitstream. + +The only exception is if the length of the previous run was 4129, the maximum + possible length encodable by the Huffman-coded representation. +In this case another bit value is read from the stream, to allow for + consecutive runs of 0's or 1's longer than this maximum. + +Note that in both cases---for the first run and after a run of length 4129---if + no more bits are needed, then no bit value is read. + +The complete decoding procedure is as follows: + +\begin{enumerate} +\item +Assign \locvar{LEN} the value 0. +\item +Assign \bitvar{BITS} the empty string. +\item +If \locvar{LEN} equals \bitvar{NBITS}, return the completely decoded string + \bitvar{BITS}. +\item +Read a 1-bit unsigned integer as \locvar{BIT}. +\item +\label{step:long-run-loop} +Read a bit at a time until one of the Huffman codes given in + Table~\ref{tab:long-run} is recognized. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{lrrl}\toprule +Huffman Code & \locvar{RSTART} & \locvar{RBITS} & Run Lengths \\\midrule +\bin{0} & $1$ & $0$ & $1$ \\ +\bin{10} & $2$ & $1$ & $2\ldots 3$ \\ +\bin{110} & $4$ & $1$ & $4\ldots 5$ \\ +\bin{1110} & $6$ & $2$ & $6\ldots 9$ \\ +\bin{11110} & $10$ & $3$ & $10\ldots 17$ \\ +\bin{111110} & $18$ & $4$ & $18\ldots 33$ \\ +\bin{111111} & $34$ & $12$ & $34\ldots 4129$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Huffman Codes for Long Run Lengths} +\label{tab:long-run} +\end{table} + +\item +Assign \locvar{RSTART} and \locvar{RBITS} the values given in + Table~\ref{tab:long-run} according to the Huffman code read. +\item +Read an \locvar{RBITS}-bit unsigned integer as \locvar{ROFFS}. +\item +Assign \locvar{RLEN} the value $(\locvar{RSTART}+\locvar{ROFFS})$. +\item +Append \locvar{RLEN} copies of \locvar{BIT} to \bitvar{BITS}. +\item +Add \locvar{RLEN} to the value \locvar{LEN}. +\locvar{LEN} MUST be less than or equal to \bitvar{NBITS}. +\item +If \locvar{LEN} equals \bitvar{NBITS}, return the completely decoded string + \bitvar{BITS}. +\item +If \locvar{RLEN} equals 4129, read a 1-bit unsigned integer as \locvar{BIT}. +\item +Otherwise, assign \locvar{BIT} the value $(1-\locvar{BIT})$. +\item +Continue decoding runs from step~\ref{step:long-run-loop}. +\end{enumerate} + +\paragraph{VP3 Compatibility} + +VP3 does not read a new bit value after decoding a run length of 4129. +This limits the maximum number of consecutive 0's or 1's to 4129 in + VP3-compatible streams. +For reasonable video sizes of $1920\times 1080$ or less in 4:2:0 format---the + only pixel format VP3 supports---this does not pose any problems because runs + longer than 4129 are not needed. + +\subsection{Short-Run Bit String Decode} +\label{sub:short-run} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{NBITS} & Integer & 36 & No & The number of bits to decode. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{BITS} & Bit string & & & The decoded bits. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{LEN} & Integer & 36 & No & The number of bits decoded so far. \\ +\locvar{BIT} & Integer & 1 & No & The value associated with the current + run. \\ +\locvar{RLEN} & Integer & 13 & No & The length of the current run. \\ +\locvar{RBITS} & Integer & 4 & No & The number of extra bits needed to + decode the run length. \\ +\locvar{RSTART} & Integer & 6 & No & The start of the possible run-length + values for a given Huffman code. \\ +\locvar{ROFFS} & Integer & 12 & No & The offset from \locvar{RSTART} of the + run-length. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure is similar to the procedure outlined in + Section~\ref{sub:long-run}, except that the maximum number of consecutive 0's + or 1's is limited to 30. +This is the maximum run length needed when encoding a bit for each of the 16 + blocks in a super block when it is known that not all the bits in a super + block are the same. + +The complete decoding procedure is as follows: + +\begin{enumerate} +\item +Assign \locvar{LEN} the value 0. +\item +Assign \bitvar{BITS} the empty string. +\item +If \locvar{LEN} equals \bitvar{NBITS}, return the completely decoded string + \bitvar{BITS}. +\item +Read a 1-bit unsigned integer as \locvar{BIT}. +\item +\label{step:short-run-loop} +Read a bit at a time until one of the Huffman codes given in + Table~\ref{tab:short-run} is recognized. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{lrrl}\toprule +Huffman Code & \locvar{RSTART} & \locvar{RBITS} & Run Lengths \\\midrule +\bin{0} & $1$ & $1$ & $1\ldots 2$ \\ +\bin{10} & $3$ & $1$ & $3\ldots 4$ \\ +\bin{110} & $5$ & $1$ & $5\ldots 6$ \\ +\bin{1110} & $7$ & $2$ & $7\ldots 10$ \\ +\bin{11110} & $11$ & $2$ & $11\ldots 14$ \\ +\bin{11111} & $15$ & $4$ & $15\ldots 30$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Huffman Codes for Short Run Lengths} +\label{tab:short-run} +\end{table} + +\item +Assign \locvar{RSTART} and \locvar{RBITS} the values given in + Table~\ref{tab:short-run} according to the Huffman code read. +\item +Read an \locvar{RBITS}-bit unsigned integer as \locvar{ROFFS}. +\item +Assign \locvar{RLEN} the value $(\locvar{RSTART}+\locvar{ROFFS})$. +\item +Append \locvar{RLEN} copies of \locvar{BIT} to \bitvar{BITS}. +\item +Add \locvar{RLEN} to the value \locvar{LEN}. +\locvar{LEN} MUST be less than or equal to \bitvar{NBITS}. +\item +If \locvar{LEN} equals \bitvar{NBITS}, return the completely decoded string + \bitvar{BITS}. +\item +Assign \locvar{BIT} the value $(1-\locvar{BIT})$. +\item +Continue decoding runs from step~\ref{step:short-run-loop}. +\end{enumerate} + +\section{Coded Block Flags Decode} +\label{sub:coded-blocks} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{FTYPE} & Integer & 1 & No & The frame type. \\ +\bitvar{NSBS} & Integer & 32 & No & The total number of super blocks in a + frame. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{NBITS} & Integer & 36 & No & The length of a bit string to decode. \\ +\locvar{BITS} & Bit string & & & A decoded set of flags. \\ +\locvar{SBPCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NSBS}-element array of flags + indicating whether or not each super block is partially coded. \\ +\locvar{SBFCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NSBS}-element array of flags + indicating whether or not each non-partially coded super block is fully + coded. \\ +\locvar{\sbi} & Integer & 32 & No & The index of the current super + block. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in coded + order. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure determines which blocks are coded in a given frame. +In an intra frame, it marks all blocks coded. +In an inter frame, however, any or all of the blocks may remain uncoded. +The output is a list of bit flags, one for each block, marking it coded or not + coded. + +It is important to note that flags are still decoded for any blocks which lie + entirely outside the picture region, even though they are not displayed. +Encoders MAY choose to code such blocks. +Decoders MUST faithfully reconstruct such blocks, because their contents can be + used for predictors in future frames. +Flags are \textit{not} decoded for portions of a super block which lie outside + the full frame, as there are no blocks in those regions. + +The complete procedure is as follows: + +\begin{enumerate} +\item +If \bitvar{FTYPE} is zero (intra frame): +\begin{enumerate} +\item +For each consecutive value of \locvar{\bi} from 0 to $(\locvar{NBS}-1)$, assign + $\bitvar{BCODED}[\locvar{\bi}]$ the value one. +\end{enumerate} +\item +Otherwise (inter frame): +\begin{enumerate} +\item +Assign \locvar{NBITS} the value \bitvar{NSBS}. +\item +Read an \locvar{NBITS}-bit bit string into \locvar{BITS}, using the procedure + described in Section~\ref{sub:long-run}. +This represents the list of partially coded super blocks. +\item +For each consecutive value of \locvar{\sbi} from 0 to $(\locvar{NSBS}-1)$, + remove the bit at the head of the string \locvar{BITS} and assign it to + $\locvar{SBPCODED}[\locvar{\sbi}]$. +\item +Assign \locvar{NBITS} the total number of super blocks such that \\ + $\locvar{SBPCODED}[\locvar{\sbi}]$ equals zero. +\item +Read an \locvar{NBITS}-bit bit string into \locvar{BITS}, using the procedure + described in Section~\ref{sub:long-run}. +This represents the list of fully coded super blocks. +\item +For each consecutive value of \locvar{\sbi} from 0 to $(\locvar{NSBS}-1)$ such + that $\locvar{SBPCODED}[\locvar{\sbi}]$ equals zero, remove the bit at the + head of the string \locvar{BITS} and assign it to + $\locvar{SBFCODED}[\locvar{\sbi}]$. +\item +Assign \locvar{NBITS} the number of blocks contained in super blocks where + $\locvar{SBPCODED}[\locvar{\sbi}]$ equals one. +Note that this might {\em not} be equal to 16 times the number of partially + coded super blocks, since super blocks which overlap the edge of the frame + will have fewer than 16 blocks in them. +\item +Read an \locvar{NBITS}-bit bit string into \locvar{BITS}, using the procedure + described in Section~\ref{sub:short-run}. +\item +For each block in coded order---indexed by \locvar{\bi}: +\begin{enumerate} +\item +Assign \locvar{\sbi} the index of the super block containing block + \locvar{\bi}. +\item +If $\locvar{SBPCODED}[\locvar{\sbi}]$ is zero, assign + $\bitvar{BCODED}[\locvar{\bi}]$ the value $\locvar{SBFCODED}[\locvar{\sbi}]$. +\item +Otherwise, remove the bit at the head of the string \locvar{BITS} and assign it + to $\bitvar{BCODED}[\locvar{\bi}]$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\section{Macro Block Coding Modes} +\label{sub:mb-modes} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{FTYPE} & Integer & 1 & No & The frame type. \\ +\bitvar{NMBS} & Integer & 32 & No & The total number of macro blocks in a + frame. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of coding + modes for each macro block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{MSCHEME} & Integer & 3 & No & The mode coding scheme. \\ +\locvar{MALPHABET} & \multicolumn{1}{p{40pt}}{Integer array} + & 3 & No & The list of modes corresponding to each + Huffman code. \\ +\locvar{\mbi} & Integer & 32 & No & The index of the current macro + block. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\mi} & Integer & 3 & No & The index of a Huffman code from + Table~\ref{tab:mode-codes}, starting from $0$. \\ +\bottomrule\end{tabularx} +\medskip + +In an intra frame, every macro block marked as coded in INTRA mode. +In an inter frame, however, a macro block can be coded in one of eight coding + modes, given in Table~\ref{tab:coding-modes}. +All of the blocks in all color planes contained in a macro block will be + assigned the coding mode of that macro block. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{cl}\toprule +Index & Coding Mode \\\midrule +$0$ & INTER\_NOMV \\ +$1$ & INTRA \\ +$2$ & INTER\_MV \\ +$3$ & INTER\_MV\_LAST \\ +$4$ & INTER\_MV\_LAST2 \\ +$5$ & INTER\_GOLDEN\_NOMV \\ +$6$ & INTER\_GOLDEN\_MV \\ +$7$ & INTER\_MV\_FOUR \\ +\bottomrule\end{tabular} +\end{center} +\caption{Macro Block Coding Modes} +\label{tab:coding-modes} +\end{table} + +An important thing to note is that a coding mode is only stored in the + bitstream for a macro block if it has at least one {\em luma} block coded. +A macro block that contains coded blocks in the chroma planes, but not in the + luma plane, MUST be coded in INTER\_NOMV mode. +Thus, no coding mode needs to be decoded for such a macro block. + +Coding modes are encoded using one of eight different schemes. +Schemes 0 through 6 use the same simple Huffman code to represent the mode + numbers, as given in Table~\ref{tab:mode-codes}. +The difference in the schemes is the mode number assigned to each code. +Scheme 0 uses an assignment specified in the bitstream, while schemes 1--6 use + a fixed assignment, also given in Table~\ref{tab:mode-codes}. +Scheme 7 simply codes each mode directly in the bitstream using three bits. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{lccccccc}\toprule +Scheme & $1$ & $2$ & $3$ & $4$ & $5$ & $6$ & $7$ \\\cmidrule{2-7} +Huffman Code & \multicolumn{6}{c}{Coding Mode} & \locvar{\mi} \\\midrule +\bin{0} & $3$ & $3$ & $3$ & $3$ & $0$ & $0$ & $0$ \\ +\bin{10} & $4$ & $4$ & $2$ & $2$ & $3$ & $5$ & $1$ \\ +\bin{110} & $2$ & $0$ & $4$ & $0$ & $4$ & $3$ & $2$ \\ +\bin{1110} & $0$ & $2$ & $0$ & $4$ & $2$ & $4$ & $3$ \\ +\bin{11110} & $1$ & $1$ & $1$ & $1$ & $1$ & $2$ & $4$ \\ +\bin{111110} & $5$ & $5$ & $5$ & $5$ & $5$ & $1$ & $5$ \\ +\bin{1111110} & $6$ & $6$ & $6$ & $6$ & $6$ & $6$ & $6$ \\ +\bin{1111111} & $7$ & $7$ & $7$ & $7$ & $7$ & $7$ & $7$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Macro Block Mode Schemes} +\label{tab:mode-codes} +\end{table} + +\begin{enumerate} +\item +If \bitvar{FTYPE} is 0 (intra frame): +\begin{enumerate} +\item +For each consecutive value of \locvar{\mbi} from 0 to $(\bitvar{NMBS}-1)$, + inclusive, assign $\bitvar{MBMODES}[\mbi]$ the value 1 (INTRA). +\end{enumerate} +\item +Otherwise (inter frame): +\begin{enumerate} +\item +Read a 3-bit unsigned integer as \locvar{MSCHEME}. +\item +If \locvar{MSCHEME} is 0: +\begin{enumerate} +\item +For each consecutive value of \locvar{MODE} from 0 to 7, inclusive: +\begin{enumerate} +\item +Read a 3-bit unsigned integer as \locvar{\mi}. +\item +Assign $\locvar{MALPHABET}[\mi]$ the value \locvar{MODE}. +\end{enumerate} +\end{enumerate} +\item +Otherwise, if \locvar{MSCHEME} is not 7, assign the entries of + \locvar{MALPHABET} the values in the corresponding column of + Table~\ref{tab:mode-codes}. +\item +For each consecutive macro block in coded order (cf. + Section~\ref{sec:mbs})---indexed by \locvar{\mbi}: +\begin{enumerate} +\item +If a block \locvar{\bi} in the luma plane of macro block \locvar{\mbi} exists + such that $\bitvar{BCODED}[\locvar{\bi}]$ is 1: +\begin{enumerate} +\item +If \locvar{MSCHEME} is not 7, read one bit at a time until one of the Huffman + codes in Table~\ref{tab:mode-codes} is recognized, and assign + $\bitvar{MBMODES}[\locvar{\mbi}]$ the value + $\locvar{MALPHABET}[\locvar{\mi}]$, where \locvar{\mi} is the index of the + Huffman code decoded. +\item +Otherwise, read a 3-bit unsigned integer as $\bitvar{MBMODES}[\locvar{\mbi}]$. +\end{enumerate} +\item +Otherwise, if no luma-plane blocks in the macro block are coded, assign + $\bitvar{MBMODES}[\locvar{\mbi}]$ the value 0 (INTER\_NOMV). +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\section{Motion Vectors} + +In an intra frame, no motion vectors are used, and so motion vector decoding is + skipped. +In an inter frame, however, many of the inter coding modes require a motion + vector in order to specify an offset into the reference frame from which to + predict a block. +These procedures assigns such a motion vector to every block. + +\subsection{Motion Vector Decode} +\label{sub:mv-decode} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{MVMODE} & Integer & 1 & No & The motion vector decoding method. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{MVX} & Integer & 6 & Yes & The X component of the motion + vector. \\ +\bitvar{MVY} & Integer & 6 & Yes & The Y component of the motion + vector. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{MVSIGN} & Integer & 1 & No & The sign of the motion vector component + just decoded. \\ +\bottomrule\end{tabularx} +\medskip + +The individual components of a motion vector can be coded using one of two + methods. +The first uses a variable length Huffman code, given in + Table~\ref{tab:mv-huff-codes}. +The second encodes the magnitude of the component directly in 5 bits, and the + sign in one bit. +Note that in this case there are two representations for the value zero. +For compatibility with VP3, a sign bit is read even if the magnitude read is + zero. +One scheme is chosen and used for the entire frame. + +Each component can take on integer values from $-31\ldots 31$, inclusive, at + half-pixel resolution, i.e. $-15.5\ldots 15.5$ pixels in the luma plane. +For each subsampled axis in the chroma planes, the corresponding motion vector + component is interpreted as being at quarter-pixel resolution, i.e. + $-7.75\ldots 7.75$ pixels. +The precise details of how these vectors are used to compute predictors for + each block are described in Section~\ref{sec:predictors}. + +\begin{table}[ht] +\begin{center} +\begin{tabular}{lrlr}\toprule +Huffman Code & Value & Huffman Code & Value \\\midrule +\bin{000} & $0$ \\ +\bin{001} & $1$ & \bin{010} & $-1$ \\ +\bin{0110} & $2$ & \bin{0111} & $-2$ \\ +\bin{1000} & $3$ & \bin{1001} & $-3$ \\ +\bin{101000} & $4$ & \bin{101001} & $-4$ \\ +\bin{101010} & $5$ & \bin{101011} & $-5$ \\ +\bin{101100} & $6$ & \bin{101101} & $-6$ \\ +\bin{101110} & $7$ & \bin{101111} & $-7$ \\ +\bin{1100000} & $8$ & \bin{1100001} & $-8$ \\ +\bin{1100010} & $9$ & \bin{1100011} & $-9$ \\ +\bin{1100100} & $10$ & \bin{1100101} & $-10$ \\ +\bin{1100110} & $11$ & \bin{1100111} & $-11$ \\ +\bin{1101000} & $12$ & \bin{1101001} & $-12$ \\ +\bin{1101010} & $13$ & \bin{1101011} & $-13$ \\ +\bin{1101100} & $14$ & \bin{1101101} & $-14$ \\ +\bin{1101110} & $15$ & \bin{1101111} & $-15$ \\ +\bin{11100000} & $16$ & \bin{11100001} & $-16$ \\ +\bin{11100010} & $17$ & \bin{11100011} & $-17$ \\ +\bin{11100100} & $18$ & \bin{11100101} & $-18$ \\ +\bin{11100110} & $19$ & \bin{11100111} & $-19$ \\ +\bin{11101000} & $20$ & \bin{11101001} & $-20$ \\ +\bin{11101010} & $21$ & \bin{11101011} & $-21$ \\ +\bin{11101100} & $22$ & \bin{11101101} & $-22$ \\ +\bin{11101110} & $23$ & \bin{11101111} & $-23$ \\ +\bin{11110000} & $24$ & \bin{11110001} & $-24$ \\ +\bin{11110010} & $25$ & \bin{11110011} & $-25$ \\ +\bin{11110100} & $26$ & \bin{11110101} & $-26$ \\ +\bin{11110110} & $27$ & \bin{11110111} & $-27$ \\ +\bin{11111000} & $28$ & \bin{11111001} & $-28$ \\ +\bin{11111010} & $29$ & \bin{11111011} & $-29$ \\ +\bin{11111100} & $30$ & \bin{11111101} & $-30$ \\ +\bin{11111110} & $31$ & \bin{11111111} & $-31$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Huffman Codes for Motion Vector Components} +\label{tab:mv-huff-codes} +\end{table} + +A single motion vector is decoded is follows: + +\begin{enumerate} +\item +If \bitvar{MVMODE} is 0: +\begin{enumerate} +\item +Read 1 bit at a time until one of the Huffman codes in + Table~\ref{tab:mv-huff-codes} is recognized, and assign the value to + \locvar{MVX}. +\item +Read 1 bit at a time until one of the Huffman codes in + Table~\ref{tab:mv-huff-codes} is recognized, and assign the value to + \locvar{MVY}. +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Read a 5-bit unsigned integer as \bitvar{MVX}. +\item +Read a 1-bit unsigned integer as \locvar{MVSIGN}. +\item +If \locvar{MVSIGN} is 1, assign \bitvar{MVX} the value $-\bitvar{MVX}$. +\item +Read a 5-bit unsigned integer as \bitvar{MVY}. +\item +Read a 1-bit unsigned integer as \locvar{MVSIGN}. +\item +If \locvar{MVSIGN} is 1, assign \bitvar{MVY} the value $-\bitvar{MVY}$. +\end{enumerate} +\end{enumerate} + +\subsection{Macro Block Motion Vector Decode} +\label{sub:mb-mv-decode} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{PF} & Integer & 2 & No & The pixel format. \\ +\bitvar{NMBS} & Integer & 32 & No & The total number of macro blocks in a + frame. \\ +\bitvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of coding + modes for each macro block. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{MVECTS} & \multicolumn{1}{p{50pt}}{Array of 2D Integer Vectors} & + 6 & Yes & An \bitvar{NBS}-element array of + motion vectors for each block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{LAST1} & \multicolumn{1}{p{50pt}}{2D Integer Vector} & + 6 & Yes & The last motion vector. \\ +\locvar{LAST2} & \multicolumn{1}{p{50pt}}{2D Integer Vector} & + 6 & Yes & The second to last motion vector. \\ +\locvar{MVX} & Integer & 6 & Yes & The X component of a motion vector. \\ +\locvar{MVY} & Integer & 6 & Yes & The Y component of a motion vector. \\ +\locvar{\mbi} & Integer & 32 & No & The index of the current macro + block. \\ +\locvar{A} & Integer & 36 & No & The index of the lower-left luma block + in the macro block. \\ +\locvar{B} & Integer & 36 & No & The index of the lower-right luma + block in the macro block. \\ +\locvar{C} & Integer & 36 & No & The index of the upper-left luma block + in the macro block. \\ +\locvar{D} & Integer & 36 & No & The index of the upper-right luma + block in the macro block. \\ +\locvar{E} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{F} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{G} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{H} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{I} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{J} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{K} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\locvar{L} & Integer & 36 & No & The index of a chroma block in the + macro block, depending on the pixel format. \\ +\bottomrule\end{tabularx} +\medskip + +Motion vectors are stored for each macro block. +In every mode except for INTER\_MV\_FOUR, every block in all the color planes + are assigned the same motion vector. +In INTER\_MV\_FOUR mode, all four blocks in the luma plane are assigned their + own motion vector, and motion vectors for blocks in the chroma planes are + computed from these, using averaging appropriate to the pixel format. + +For INTER\_MV and INTER\_GOLDEN\_MV modes, a single motion vector is decoded + and applied to each block. +For INTER\_MV\_FOUR macro blocks, a motion vector is decoded for each coded + luma block, in raster order, not coded order. +Uncoded luma blocks receive the default $(0,0)$ vector for the purposes of + computing the chroma motion vectors. + +None of the remaining macro block coding modes require decoding motion vectors + from the stream. +INTRA mode does not use a motion-compensated predictor, and thus does not + require a motion vector. +Both the INTER\_NOMV and the INTER\_GOLDEN\_NOMV modes use the default + vector $(0,0)$ for each block. +This also includes all macro blocks with no coded luma blocks, as they are + coded in INTER\_NOMV mode by definition. + +The modes INTER\_MV\_LAST and INTER\_MV\_LAST2 use the motion vector from the + last macro block (in coded order) and the second to last macro block, + respectively, that contained a motion vector pointing to the previous frame. +Thus no explicit motion vector needs to be decoded for these modes. +Macro blocks coded in INTRA mode or one of the GOLDEN modes are not considered + in this process. +For macro blocks coded in INTER\_MV\_FOUR mode, this process uses the vector + from the last coded luma block in the macro block, again in raster order, not + coded order. +This is usually the upper-right block. +If an insufficient number of macro blocks have been coded in one of the INTER + modes, then the $(0,0)$ vector is used instead. + +The motion vectors are decoded from the stream as follows: + +\begin{enumerate} +\item +Assign \locvar{LAST1} and \locvar{LAST2} both the value $(0,0)$. +\item +Read a 1-bit unsigned integer as \locvar{MVMODE}. +Note that this value is read even if no macro blocks require a motion vector to + be decoded. +\item +For each consecutive value of \locvar{\mbi} from 0 to $(\bitvar{NMBS}-1)$: +\begin{enumerate} +\item +If $\bitvar{MBMODES}[\locvar{\mbi}]$ is 7 (INTER\_MV\_FOUR): +\begin{enumerate} +\item +Let \locvar{A}, \locvar{B}, \locvar{C}, and \locvar{D} be the indices in coded + order \locvar{\bi} of the luma blocks in macro block \locvar{\mbi}, arranged + into raster order. +Thus, \locvar{A} is the index in coded order of the block in the lower left, + \locvar{B} the lower right, \locvar{C} the upper left, and \locvar{D} the + upper right. % TODO: as shown in Figure~REF. +\item If $\bitvar{BCODED}[\locvar{A}]$ is non-zero: +\begin{enumerate} +\item Decode a single motion vector into \locvar{MVX} and \locvar{MVY} using + the procedure described in Section~\ref{sub:mv-decode}. +\item Assign $\bitvar{MVECTS}[\locvar{A}]$ the value + $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item Otherwise, assign $\bitvar{MVECTS}[\locvar{A}]$ the value $(0,0)$. +\item If $\bitvar{BCODED}[\locvar{B}]$ is non-zero: +\begin{enumerate} +\item Decode a single motion vector into \locvar{MVX} and \locvar{MVY} using + the procedure described in Section~\ref{sub:mv-decode}. +\item Assign $\bitvar{MVECTS}[\locvar{B}]$ the value + $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item +Otherwise assign $\bitvar{MVECTS}[\locvar{B}]$ the value $(0,0)$. +\item If $\bitvar{BCODED}[\locvar{C}]$ is non-zero: +\begin{enumerate} +\item Decode a single motion vector into \locvar{MVX} and \locvar{MVY} using + the procedure described in Section~\ref{sub:mv-decode}. +\item Assign $\bitvar{MVECTS}[\locvar{C}]$ the value + $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item Otherwise assign $\bitvar{MVECTS}[\locvar{C}]$ the value $(0,0)$. +\item If $\bitvar{BCODED}[\locvar{D}]$ is non-zero: +\begin{enumerate} +\item Decode a single motion vector into \locvar{MVX} and \locvar{MVY} using + the procedure described in Section~\ref{sub:mv-decode}. +\item Assign $\bitvar{MVECTS}[\locvar{D}]$ the value + $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item +Otherwise, assign $\bitvar{MVECTS}[\locvar{D}]$ the value $(0,0)$. +\item +If \bitvar{PF} is 0 (4:2:0): +\begin{enumerate} +\item +Let \locvar{E} and \locvar{F} be the index in coded order of the one block in + the macro block from the $C_b$ and $C_r$ planes, respectively. +\item +Assign $\bitvar{MVECTS}[\locvar{E}]$ and $\bitvar{MVECTS}[\locvar{F}]$ the + value +\begin{multline*} +(\round\biggl(\frac{\begin{aligned} + \bitvar{MVECTS}[\locvar{A}]_x+\bitvar{MVECTS}[\locvar{B}]_x+\\ + \bitvar{MVECTS}[\locvar{C}]_x+\bitvar{MVECTS}[\locvar{D}]_x + \end{aligned}}{4}\biggr), \\ + \round\biggl(\frac{\begin{aligned} + \bitvar{MVECTS}[\locvar{A}]_y+\bitvar{MVECTS}[\locvar{B}]_y+\\ + \bitvar{MVECTS}[\locvar{C}]_y+\bitvar{MVECTS}[\locvar{D}]_y + \end{aligned}}{4}\biggr)) +\end{multline*} +\end{enumerate} +\item +If \bitvar{PF} is 2 (4:2:2): +\begin{enumerate} +\item +Let \locvar{E} and \locvar{F} be the indices in coded order of the bottom and + top blocks in the macro block from the $C_b$ plane, respectively, and + \locvar{G} and \locvar{H} be the indices in coded order of the bottom and top + blocks in the $C_r$ plane, respectively. %TODO: as shown in Figure~REF. +\item +Assign $\bitvar{MVECTS}[\locvar{E}]$ and $\bitvar{MVECTS}[\locvar{G}]$ the + value +\begin{multline*} +(\round\left(\frac{ + \bitvar{MVECTS}[\locvar{A}]_x+\bitvar{MVECTS}[\locvar{B}]_x}{2}\right), \\ + \round\left(\frac{ + \bitvar{MVECTS}[\locvar{A}]_y+\bitvar{MVECTS}[\locvar{B}]_y}{2}\right)) +\end{multline*} +\item +Assign $\bitvar{MVECTS}[\locvar{F}]$ and $\bitvar{MVECTS}[\locvar{H}]$ the + value +\begin{multline*} +(\round\left(\frac{ + \bitvar{MVECTS}[\locvar{C}]_x+\bitvar{MVECTS}[\locvar{D}]_x}{2}\right), \\ + \round\left(\frac{ + \bitvar{MVECTS}[\locvar{C}]_y+\bitvar{MVECTS}[\locvar{D}]_y}{2}\right)) +\end{multline*} +\end{enumerate} +\item +If \bitvar{PF} is 3 (4:4:4): +\begin{enumerate} +\item +Let \locvar{E}, \locvar{F}, \locvar{G}, and \locvar{H} be the indices + \locvar{\bi} in coded order of the $C_b$ plane blocks in macro block + \locvar{\mbi}, arranged into raster order, and \locvar{I}, \locvar{J}, + \locvar{K}, and \locvar{L} be the indices \locvar{\bi} in coded order of the + $C_r$ plane blocks in macro block \locvar{\mbi}, arranged into raster order. + %TODO: as shown in Figure~REF. +\item +Assign $\bitvar{MVECTS}[\locvar{E}]$ and $\bitvar{MVECTS}[\locvar{I}]$ the + value \\ $\bitvar{MVECTS}[\locvar{A}]$. +\item +Assign $\bitvar{MVECTS}[\locvar{F}]$ and $\bitvar{MVECTS}[\locvar{J}]$ the + value \\ $\bitvar{MVECTS}[\locvar{B}]$. +\item +Assign $\bitvar{MVECTS}[\locvar{G}]$ and $\bitvar{MVECTS}[\locvar{K}]$ the + value \\ $\bitvar{MVECTS}[\locvar{C}]$. +\item +Assign $\bitvar{MVECTS}[\locvar{H}]$ and $\bitvar{MVECTS}[\locvar{L}]$ the + value \\ $\bitvar{MVECTS}[\locvar{D}]$. +\end{enumerate} +\item +Assign \locvar{LAST2} the value \locvar{LAST1}. +\item +Assign \locvar{LAST1} the value $(\locvar{MVX},\locvar{MVY})$. +This is the value of the motion vector decoded from the last coded luma block + in raster order. +There must always be at least one, since macro blocks with no coded luma blocks + must use mode 0:~INTER\_NOMV. +\end{enumerate} +\item +Otherwise, if $\bitvar{MBMODES}[\locvar{\mbi}]$ is 6 (INTER\_GOLDEN\_MV), + decode a single motion vector into \locvar{MVX} and \locvar{MVY} using the + procedure described in Section~\ref{sub:mv-decode}. +\item +Otherwise, if $\bitvar{MBMODES}[\locvar{\mbi}]$ is 4 (INTER\_MV\_LAST2): +\begin{enumerate} +\item +Assign $(\locvar{MVX},\locvar{MVY})$ the value \locvar{LAST2}. +\item +Assign \locvar{LAST2} the value \locvar{LAST1}. +\item +Assign \locvar{LAST1} the value $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item +Otherwise, if $\bitvar{MBMODES}[\locvar{\mbi}]$ is 3 (INTER\_MV\_LAST), assign + $(\locvar{MVX},\locvar{MVY})$ the value \locvar{LAST1}. +\item +Otherwise, if $\bitvar{MBMODES}[\locvar{\mbi}]$ is 2 (INTER\_MV): +\begin{enumerate} +\item +Decode a single motion vector into \locvar{MVX} and \locvar{MVY} using the + procedure described in Section~\ref{sub:mv-decode}. +\item +Assign \locvar{LAST2} the value \locvar{LAST1}. +\item +Assign \locvar{LAST1} the value $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\item +Otherwise ($\bitvar{MBMODES}[\locvar{\mbi}]$ is 5:~INTER\_GOLDEN\_NOMV, + 1:~INTRA, or 0:~INTER\_NOMV), assign \locvar{MVX} and \locvar{MVY} the value + zero. +\item +If $\bitvar{MBMODES}[\locvar{\mbi}]$ is not 7 (not INTER\_MV\_FOUR), then for + each coded block \locvar{\bi} in macro block \locvar{\mbi}: +\begin{enumerate} +\item +Assign $\bitvar{MVECTS}[\locvar{\bi}]$ the value $(\locvar{MVX},\locvar{MVY})$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +Unless all four luma blocks in the macro block are coded, the VP3 encoder does + not select mode INTER\_MV\_FOUR. +Theora removes this restriction by treating the motion vector for an uncoded + luma block as the default $(0,0)$ vector. +This is consistent with the premise that the block has not changed since the + previous frame and that chroma information can be largely ignored when + estimating motion. + +No modification is required for INTER\_MV\_FOUR macro blocks in VP3 streams to + be decoded correctly by a Theora decoder. +However, regardless of how many of the luma blocks are actually coded, the VP3 + decoder always reads four motion vectors from the stream for INTER\_MV\_FOUR + mode. +The motion vectors read are used to calculate the motion vectors for the chroma + blocks, but are otherwise ignored. +Thus, care should be taken when creating Theora streams meant to be backwards + compatible with VP3 to only use INTER\_MV\_FOUR mode when all four luma + blocks are coded. + +\section{Block-Level \qi\ Decode} +\label{sub:block-qis} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bitvar{NQIS} & Integer & 2 & No & The number of \qi\ values. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{QIIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 2 & No & An \bitvar{NBS}-element array of + \locvar{\qii} values for each block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{NBITS} & Integer & 36 & No & The length of a bit string to decode. \\ +\locvar{BITS} & Bit string & & & A decoded set of flags. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\qii} & Integer & 2 & No & The index of \qi\ value in the list of + \qi\ values defined for this frame. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure selects the \qi\ value to be used for dequantizing the AC + coefficients of each block. +DC coefficients all use the same \qi\ value, so as to avoid interference with + the DC prediction mechanism, which occurs in the quantized domain. + +The value is actually represented by an index \locvar{\qii} into the list of + \qi\ values defined for the frame. +The decoder makes multiple passes through the list of coded blocks, one for + each \qi\ value except the last one. +In each pass, an RLE-coded bitmask is decoded to divide the blocks into two + groups: those that use the current \qi\ value in the list, and those that use + a value from later in the list. +Each subsequent pass is restricted to the blocks in the second group. + +\begin{enumerate} +\item +For each value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$, assign + $\bitvar{QIIS}[\locvar{\bi}]$ the value zero. +\item +For each consecutive value of \locvar{\qii} from 0 to $(\bitvar{NQIS}-2)$: +\begin{enumerate} +\item +Assign \locvar{NBITS} be the number of blocks \locvar{\bi} such that + $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero and $\bitvar{QIIS}[\locvar{\bi}]$ + equals $\locvar{\qii}$. +\item +Read an \locvar{NBITS}-bit bit string into \locvar{BITS}, using the procedure + described in Section~\ref{sub:long-run}. +This represents the list of blocks that use \qi\ value \locvar{\qii} or higher. +\item +For each consecutive value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$ such + that $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero and + $\bitvar{QIIS}[\locvar{\bi}]$ equals $\locvar{\qii}$: +\begin{enumerate} +\item +Remove the bit at the head of the string \locvar{BITS} and add its value to + $\bitvar{QIIS}[\locvar{\bi}]$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +For VP3 compatible streams, only one \qi\ value can be specified in the frame + header, so the main loop of the above procedure, which would iterate from $0$ + to $-1$, is never executed. +Thus, no bits are read, and each block uses the one \qi\ value defined for the + frame. + +\cleardoublepage + +\section{DCT Coefficients} +\label{sec:dct-decode} + +The quantized DCT coefficients are decoded by making 64 passes through the list + of coded blocks, one for each token index in zig-zag order. +For the DC tokens, two Huffman tables are chosen from among the first 16, one + for the luma plane and one for the chroma planes. +The AC tokens, however, are divided into four different groups. +Again, two 4-bit indices are decoded, one for the luma plane, and one for the + chroma planes, but these select the codebooks for {\em all four} groups. +AC coefficients in group one use codebooks $16\ldots 31$, while group two uses + $32\ldots 47$, etc. +Note that this second set of indices is decoded even if there are no non-zero + AC coefficients in the frame. + +Tokens are divided into two major types: EOB tokens, which fill the remainder + of one or more blocks with zeros, and coefficient tokens, which fill in one or + more coefficients within a single block. +A decoding procedure for the first is given in Section~\ref{sub:eob-token}, and + for the second in Section~\ref{sub:coeff-token}. +The decoding procedure for the complete set of quantized coefficients is given + in Section~\ref{sub:dct-coeffs}. + +\subsection{EOB Token Decode} +\label{sub:eob-token} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{TOKEN} & Integer & 5 & No & The token being decoded. +This must be in the range $0\ldots 6$. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{TIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + current token index for each block. \\ +\bitvar{NCOEFFS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + coefficient count for each block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\bitvar{\ti} & Integer & 6 & No & The current token index. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{TIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + current token index for each block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{EOBS} & Integer & 36 & No & The remaining length of the current + EOB run. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\bj} & Integer & 36 & No & Another index of a block in coded + order. \\ +\locvar{\tj} & Integer & 6 & No & Another token index. \\ +\bottomrule\end{tabularx} +\medskip + +A summary of the EOB tokens is given in Table~\ref{tab:eob-tokens}. +An important thing to note is that token 6 does not add an offset to the + decoded run value, even though in general it should only be used for runs of + size 32 or longer. +If a value of zero is decoded for this run, it is treated as an EOB run the + size of the remaining coded blocks. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{ccl}\toprule +Token Value & Extra Bits & EOB Run Lengths \\\midrule +$0$ & $0$ & $1$ \\ +$1$ & $0$ & $2$ \\ +$2$ & $0$ & $3$ \\ +$3$ & $2$ & $4\ldots 7$ \\ +$4$ & $3$ & $8\ldots 15$ \\ +$5$ & $4$ & $16\ldots 31$ \\ +$6$ & $12$ & $1\ldots 4095$, or all remaining blocks \\ +\bottomrule\end{tabular} +\end{center} +\caption{EOB Token Summary} +\label{tab:eob-tokens} +\end{table} + +There is no restriction that one EOB token cannot be immediately followed by + another, so no special cases are necessary to extend the range of the maximum + run length as were required in Section~\ref{sub:long-run}. +Indeed, depending on the lengths of the Huffman codes, it may even cheaper to + encode, by way of example, an EOB run of length 31 followed by an EOB run of + length 1 than to encode an EOB run of length 32 directly. +There is also no restriction that an EOB run stop at the end of a color plane + or a token index. +The run MUST, however, end at or before the end of the frame. + +\begin{enumerate} +\item +If \bitvar{TOKEN} is 0, assign \bitvar{EOBS} the value 1. +\item +Otherwise, if \bitvar{TOKEN} is 1, assign \bitvar{EOBS} the value 2. +\item +Otherwise, if \bitvar{TOKEN} is 2, assign \bitvar{EOBS} the value 3. +\item +Otherwise, if \bitvar{TOKEN} is 3: +\begin{enumerate} +\item +Read a 2-bit unsigned integer as \bitvar{EOBS}. +\item +Assign \bitvar{EOBS} the value $(\bitvar{EOBS}+4)$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 4: +\begin{enumerate} +\item +Read a 3-bit unsigned integer as \bitvar{EOBS}. +\item +Assign \bitvar{EOBS} the value $(\bitvar{EOBS}+8)$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 5: +\begin{enumerate} +\item +Read a 4-bit unsigned integer as \bitvar{EOBS}. +\item +Assign \bitvar{EOBS} the value $(\bitvar{EOBS}+16)$. +\end{enumerate} +\item +Otherwise, \bitvar{TOKEN} is 6: +\begin{enumerate} +\item +Read a 12-bit unsigned integer as \bitvar{EOBS}. +\item +If \bitvar{EOBS} is zero, assign \bitvar{EOBS} to be the number of coded blocks + \locvar{\bj} such that $\bitvar{TIS}[\locvar{\bj}]$ is less than 64. +\end{enumerate} +\item +For each value of \locvar{\tj} from $\bitvar{\ti}$ to 63, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value 64. +\item +Assign \bitvar{EOBS} the value $(\bitvar{EOBS}-1)$. +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The VP3 encoder does not use the special interpretation of a zero-length EOB + run, though its decoder {\em does} support it. +That may be due more to a happy accident in the way the decoder was written + than intentional design, however, and other VP3 implementations might not + reproduce it faithfully. +For backwards compatibility, it may be wise to avoid it, especially as for most + frame sizes there are fewer than 4095 blocks, making it unnecessary. + +\subsection{Coefficient Token Decode} +\label{sub:coeff-token} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{TOKEN} & Integer & 5 & No & The token being decoded. +This must be in the range $7\ldots 31$. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{TIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + current token index for each block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\bitvar{\ti} & Integer & 6 & No & The current token index. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{TIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + current token index for each block. \\ +\bitvar{NCOEFFS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + coefficient count for each block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{SIGN} & Integer & 1 & No & A flag indicating the sign of the + current coefficient. \\ +\locvar{MAG} & Integer & 10 & No & The magnitude of the current + coefficient. \\ +\locvar{RLEN} & Integer & 6 & No & The length of the current zero run. \\ +\locvar{\tj} & Integer & 6 & No & Another token index. \\ +\bottomrule\end{tabularx} +\medskip + +Each of these tokens decodes one or more coefficients in the current block. +A summary of the meanings of the token values is presented in + Table~\ref{tab:coeff-tokens}. +There are often several different ways to tokenize a given coefficient list. +Which one is optimal depends on the exact lengths of the Huffman codes used to + represent each token. +Note that we do not update the coefficient count for the block if we decode a + pure zero run. + +\begin{table}[htbp] +\begin{center} +\begin{tabularx}{\textwidth}{cclX}\toprule +Token Value & Extra Bits & \multicolumn{1}{p{55pt}}{Number of Coefficients} + & Description \\\midrule +$7$ & $3$ & $1\ldots 8$ & Short zero run. \\ +$8$ & $6$ & $1\ldots 64$ & Zero run. \\ +$9$ & $0$ & $1$ & $1$. \\ +$10$ & $0$ & $1$ & $-1$. \\ +$11$ & $0$ & $1$ & $2$. \\ +$12$ & $0$ & $1$ & $-2$. \\ +$13$ & $1$ & $1$ & $\pm 3$. \\ +$14$ & $1$ & $1$ & $\pm 4$. \\ +$15$ & $1$ & $1$ & $\pm 5$. \\ +$16$ & $1$ & $1$ & $\pm 6$. \\ +$17$ & $2$ & $1$ & $\pm 7\ldots 8$. \\ +$18$ & $3$ & $1$ & $\pm 9\ldots 12$. \\ +$19$ & $4$ & $1$ & $\pm 13\ldots 20$. \\ +$20$ & $5$ & $1$ & $\pm 21\ldots 36$. \\ +$21$ & $6$ & $1$ & $\pm 37\ldots 68$. \\ +$22$ & $10$ & $1$ & $\pm 69\ldots 580$. \\ +$23$ & $1$ & $2$ & One zero followed by $\pm 1$. \\ +$24$ & $1$ & $3$ & Two zeros followed by $\pm 1$. \\ +$25$ & $1$ & $4$ & Three zeros followed by + $\pm 1$. \\ +$26$ & $1$ & $5$ & Four zeros followed by + $\pm 1$. \\ +$27$ & $1$ & $6$ & Five zeros followed by + $\pm 1$. \\ +$28$ & $3$ & $7\ldots 10$ & $6\ldots 9$ zeros followed by + $\pm 1$. \\ +$29$ & $4$ & $11\ldots 18$ & $10\ldots 17$ zeros followed by + $\pm 1$.\\ +$30$ & $2$ & $2$ & One zero followed by + $\pm 2\ldots 3$. \\ +$31$ & $3$ & $3\ldots 4$ & $2\ldots 3$ zeros followed by + $\pm 2\ldots 3$. \\ +\bottomrule\end{tabularx} +\end{center} +\caption{Coefficient Token Summary} +\label{tab:coeff-tokens} +\end{table} + +For tokens which represent more than one coefficient, they MUST NOT bring the + total number of coefficients in the block to more than 64. +Care should be taken in a decoder to check for this, as otherwise it may permit + buffer overflows from invalidly formed packets. +\begin{verse} +{\bf Note:} One way to achieve this efficiently is to combine the inverse + zig-zag mapping (described later in Section~\ref{sub:dequant}) with + coefficient decode, and use a table look-up to map zig-zag indices greater + than 63 to a safe location. +\end{verse} + +\begin{enumerate} +\item +If \bitvar{TOKEN} is 7: +\begin{enumerate} +\item +Read in a 3-bit unsigned integer as \locvar{RLEN}. +\item +Assign \locvar{RLEN} the value $(\locvar{RLEN}+1)$. +\item +For each value of \locvar{\tj} from \bitvar{\ti} to + $(\bitvar{\ti}+\locvar{RLEN}-1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value + $\bitvar{TIS}[\bitvar{\bi}]+\locvar{RLEN}$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 8: +\begin{enumerate} +\item +Read in a 6-bit unsigned integer as \locvar{RLEN}. +\item +Assign \locvar{RLEN} the value $(\locvar{RLEN}+1)$. +\item +For each value of \locvar{\tj} from \bitvar{\ti} to + $(\bitvar{\ti}+\locvar{RLEN}-1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value + $\bitvar{TIS}[\bitvar{\bi}]+\locvar{RLEN}$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 9: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 10: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 11: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $2$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 12: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-2$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 13: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $3$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-3$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 14: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $4$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-4$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 15: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $5$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-5$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 16: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $6$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value $-6$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 17: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 1-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+7)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 18: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 2-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+9)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 19: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 3-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+13)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 20: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 4-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+21)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 21: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 5-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+37)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 22: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 9-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+69)$. +\item +If \locvar{SIGN} is zero, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ + the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 23: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}]$ the value zero. +\item +Read a 1-bit unsigned integer as SIGN. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+1]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+1]$ the value + $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+2$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 24: +\begin{enumerate} +\item +For each value of \locvar{\tj} from \bitvar{\ti} to $(\bitvar{\ti}+1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Read a 1-bit unsigned integer as SIGN. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+2]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+2]$ the value + $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+3$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 25: +\begin{enumerate} +\item +For each value of \locvar{\tj} from \bitvar{\ti} to $(\bitvar{\ti}+2)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Read a 1-bit unsigned integer as SIGN. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+3]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+3]$ the value + $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+4$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 26: +\begin{enumerate} +\item +For each value of \locvar{\tj} from \bitvar{\ti} to $(\bitvar{\ti}+3)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Read a 1-bit unsigned integer as SIGN. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+4]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+4]$ the value + $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+5$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 27: +\begin{enumerate} +\item +For each value of \locvar{\tj} from \bitvar{\ti} to $(\bitvar{\ti}+4)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Read a 1-bit unsigned integer as SIGN. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+5]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+5]$ the value + $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+6$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 28: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 2-bit unsigned integer as \locvar{RLEN}. +\item +Assign \locvar{RLEN} the value $(\locvar{RLEN}+6)$. +\item +For each value of \locvar{\tj} from \bitvar{\ti} to + $(\bitvar{\ti}+\locvar{RLEN}-1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ + the value $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value + $\bitvar{TIS}[\bitvar{\bi}]+\locvar{RLEN}+1$. +\item +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 29: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 3-bit unsigned integer as \locvar{RLEN}. +\item +Assign \locvar{RLEN} the value $(\locvar{RLEN}+10)$. +\item +For each value of \locvar{\tj} from \bitvar{\ti} to + $(\bitvar{\ti}+\locvar{RLEN}-1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ the value $1$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ + the value $-1$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value + $\bitvar{TIS}[\bitvar{\bi}]+\locvar{RLEN}+1$. +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 30: +\begin{enumerate} +\item +Assign $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\ti}]$ the value zero. +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 1-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+2)$. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+1]$ the value $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+1]$ the value + $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]+2$. +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\item +Otherwise, if \bitvar{TOKEN} is 31: +\begin{enumerate} +\item +Read a 1-bit unsigned integer as \locvar{SIGN}. +\item +Read a 1-bit unsigned integer as \locvar{MAG}. +\item +Assign \locvar{MAG} the value $(\locvar{MAG}+2)$. +\item +Read a 1-bit unsigned integer as \locvar{RLEN}. +\item +Assign \locvar{RLEN} the value $(\locvar{RLEN}+2)$. +\item +For each value of \locvar{\tj} from \bitvar{\ti} to + $(\bitvar{\ti}+\locvar{RLEN}-1)$, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\tj}]$ the value zero. +\item +If \locvar{SIGN} is zero, assign + $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ the value + $\locvar{MAG}$. +\item +Otherwise, assign $\bitvar{COEFFS}[\bitvar{\bi}][\bitvar{\ti}+\locvar{RLEN}]$ + the value $-\locvar{MAG}$. +\item +Assign $\bitvar{TIS}[\bitvar{\bi}]$ the value + $\bitvar{TIS}[\bitvar{\bi}]+\locvar{RLEN}+1$. +Assign $\bitvar{NCOEFFS}[\bitvar{\bi}]$ the value $\bitvar{TIS}[\bitvar{\bi}]$. +\end{enumerate} +\end{enumerate} + +\subsection{DCT Coefficient Decode} +\label{sub:dct-coeffs} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bitvar{NMBS} & Integer & 32 & No & The total number of macro blocks in a + frame. \\ +\bitvar{HTS} & \multicolumn{3}{l}{Huffman table array} + & An 80-element array of Huffman tables + with up to 32 entries each. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{NCOEFFS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + coefficient count for each block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{NLBS} & Integer & 34 & No & The number of blocks in the luma + plane. \\ +\locvar{TIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + current token index for each block. \\ +\locvar{EOBS} & Integer & 36 & No & The remaining length of the current + EOB run. \\ +\locvar{TOKEN} & Integer & 5 & No & The current token being decoded. \\ +\locvar{HG} & Integer & 3 & No & The current Huffman table group. \\ +\locvar{\cbi} & Integer & 36 & No & The index of the current block in the + coded block list. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\bj} & Integer & 36 & No & Another index of a block in coded + order. \\ +\locvar{\ti} & Integer & 6 & No & The current token index. \\ +\locvar{\tj} & Integer & 6 & No & Another token index. \\ +\locvar{\hti_L} & Integer & 4 & No & The index of the current Huffman table + to use for the luma plane within a group. \\ +\locvar{\hti_C} & Integer & 4 & No & The index of the current Huffman table + to use for the chroma planes within a group. \\ +\locvar{\hti} & Integer & 7 & No & The index of the current Huffman table + to use. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure puts the above two procedures to work to decode the entire set + of DCT coefficients for the frame. +At the end of this procedure, \locvar{EOBS} MUST be zero, and + $\locvar{TIS}[\locvar{\bi}]$ MUST be 64 for every coded \locvar{\bi}. + +Note that we update the coefficient count of every block before continuing an + EOB run or decoding a token, despite the fact that it is already up to date + unless the previous token was a pure zero run. +This is done intentionally to mimic the VP3 accounting rules. +Thus the only time the coefficient count does not include the coefficients in a + pure zero run is when when that run reaches all the way to coefficient 63. +Note, however, that regardless of the coefficient count, any additional + coefficients are still set to zero. +The only use of the count is in determining if a special case of the inverse + DCT can be used in Section~\ref{sub:2d-idct}. + +\begin{enumerate} +\item +Assign \locvar{NLBS} the value $(\bitvar{NMBS}*4)$. +\item +For each consecutive value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$, + assign $\locvar{TIS}[\locvar{\bi}]$ the value zero. +\item +Assign \locvar{EOBS} the value 0. +\item +For each consecutive value of \locvar{\ti} from 0 to 63: +\begin{enumerate} +\item +If \locvar{\ti} is $0$ or $1$: +\begin{enumerate} +\item +Read a 4-bit unsigned integer as \locvar{\hti_L}. +\item +Read a 4-bit unsigned integer as \locvar{\hti_C}. +\end{enumerate} +\item +For each consecutive value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$ for + which $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero and + $\locvar{TIS}[\locvar{\bi}]$ equals \locvar{\ti}: +\begin{enumerate} +\item +Assign $\bitvar{NCOEFFS}[\locvar{\bi}]$ the value \locvar{\ti}. +\item +If \locvar{EOBS} is greater than zero: +\begin{enumerate} +\item +For each value of \locvar{\tj} from $\locvar{\ti}$ to 63, assign + $\bitvar{COEFFS}[\locvar{\bi}][\locvar{\tj}]$ the value zero. +\item +Assign $\locvar{TIS}[\locvar{\bi}]$ the value 64. +\item +Assign \locvar{EOBS} the value $(\locvar{EOBS}-1)$. +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Assign \locvar{HG} a value based on \locvar{\ti} from + Table~\ref{tab:huff-groups}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{lc}\toprule +\locvar{\ti} & \locvar{HG} \\\midrule +$0$ & $0$ \\ +$1\ldots 5$ & $1$ \\ +$6\ldots 14$ & $2$ \\ +$15\ldots 27$ & $3$ \\ +$28\ldots 63$ & $4$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Huffman Table Groups} +\label{tab:huff-groups} +\end{table} + +\item +If \locvar{\bi} is less than \locvar{NLBS}, assign \locvar{\hti} the value + $(16*\locvar{HG}+\locvar{\hti_L})$. +\item +Otherwise, assign \locvar{\hti} the value + $(16*\locvar{HG}+\locvar{\hti_C})$. +\item +Read one bit at a time until one of the codes in $\bitvar{HTS}[\locvar{\hti}]$ + is recognized, and assign the value to \locvar{TOKEN}. +\item +If \locvar{TOKEN} is less than 7, expand an EOB token using the procedure given + in Section~\ref{sub:eob-token} to update $\locvar{TIS}[\locvar{\bi}]$, + $\bitvar{COEFFS}[\locvar{\bi}]$, and \locvar{EOBS}. +\item +Otherwise, expand a coefficient token using the procedure given in + Section~\ref{sub:coeff-token} to update $\locvar{TIS}[\locvar{\bi}]$, + $\bitvar{COEFFS}[\locvar{\bi}]$, and $\bitvar{NCOEFFS}[\locvar{\bi}]$. +\end{enumerate} +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\section{Undoing DC Prediction} + +The actual value of a DC coefficient decoded by Section~\ref{sec:dct-decode} is + the residual from a predicted value computed by the encoder. +This prediction is only applied to DC coefficients. +Quantized AC coefficients are encoded directly. + +This section describes how to undo this prediction to recover the original + DC coefficients. +The predicted DC value for a block is computed from the DC values of its + immediate neighbors which precede the block in raster order. +Thus, reversing this prediction must procede in raster order, instead of coded + order. + +Note that this step comes before dequantizing the coefficients. +For this reason, DC coefficients are all quantized with the same \qi\ value, + regardless of the block-level \qi\ values decoded in + Section~\ref{sub:block-qis}. +Those \qi\ values are applied only to the AC coefficients. + +\subsection{Computing the DC Predictor} +\label{sub:dc-pred} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bitvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of + coding modes for each macro block. \\ +\bitvar{LASTDC} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & A 3-element array containing the + most recently decoded DC value, one for inter mode and for each reference + frame. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{DCPRED} & Integer & 16 & Yes & The predicted DC value for the current + block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{P} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & A 4-element array indicating which + neighbors can be used for DC prediction. \\ +\locvar{PBI} & \multicolumn{1}{p{40pt}}{Integer Array} & + 36 & No & A 4-element array containing the + coded-order block index of the current block's neighbors. \\ +\locvar{W} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & Yes & A 4-element array of the weights to + apply to each neighboring DC value. \\ +\locvar{PDIV} & Integer & 8 & No & The value to divide the weighted sum + by. \\ +\locvar{\bj} & Integer & 36 & No & The index of a neighboring block in + coded order. \\ +\locvar{\mbi} & Integer & 32 & No & The index of the macro block + containing block \bitvar{\bi}. \\ +\locvar{\mbj} & Integer & 32 & No & The index of the macro block + containing block \locvar{\bj}. \\ +\locvar{\rfi} & Integer & 2 & No & The index of the reference frame + indicated by the coding mode for macro block \locvar{\mbi}. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure outlines how a predictor is formed for a single block. + +The predictor is computed as a weighted sum of the neighboring DC values from + coded blocks which use the same reference frame. +This latter condition is determined only by checking the coding mode for the + block. +Even if the golden frame and the previous frame are in fact the same, e.g. for + the first inter frame after an intra frame, they are still treated as being + different for the purposes of DC prediction. +The weighted sum is divided by a power of two, with truncation towards zero, + and the result is checked for outranging if necessary. + +If there are no neighboring coded blocks which use the same reference frame as + the current block, then the most recent DC value of any block that used that + reference frame is used instead. +If no such block exists, then the predictor is set to zero. + +\begin{enumerate} +\item +Assign \locvar{\mbi} the index of the macro block containing block + \bitvar{\bi}. +\item +Assign \locvar{\rfi} the value of the Reference Frame Index column of + Table~\ref{tab:cm-refs} corresponding to $\bitvar{MBMODES}[\locvar{\mbi}]$. + +\begin{table}[htpb] +\begin{center} +\begin{tabular}{ll}\toprule +Coding Mode & Reference Frame Index \\\midrule +$0$ (INTER\_NOMV) & $1$ (Previous) \\ +$1$ (INTRA) & $0$ (None) \\ +$2$ (INTER\_MV) & $1$ (Previous) \\ +$3$ (INTER\_MV\_LAST) & $1$ (Previous) \\ +$4$ (INTER\_MV\_LAST2) & $1$ (Previous) \\ +$5$ (INTER\_GOLDEN\_NOMV) & $2$ (Golden) \\ +$6$ (INTER\_GOLDEN\_MV) & $2$ (Golden) \\ +$7$ (INTER\_MV\_FOUR) & $1$ (Previous) \\ +\bottomrule\end{tabular} +\end{center} +\caption{Reference Frames for Each Coding Mode} +\label{tab:cm-refs} +\end{table} + +\item +If block \bitvar{\bi} is not along the left edge of the coded frame: +\begin{enumerate} +\item +Assign \locvar{\bj} the coded-order index of block \bitvar{\bi}'s left + neighbor, i.e., in the same row but one column to the left. +\item +If $\bitvar{BCODED}[\bj]$ is not zero: +\begin{enumerate} +\item +Assign \locvar{\mbj} the index of the macro block containing block + \locvar{\bj}. +\item +If the value of the Reference Frame Index column of Table~\ref{tab:cm-refs} + corresonding to $\bitvar{MBMODES}[\locvar{\mbj}]$ equals \locvar{\rfi}: +\begin{enumerate} +\item +Assign $\locvar{P}[0]$ the value $1$. +\item +Assign $\locvar{PBI}[0]$ the value \locvar{\bj}. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[0]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[0]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[0]$ the value zero. + +\item +If block \bitvar{\bi} is not along the left edge nor the bottom edge of the + coded frame: +\begin{enumerate} +\item +Assign \locvar{\bj} the coded-order index of block \bitvar{\bi}'s lower-left + neighbor, i.e., one row down and one column to the left. +\item +If $\bitvar{BCODED}[\bj]$ is not zero: +\begin{enumerate} +\item +Assign \locvar{\mbj} the index of the macro block containing block + \locvar{\bj}. +\item +If the value of the Reference Frame Index column of Table~\ref{tab:cm-refs} + corresonding to $\bitvar{MBMODES}[\locvar{\mbj}]$ equals \locvar{\rfi}: +\begin{enumerate} +\item +Assign $\locvar{P}[1]$ the value $1$. +\item +Assign $\locvar{PBI}[1]$ the value \locvar{\bj}. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[1]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[1]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[1]$ the value zero. + +\item +If block \bitvar{\bi} is not along the bottom edge of the coded frame: +\begin{enumerate} +\item +Assign \locvar{\bj} the coded-order index of block \bitvar{\bi}'s lower + neighbor, i.e., in the same column but one row down. +\item +If $\bitvar{BCODED}[\bj]$ is not zero: +\begin{enumerate} +\item +Assign \locvar{\mbj} the index of the macro block containing block + \locvar{\bj}. +\item +If the value of the Reference Frame Index column of Table~\ref{tab:cm-refs} + corresonding to $\bitvar{MBMODES}[\locvar{\mbj}]$ equals \locvar{\rfi}: +\begin{enumerate} +\item +Assign $\locvar{P}[2]$ the value $1$. +\item +Assign $\locvar{PBI}[2]$ the value \locvar{\bj}. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[2]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[2]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[2]$ the value zero. + +\item +If block \bitvar{\bi} is not along the right edge nor the bottom edge of the + coded frame: +\begin{enumerate} +\item +Assign \locvar{\bj} the coded-order index of block \bitvar{\bi}'s lower-right + neighbor, i.e., one row down and one column to the right. +\item +If $\bitvar{BCODED}[\bj]$ is not zero: +\begin{enumerate} +\item +Assign \locvar{\mbj} the index of the macro block containing block + \locvar{\bj}. +\item +If the value of the Reference Frame Index column of Table~\ref{tab:cm-refs} + corresonding to $\bitvar{MBMODES}[\locvar{\mbj}]$ equals \locvar{\rfi}: +\begin{enumerate} +\item +Assign $\locvar{P}[3]$ the value $1$. +\item +Assign $\locvar{PBI}[3]$ the value \locvar{\bj}. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[3]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[3]$ the value zero. +\end{enumerate} +\item +Otherwise, assign $\locvar{P}[3]$ the value zero. + +\item +If none of the values $\locvar{P}[0]$, $\locvar{P}[1]$, $\locvar{P}[2]$, nor + $\locvar{P}[3]$ are non-zero, then assign \bitvar{DCPRED} the value + $\bitvar{LASTDC}[\locvar{\rfi}]$. +\item +Otherwise: +\begin{enumerate} +\item +Assign the array \locvar{W} and the variable \locvar{PDIV} the values from the + row of Table~\ref{tab:dc-weights} corresonding to the values of each + $\locvar{P}[\idx{i}]$. + +\begin{table}[htb] +\begin{center} +\begin{tabular}{ccccrrrrr}\toprule +\multicolumn{1}{p{25pt}}{\centering$\locvar{P}[0]$ (L)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{P}[1]$ (DL)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{P}[2]$ (D)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{P}[3]$ (DR)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{W}[0]$ (L)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{W}[1]$ (DL)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{W}[2]$ (D)} & +\multicolumn{1}{p{25pt}}{\centering$\locvar{W}[3]$ (DR)} & +\locvar{PDIV} \\\midrule +$1$ & $0$ & $0$ & $0$ & $1$ & $0$ & $0$ & $0$ & $1$ \\ +$0$ & $1$ & $0$ & $0$ & $0$ & $1$ & $0$ & $0$ & $1$ \\ +$1$ & $1$ & $0$ & $0$ & $1$ & $0$ & $0$ & $0$ & $1$ \\ +$0$ & $0$ & $1$ & $0$ & $0$ & $0$ & $1$ & $0$ & $1$ \\ +$1$ & $0$ & $1$ & $0$ & $1$ & $0$ & $1$ & $0$ & $2$ \\ +$0$ & $1$ & $1$ & $0$ & $0$ & $0$ & $1$ & $0$ & $1$ \\ +$1$ & $1$ & $1$ & $0$ & $29$ & $-26$ & $29$ & $0$ & $32$ \\ +$0$ & $0$ & $0$ & $1$ & $0$ & $0$ & $0$ & $1$ & $1$ \\ +$1$ & $0$ & $0$ & $1$ & $75$ & $0$ & $0$ & $53$ & $128$ \\ +$0$ & $1$ & $0$ & $1$ & $0$ & $1$ & $0$ & $1$ & $2$ \\ +$1$ & $1$ & $0$ & $1$ & $75$ & $0$ & $0$ & $53$ & $128$ \\ +$0$ & $0$ & $1$ & $1$ & $0$ & $0$ & $1$ & $0$ & $1$ \\ +$1$ & $0$ & $1$ & $1$ & $75$ & $0$ & $0$ & $53$ & $128$ \\ +$0$ & $1$ & $1$ & $1$ & $0$ & $3$ & $10$ & $3$ & $16$ \\ +$1$ & $1$ & $1$ & $1$ & $29$ & $-26$ & $29$ & $0$ & $32$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Weights and Divisors for Each Set of Available DC Predictors} +\label{tab:dc-weights} +\end{table} + +\item +Assign \bitvar{DCPRED} the value zero. +\item +If $\locvar{P}[0]$ is non-zero, assign \bitvar{DCPRED} the value + $(\bitvar{DCPRED}+\locvar{W}[0]*\bitvar{COEFFS}[\locvar{PBI}[0]][0])$. +\item +If $\locvar{P}[1]$ is non-zero, assign \bitvar{DCPRED} the value + $(\bitvar{DCPRED}+\locvar{W}[1]*\bitvar{COEFFS}[\locvar{PBI}[1]][0])$. +\item +If $\locvar{P}[2]$ is non-zero, assign \bitvar{DCPRED} the value + $(\bitvar{DCPRED}+\locvar{W}[2]*\bitvar{COEFFS}[\locvar{PBI}[2]][0])$. +\item +If $\locvar{P}[3]$ is non-zero, assign \bitvar{DCPRED} the value + $(\bitvar{DCPRED}+\locvar{W}[3]*\bitvar{COEFFS}[\locvar{PBI}[3]][0])$. +\item +Assign \bitvar{DCPRED} the value $(\bitvar{DCPRED}//\locvar{PDIV})$. +\item +If $\locvar{P}[0]$, $\locvar{P}[1]$, and $\locvar{P}[2]$ are all non-zero: +\begin{enumerate} +\item +If $|\bitvar{DCPRED}-\bitvar{COEFFS}[\locvar{PBI}[2]][0]|$ is greater than + $128$, assign \bitvar{DCPRED} the value $\bitvar{COEFFS}[\locvar{PBI}[2]][0]$. +\item +Otherwise, if $|\bitvar{DCPRED}-\bitvar{COEFFS}[\locvar{PBI}[0]][0]|$ is + greater than $128$, assign \bitvar{DCPRED} the value + $\bitvar{COEFFS}[\locvar{PBI}[0]][0]$. +\item +Otherwise, if $|\bitvar{DCPRED}-\bitvar{COEFFS}[\locvar{PBI}[1]][0]|$ is + greater than $128$, assign \bitvar{DCPRED} the value + $\bitvar{COEFFS}[\locvar{PBI}[1]][0]$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\subsection{Inverting the DC Prediction Process} +\label{sub:dc-pred-undo} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\bitvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of + coding modes for each macro block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. The DC + value of each block will be updated. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{LASTDC} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & A 3-element array containing the + most recently decoded DC value, one for inter mode and for each reference + frame. \\ +\locvar{DCPRED} & Integer & 11 & Yes & The predicted DC value for the current + block. \\ +\locvar{DC} & Integer & 17 & Yes & The actual DC value for the current + block. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\mbi} & Integer & 32 & No & The index of the macro block + containing block \locvar{\bi}. \\ +\locvar{\rfi} & Integer & 2 & No & The index of the reference frame + indicated by the coding mode for macro block \locvar{\mbi}. \\ +\locvar{\pli} & Integer & 2 & No & A color plane index. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure describes the complete process of undoing the DC prediction to + recover the original DC values. +Because it is possible to add a value as large as $580$ to the predicted DC + coefficient value at every block, which will then be used to increase the + predictor for the next block, the reconstructed DC value could overflow a + 16-bit integer. +This is handled by truncating the result to a 16-bit signed representation, + simply throwing away any higher bits in the two's complement representation of + the number. + +\begin{enumerate} +\item +For each consecutive value of \locvar{\pli} from $0$ to $2$: +\begin{enumerate} +\item +Assign $\locvar{LASTDC}[0]$ the value zero. +\item +Assign $\locvar{LASTDC}[1]$ the value zero. +\item +Assign $\locvar{LASTDC}[2]$ the value zero. +\item +For each block of color plane \locvar{\pli} in {\em raster} order, with + coded-order index \locvar{\bi}: +\begin{enumerate} +\item +If $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero: +\begin{enumerate} +\item +Compute the value \locvar{DCPRED} using the procedure outlined in + Section~\ref{sub:dc-pred}. +\item +Assign \locvar{DC} the value + $(\bitvar{COEFFS}[\locvar{\bi}][0]+\locvar{DCPRED})$. +\item +Truncate \locvar{DC} to a 16-bit representation by dropping any higher-order + bits. +\item +Assign $\bitvar{COEFFS}[\locvar{\bi}][0]$ the value \locvar{DC}. +\item +Assign \locvar{\mbi} the index of the macro block containing block + \locvar{\bi}. +\item +Assign \locvar{\rfi} the value of the Reference Frame Index column of + Table~\ref{tab:cm-refs} corresponding to $\bitvar{MBMODES}[\locvar{\mbi}]$. +\item +Assign $\locvar{LASTDC}[\rfi]$ the value $\locvar{DC}$. +\end{enumerate} +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\section{Reconstruction} + +At this stage, the complete contents of the data packet have been decoded. +All that remains is to reconstruct the contents of the new frame. +This is applied on a block by block basis, and as each block is independent, + the order they are processed in does not matter. + +\subsection{Predictors} +\label{sec:predictors} + +For each block, a predictor is formed based on its coding mode and motion + vector. +There are three basic types of predictors: the intra predictor, the whole-pixel + predictor, and the half-pixel predictor. +The former is used for all blocks coded in INTRA mode, while all other blocks + use one of the latter two. +The whole-pixel predictor is used if the fractional part of both motion vector + components is zero, otherwise the half-pixel predictor is used. + +\subsubsection{The Intra Predictor} +\label{sub:predintra} + +\paragraph{Input parameters:} None. + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{PRED} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & An $8\times 8$ array of predictor + values to use for INTRA coded blocks. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\idx{bx}} & Integer & 3 & No & The horizontal pixel index in the + block. \\ +\locvar{\idx{by}} & Integer & 3 & No & The vertical pixel index in the + block. \\ +\bottomrule\end{tabularx} +\medskip + +The intra predictor is nothing more than the constant value $128$. +This is applied for the sole purpose of centering the range of possible DC + values for INTRA blocks around zero. + +\begin{enumerate} +\item +For each value of \locvar{\idx{by}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +For each value of \locvar{\idx{bx}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +Assign $\bitvar{PRED}[\locvar{\idx{by}}][\locvar{\idx{bx}}]$ the value $128$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\subsubsection{The Whole-Pixel Predictor} +\label{sub:predfullpel} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RPW} & Integer & 20 & No & The width of the current plane of the + reference frame in pixels. \\ +\bitvar{RPH} & Integer & 20 & No & The height of the current plane of the + reference frame in pixels. \\ +\bitvar{REFP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of the current plane of the reference frame. \\ +\bitvar{BX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the current block. \\ +\bitvar{BY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the current block. \\ +\bitvar{MVX} & Integer & 5 & No & The horizontal component of the block + motion vector. +This is always a whole-pixel value. \\ +\bitvar{MVY} & Integer & 5 & No & The vertical component of the block + motion vector. +This is always a whole-pixel value. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{PRED} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & An $8\times 8$ array of predictor + values to use for INTER coded blocks. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\idx{bx}} & Integer & 3 & Yes & The horizontal pixel index in the + block. \\ +\locvar{\idx{by}} & Integer & 3 & Yes & The vertical pixel index in the + block. \\ +\locvar{\idx{rx}} & Integer & 20 & No & The horizontal pixel index in the + reference frame. \\ +\locvar{\idx{ry}} & Integer & 20 & No & The vertical pixel index in the + reference frame. \\ +\bottomrule\end{tabularx} +\medskip + +The whole pixel predictor simply copies verbatim the contents of the reference + frame pointed to by the block's motion vector. +If the vector points outside the reference frame, then the closest value on the + edge of the reference frame is used instead. +In practice, this is usually implemented by expanding the size of the reference + frame by $8$ or $16$ pixels on each side---depending on whether or not the + corresponding axis is subsampled in the current plane---and copying the border + pixels into this region. + +\begin{enumerate} +\item +For each value of \locvar{\idx{by}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +Assign \locvar{\idx{ry}} the value + $(\bitvar{BY}+\bitvar{MVY}+\locvar{\idx{by}})$. +\item +If \locvar{\idx{ry}} is greater than $(\bitvar{RPH}-1)$, assign + \locvar{\idx{ry}} the value $(\bitvar{RPH}-1)$. +\item +If \locvar{\idx{ry}} is less than zero, assign \locvar{\idx{ry}} the value + zero. +\item +For each value of \locvar{\idx{bx}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +Assign \locvar{\idx{rx}} the value + $(\bitvar{BX}+\bitvar{MVX}+\locvar{\idx{bx}})$. +\item +If \locvar{\idx{rx}} is greater than $(\bitvar{RPW}-1)$, assign + \locvar{\idx{rx}} the value $(\bitvar{RPW}-1)$. +\item +If \locvar{\idx{rx}} is less than zero, assign \locvar{\idx{rx}} the value + zero. +\item +Assign $\bitvar{PRED}[\locvar{\idx{by}}][\locvar{\idx{bx}}]$ the value + $\bitvar{REFP}[\locvar{\idx{ry}}][\locvar{\idx{rx}}]$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\subsubsection{The Half-Pixel Predictor} +\label{sub:predhalfpel} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RPW} & Integer & 20 & No & The width of the current plane of the + reference frame in pixels. \\ +\bitvar{RPH} & Integer & 20 & No & The height of the current plane of the + reference frame in pixels. \\ +\bitvar{REFP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of the current plane of the reference frame. \\ +\bitvar{BX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the current block. \\ +\bitvar{BY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the current block. \\ +\bitvar{MVX} & Integer & 5 & No & The horizontal component of the first + whole-pixel motion vector. \\ +\bitvar{MVY} & Integer & 5 & No & The vertical component of the first + whole-pixel motion vector. \\ +\bitvar{MVX2} & Integer & 5 & No & The horizontal component of the second + whole-pixel motion vector. \\ +\bitvar{MVY2} & Integer & 5 & No & The vertical component of the second + whole-pixel motion vector. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{PRED} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & An $8\times 8$ array of predictor + values to use for INTER coded blocks. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\idx{bx}} & Integer & 3 & Yes & The horizontal pixel index in the + block. \\ +\locvar{\idx{by}} & Integer & 3 & Yes & The vertical pixel index in the + block. \\ +\locvar{\idx{rx1}} & Integer & 20 & No & The first horizontal pixel index in + the reference frame. \\ +\locvar{\idx{ry1}} & Integer & 20 & No & The first vertical pixel index in the + reference frame. \\ +\locvar{\idx{rx2}} & Integer & 20 & No & The second horizontal pixel index in + the reference frame. \\ +\locvar{\idx{ry2}} & Integer & 20 & No & The second vertical pixel index in + the reference frame. \\ +\bottomrule\end{tabularx} +\medskip + +If one or both of the components of the block motion vector is not a + whole-pixel value, then the half-pixel predictor is used. +The half-pixel predictor converts the fractional motion vector into two + whole-pixel motion vectors. +The first is formed by truncating the values of each component towards zero, + and the second is formed by truncating them away from zero. +The contributions from the reference frame at the locations pointed to by each + vector are averaged, truncating towards negative infinity. + +Only two samples from the reference frame contribute to each predictor value, + even if both components of the motion vector have non-zero fractional + components. +Motion vector components with quarter-pixel accuracy in the chroma planes are + treated exactly the same as those with half-pixel accuracy. +Any non-zero fractional part gets rounded one way in the first vector, and the + other way in the second. + +\begin{enumerate} +\item +For each value of \locvar{\idx{by}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +Assign \locvar{\idx{ry1}} the value + $(\bitvar{BY}+\bitvar{MVY1}+\locvar{\idx{by}})$. +\item +If \locvar{\idx{ry1}} is greater than $(\bitvar{RPH}-1)$, assign + \locvar{\idx{ry1}} the value $(\bitvar{RPH}-1)$. +\item +If \locvar{\idx{ry1}} is less than zero, assign \locvar{\idx{ry1}} the value + zero. +\item +Assign \locvar{\idx{ry2}} the value + $(\bitvar{BY}+\bitvar{MVY2}+\locvar{\idx{by}})$. +\item +If \locvar{\idx{ry2}} is greater than $(\bitvar{RPH}-1)$, assign + \locvar{\idx{ry2}} the value $(\bitvar{RPH}-1)$. +\item +If \locvar{\idx{ry2}} is less than zero, assign \locvar{\idx{ry2}} the value + zero. +\item +For each value of \locvar{\idx{bx}} from $0$ to $7$, inclusive: +\begin{enumerate} +\item +Assign \locvar{\idx{rx1}} the value + $(\bitvar{BX}+\bitvar{MVX1}+\locvar{\idx{bx}})$. +\item +If \locvar{\idx{rx1}} is greater than $(\bitvar{RPW}-1)$, assign + \locvar{\idx{rx1}} the value $(\bitvar{RPW}-1)$. +\item +If \locvar{\idx{rx1}} is less than zero, assign \locvar{\idx{rx1}} the value + zero. +\item +Assign \locvar{\idx{rx2}} the value + $(\bitvar{BX}+\bitvar{MVX2}+\locvar{\idx{bx}})$. +\item +If \locvar{\idx{rx2}} is greater than $(\bitvar{RPW}-1)$, assign + \locvar{\idx{rx2}} the value $(\bitvar{RPW}-1)$. +\item +If \locvar{\idx{rx2}} is less than zero, assign \locvar{\idx{rx2}} the value + zero. +\item +Assign $\bitvar{PRED}[\locvar{\idx{by}}][\locvar{\idx{bx}}]$ the value +\begin{equation*} + (\bitvar{REFP}[\locvar{\idx{ry1}}][\locvar{\idx{rx1}}]+ + \bitvar{REFP}[\locvar{\idx{ry2}}][\locvar{\idx{rx2}}])>>1. +\end{equation*} +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\subsection{Dequantization} +\label{sub:dequant} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values for + the DC coefficient for each \qi\ value. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values are used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values are used. \\ +\bitvar{\qti} & Integer & 1 & No & A quantization type index. +See Table~\ref{tab:quant-types}.\\ +\bitvar{\pli} & Integer & 2 & No & A color plane index. +See Table~\ref{tab:color-planes}.\\ +\bitvar{\idx{qi0}} & Integer & 6 & No & The quantization index of the DC + coefficient. \\ +\bitvar{\qi} & Integer & 6 & No & The quantization index of the AC + coefficients. \\ +\bitvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{DQC} & \multicolumn{1}{p{40pt}}{Integer Array} & + 14 & Yes & A $64$-element array of dequantized + DCT coefficients in natural order (cf. Section~\ref{sec:dct-coeffs}). \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{QMAT} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of quantization + values for each DCT coefficient in natural order. \\ +\locvar{\ci} & Integer & 6 & No & The DCT coefficient index in natural + order. \\ +\locvar{\zzi} & Integer & 6 & No & The DCT coefficient index in zig-zag + order. \\ +\locvar{C} & Integer & 29 & Yes & A single dequantized coefficient. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure takes the quantized DCT coefficient values in zig-zag order for + a single block---after DC prediction has been undone---and returns the + dequantized values in natural order. +If large coefficient values are decoded for coarsely quantized coefficients, + the resulting dequantized value can be significantly larger than 16 bits. +Such a coefficient is truncated to a signed 16-bit representation by discarding + the higher-order bits of its twos-complement representation. + +Although this procedure recomputes the quantization matrices from the + parameters in the setup header for each block, there are at most six different + ones used for each color plane. +An efficient implementation could compute them once in advance. + +\begin{enumerate} +\item +Using \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{BMS}, \bitvar{NQRS}, + \bitvar{QRSIZES}, \bitvar{QRBMIS}, \bitvar{\qti}, \bitvar{\pli}, and + \bitvar{\idx{qi0}}, use the procedure given in Section~\ref{sub:quant-mat} to + compute the DC quantization matrix \locvar{QMAT}. +\item +Assign \locvar{C} the value + $\bitvar{COEFFS}[\bitvar{\bi}][0]*\locvar{QMAT}[0]$. +\item +Truncate \locvar{C} to a 16-bit representation by dropping any higher-order + bits. +\item +Assign $\bitvar{DQC}[0]$ the value \locvar{C}. +\item +Using \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{BMS}, \bitvar{NQRS}, + \bitvar{QRSIZES}, \bitvar{QRBMIS}, \bitvar{\qti}, \bitvar{\pli}, and + \bitvar{\qi}, use the procedure given in Section~\ref{sub:quant-mat} to + compute the AC quantization matrix \locvar{QMAT}. +\item +For each value of \locvar{\ci} from 1 to 63, inclusive: +\begin{enumerate} +\item +Assign \locvar{\zzi} the index in zig-zag order corresponding to \locvar{\ci}. +E.g., the value at row $(\locvar{\ci}//8)$ and column $(\locvar{\ci}\%8)$ in + Figure~\ref{tab:zig-zag} +\item +Assign \locvar{C} the value + $\bitvar{COEFFS}[\bitvar{\bi}][\locvar{\zzi}]*\locvar{QMAT}[\locvar{\ci}]$. +\item +Truncate \locvar{C} to a 16-bit representation by dropping any higher-order + bits. +\item +Assign $\bitvar{DQC}[\locvar{\ci}]$ the value \locvar{C}. +\end{enumerate} +\end{enumerate} + +\subsection{The Inverse DCT} + +The 2D inverse DCT is separated into two applications of the 1D inverse DCT. +The transform is first applied to each row, and then applied to each column of + the result. + +Each application of the 1D inverse DCT scales the values by a factor of two + relative to the orthonormal version of the transform, for a total scale factor + of four for the 2D transform. +It is assumed that a similar scale factor is applied during the forward DCT + used in the encoder, so that a division by 16 is required after the transform + has been applied in both directions. +The inclusion of this scale factor allows the integerized transform to operate + with increased precision. +All divisions throughout the transform are implemented with right shifts. +Only the final division by $16$ is rounded, with ties rounded towards positive + infinity. + +All intermediate values are truncated to a 32-bit signed representation by + discarding any higher-order bits in their two's complement representation. +The final output of each 1D transform is truncated to a 16-bit signed value in + the same manner. +In practice, if the high word of a $16\times 16$ bit multiplication can be + obtained directly, 16 bits is sufficient for every calculation except scaling + by $C4$. +Thus we truncate to 16 bits before that multiplication to allow an + implementation entirely in 16-bit registers. +Implementations using larger registers must sign-extend the 16-bit value to + maintain compatibility. + +Note that if 16-bit register are used, overflow in the additions and + subtractions should be handled using \textit{unsaturated} arithmetic. +That is, the high-order bits should be discarded and the low-order bits + retained, instead of clamping the result to the maximum or minimum value. +This allows the maximum flexibility in re-ordering these instructions without + deviating from this specification. + +The 1D transform can only overflow if input coefficients larger than $\pm 6201$ + are present. +However, the result of applying the 2D forward transform on pixel values in the + range $-255\ldots 255$ can be as large as $\pm 8157$ due to the scale factor + of four that is applied, and quantization errors could make this even larger. +Therefore, the coefficients cannot simply be clamped into a valid range before + the transform. + +\subsubsection{The 1D Inverse DCT} +\label{sub:1d-idct} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{Y} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array of DCT + coefficients. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{X} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array of output values. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{T} & \multicolumn{1}{p{40pt}}{Integer Array} & + 32 & Yes & An 8-element array containing the + current value of each signal line. \\ +\locvar{R} & Integer & 32 & Yes & A temporary value. \\ +\bottomrule\end{tabularx} +\medskip + +A compliant decoder MUST use the exact implementation of the inverse DCT + defined in this specification. +Some operations may be re-ordered, but the result must be precisely equivalent. +This is a design decision that limits some avenues of decoder optimization, but + prevents any drift in the prediction loop. +The full inverse DCT described in this section is only used when there is at + least one non-zero AC coefficient. +Otherwise, a special DC-only case is used, which is described below in + step~\ref{step:dc-only-idct} of Section~\ref{sub:recon}. +The DC-only special case is not exactly equivalent to applying the full inverse + transform, because it avoids the intermediate multiplications and truncation, + and it MUST be used in place of the full transform to ensure bit-exact decode. + +Theora uses a 16-bit integerized approximation of of the 8-point 1D inverse DCT + based on the Chen factorization \cite{CSF77}. +It requires 16 multiplications and 26 additions and subtractions. + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{idct} +\end{center} +\caption{Signal Flow Graph for the 1D Inverse DCT} +\label{fig:idct} +\end{figure} + +A signal flow graph of the transformation is presented in + Figure~\ref{fig:idct}. +This graph provides a good visualization of which parts of the transform are + parallelizable. +Time increases from left to right. + +Each signal line is involved in an operation where the line is marked with a + dot $\cdot$ or a circled plus sign $\oplus$. +The constants $\locvar{C}i$ and $\locvar{S}j$ are the 16-bit integer + approximations of $\cos(\frac{i\pi}{16})$ and $\sin(\frac{j\pi}{16})$ listed + in Table~\ref{tab:dct-consts}. +When they appear next to a signal line, the value on that line is scaled by the + given constant. +A circled minus sign $\ominus$ next to a signal line indicates that the value + on that line is negated. + +Operations on a single signal path through the graph cannot be reordered, but + operations on different paths may be, or may be executed in parallel. +Different graphs may be obtainable using the associative, commutative, and + distributive properties of unsaturated arithmetic. +The column of numbers on the left represents an initial permutation of the + input DCT coefficients. +The column on the right represents the unpermuted output. +One can be obtained by bit-reversing the 3-bit binary representation of the + other. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{llr}\toprule +$\locvar{C}i$ & $\locvar{S}j$ & Value \\\midrule +$\locvar{C1}$ & $\locvar{S7}$ & $64277$ \\ +$\locvar{C2}$ & $\locvar{S6}$ & $60547$ \\ +$\locvar{C3}$ & $\locvar{S5}$ & $54491$ \\ +$\locvar{C4}$ & $\locvar{S4}$ & $46341$ \\ +$\locvar{C5}$ & $\locvar{S3}$ & $36410$ \\ +$\locvar{C6}$ & $\locvar{S2}$ & $25080$ \\ +$\locvar{C7}$ & $\locvar{S1}$ & $12785$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{16-bit Approximations of Sines and Cosines} +\label{tab:dct-consts} +\end{table} + +\begin{enumerate} +\item +Assign $\locvar{T}[0]$ the value $\bitvar{Y}[0]+\bitvar{Y}[4]$. +\item +Truncate $\locvar{T}[0]$ to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\locvar{T}[0]$ the value + $\locvar{C4}*\locvar{T}[0]>>16$. +\item +Assign $\locvar{T}[1]$ the value $\bitvar{Y}[0]-\bitvar{Y}[4]$. +\item +Truncate $\locvar{T}[1]$ to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\locvar{T}[1]$ the value $\locvar{C4}*\locvar{T}[1]>>16$. +\item +Assign $\locvar{T}[2]$ the value $(\locvar{C6}*\bitvar{Y}[2]>>16)- + (\locvar{S6}*\bitvar{Y}[6]>>16)$. +\item +Assign $\locvar{T}[3]$ the value $(\locvar{S6}*\bitvar{Y}[2]>>16)+ + (\locvar{C6}*\bitvar{Y}[6]>>16)$. +\item +Assign $\locvar{T}[4]$ the value $(\locvar{C7}*\bitvar{Y}[1]>>16)- + (\locvar{S7}*\bitvar{Y}[7]>>16)$. +\item +Assign $\locvar{T}[5]$ the value $(\locvar{C3}*\bitvar{Y}[5]>>16)- + (\locvar{S3}*\bitvar{Y}[3]>>16)$. +\item +Assign $\locvar{T}[6]$ the value $(\locvar{S3}*\bitvar{Y}[5]>>16)+ + (\locvar{C3}*\bitvar{Y}[3]>>16)$. +\item +Assign $\locvar{T}[7]$ the value $(\locvar{S7}*\bitvar{Y}[1]>>16)+ + (\locvar{C7}*\bitvar{Y}[7]>>16)$. +\item +Assign \locvar{R} the value $\locvar{T}[4]+\locvar{T}[5]$. +\item +Assign $\locvar{T}[5]$ the value $\locvar{T}[4]-\locvar{T}[5]$. +\item +Truncate $\locvar{T}[5]$ to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\locvar{T}[5]$ the value $\locvar{C4}*\locvar{T}[5]>>16$. +\item +Assign $\locvar{T}[4]$ the value $\locvar{R}$. +\item +Assign \locvar{R} the value $\locvar{T}[7]+\locvar{T}[6]$. +\item +Assign $\locvar{T}[6]$ the value $\locvar{T}[7]-\locvar{T}[6]$. +\item +Truncate $\locvar{T}[6]$ to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\locvar{T}[6]$ the value $\locvar{C4}*\locvar{T}[6]>>16$. +\item +Assign $\locvar{T}[7]$ the value $\locvar{R}$. +\item +Assign \locvar{R} the value $\locvar{T}[0]+\locvar{T}[3]$. +\item +Assign $\locvar{T}[3]$ the value $\locvar{T}[0]-\locvar{T}[3]$. +\item +Assign $\locvar{T}[0]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[1]+\locvar{T}[2]$ +\item +Assign $\locvar{T}[2]$ the value $\locvar{T}[1]-\locvar{T}[2]$ +\item +Assign $\locvar{T}[1]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[6]+\locvar{T}[5]$. +\item +Assign $\locvar{T}[5]$ the value $\locvar{T}[6]-\locvar{T}[5]$. +\item +Assign $\locvar{T}[6]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[0]+\locvar{T}[7]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[0]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[1]+\locvar{T}[6]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[1]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[2]+\locvar{T}[5]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[2]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[3]+\locvar{T}[4]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[3]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[3]-\locvar{T}[4]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[4]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[2]-\locvar{T}[5]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[5]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[1]-\locvar{T}[6]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[6]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[0]-\locvar{T}[7]$. +\item +Truncate \locvar{R} to a 16-bit signed representation by dropping any + higher-order bits. +\item +Assign $\bitvar{X}[7]$ the value \locvar{R}. +\end{enumerate} + +\subsubsection{The 2D Inverse DCT} +\label{sub:2d-idct} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{DQC} & \multicolumn{1}{p{40pt}}{Integer Array} & + 14 & Yes & A $64$-element array of dequantized + DCT coefficients in natural order (cf. Section~\ref{sec:dct-coeffs}). \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RES} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $8\times 8$ array containing the + decoded residual for the current block. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{\ci} & Integer & 3 & No & The column index. \\ +\locvar{\ri} & Integer & 3 & No & The row index. \\ +\locvar{Y} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array of 1D iDCT input + values. \\ +\locvar{X} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array of 1D iDCT output + values. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure applies the 1D inverse DCT transform 16 times to a block of + dequantized coefficients: once for each of the 8 rows, and once for each of + the 8 columns of the result. +Note that the coordinate system used for the columns is the same right-handed + coordinate system used by the rest of Theora. +Thus, the column is indexed from bottom to top, not top to bottom. +The final values are divided by sixteen, rounding with ties rounded towards + postive infinity. + +\begin{enumerate} +\item +For each value of \locvar{\ri} from 0 to 7: +\begin{enumerate} +\item +For each value of \locvar{\ci} from 0 to 7: +\begin{enumerate} +\item +Assign $\locvar{Y}[\locvar{\ci}]$ the value + $\bitvar{DQC}[\locvar{\ri}*8+\locvar{\ci}]$. +\end{enumerate} +\item +Compute \locvar{X}, the 1D inverse DCT of \locvar{Y} using the procedure + described in Section~\ref{sub:1d-idct}. +\item +For each value of $\locvar{\ci}$ from 0 to 7: +\begin{enumerate} +\item +Assign $\bitvar{RES}[\locvar{\ri}][\locvar{\ci}]$ the value + $\locvar{X}[\locvar{\ci}]$. +\end{enumerate} +\end{enumerate} +\item +For each value of \locvar{\ci} from 0 to 7: +\begin{enumerate} +\item +For each value of \locvar{\ri} from 0 to 7: +\begin{enumerate} +\item +Assign $\locvar{Y}[\locvar{\ri}]$ the value + $\bitvar{RES}[\locvar{\ri}][\locvar{\ci}]$. +\end{enumerate} +\item +Compute \locvar{X}, the 1D inverse DCT of \locvar{Y} using the procedure + described in Section~\ref{sub:1d-idct}. +\item +For each value of \locvar{\ri} from 0 to 7: +\begin{enumerate} +\item +Assign $\bitvar{RES}[\locvar{\ri}][\locvar{\ci}]$ the value + $(\locvar{X}[\locvar{\ri}]+8)>>4$. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\subsubsection{The 1D Forward DCT (Non-Normative)} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{X} & \multicolumn{1}{p{40pt}}{Integer Array} & + 14 & Yes & An 8-element array of input values. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{Y} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array of DCT + coefficients. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{T} & \multicolumn{1}{p{40pt}}{Integer Array} & + 16 & Yes & An 8-element array containing the + current value of each signal line. \\ +\locvar{R} & Integer & 16 & Yes & A temporary value. \\ +\bottomrule\end{tabularx} +\medskip + +The forward transform used in the encoder is not mandated by this standard as + the inverse one is. +Precise equivalence in the inverse transform alone is all that is required to + guarantee that there is no mismatch in the prediction loop between encoder and + any compliant decoder implementation. +However, a forward transform is provided here as a convenience for implementing + an encoder. +This is the version of the transform used by Xiph.Org's Theora encoder, which + is the same as that used by VP3. +Like the inverse DCT, it is first applied to each row, and then applied to each + column of the result. + +\begin{figure}[htbp] +\begin{center} +\includegraphics[width=\textwidth]{fdct} +\end{center} +\caption{Signal Flow Graph for the 1D Forward DCT} +\label{fig:fdct} +\end{figure} + +The signal flow graph for the forward transform is given in + Figure~\ref{fig:fdct}. +It is largely the reverse of the flow graph given for the inverse DCT. +It is important to note that the signs on the constants in the rotations have + changed, and the \locvar{C4} scale factors on one of the lower butterflies now + appear on the opposite side. +The column of numbers on the left represents the unpermuted input, and the + column on the right the permuted output DCT coefficients. + +A proper division by $2^{16}$ is done after the multiplications instead of a + shift in the forward transform. +This can be implemented quickly by adding an offset of $\hex{FFFF}$ if the + number is negative, and then shifting as before. +This slightly increases the computational complexity of the transform. +Unlike the inverse DCT, 16-bit registers and a $16\times16\rightarrow32$ bit + multiply are sufficient to avoid any overflow, so long as the input is in the + range $-6270\ldots 6270$, which is larger than required. + +\begin{enumerate} +\item +Assign $\locvar{T}[0]$ the value $\bitvar{X}[0]+\bitvar{X}[7]$. +\item +Assign $\locvar{T}[1]$ the value $\bitvar{X}[1]+\bitvar{X}[6]$. +\item +Assign $\locvar{T}[2]$ the value $\bitvar{X}[2]+\bitvar{X}[5]$. +\item +Assign $\locvar{T}[3]$ the value $\bitvar{X}[3]+\bitvar{X}[4]$. +\item +Assign $\locvar{T}[4]$ the value $\bitvar{X}[3]-\bitvar{X}[4]$. +\item +Assign $\locvar{T}[5]$ the value $\bitvar{X}[2]-\bitvar{X}[5]$. +\item +Assign $\locvar{T}[6]$ the value $\bitvar{X}[1]-\bitvar{X}[6]$. +\item +Assign $\locvar{T}[7]$ the value $\bitvar{X}[0]-\bitvar{X}[7]$. +\item +Assign \locvar{R} the value $\locvar{T}[0]+\locvar{T}[3]$. +\item +Assign $\locvar{T}[3]$ the value $\locvar{T}[0]-\locvar{T}[3]$. +\item +Assign $\locvar{T}[0]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[1]+\locvar{T}[2]$. +\item +Assign $\locvar{T}[2]$ the value $\locvar{T}[1]-\locvar{T}[2]$. +\item +Assign $\locvar{T}[1]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[6]-\locvar{T}[5]$. +\item +Assign $\locvar{T}[6]$ the value + $(\locvar{C4}*(\locvar{T}[6]+\locvar{T}[5]))//16$. +\item +Assign $\locvar{T}[5]$ the value $(\locvar{C4}*\locvar{R})//16$. +\item +Assign \locvar{R} the value $\locvar{T}[4]+\locvar{T}[5]$. +\item +Assign $\locvar{T}[5]$ the value $\locvar{T}[4]-\locvar{T}[5]$. +\item +Assign $\locvar{T}[4]$ the value \locvar{R}. +\item +Assign \locvar{R} the value $\locvar{T}[7]+\locvar{T}[6]$. +\item +Assign $\locvar{T}[6]$ the value $\locvar{T}[7]-\locvar{T}[6]$. +\item +Assign $\locvar{T}[7]$ the value \locvar{R}. +\item +Assign $\bitvar{Y}[0]$ the value + $(\locvar{C4}*(\locvar{T}[0]+\locvar{T}[1]))//16$. +\item +Assign $\bitvar{Y}[4]$ the value + $(\locvar{C4}*(\locvar{T}[0]-\locvar{T}[1]))//16$. +\item +Assign $\bitvar{Y}[2]$ the value + $((\locvar{S6}*\locvar{T}[3])//16)+ + ((\locvar{C6}*\locvar{T}[2])//16)$. +\item +Assign $\bitvar{Y}[6]$ the value + $((\locvar{C6}*\locvar{T}[3])//16)- + ((\locvar{S6}*\locvar{T}[2])//16)$. +\item +Assign $\bitvar{Y}[1]$ the value + $((\locvar{S7}*\locvar{T}[7])//16)+ + ((\locvar{C7}*\locvar{T}[4])//16)$. +\item +Assign $\bitvar{Y}[5]$ the value + $((\locvar{S3}*\locvar{T}[6])//16)+ + ((\locvar{C3}*\locvar{T}[5])//16)$. +\item +Assign $\bitvar{Y}[3]$ the value + $((\locvar{C3}*\locvar{T}[6])//16)- + ((\locvar{S3}*\locvar{T}[5])//16)$. +\item +Assign $\bitvar{Y}[7]$ the value + $((\locvar{C7}*\locvar{T}[7])//16)- + ((\locvar{S7}*\locvar{T}[4])//16)$. +\end{enumerate} + +\subsection{The Complete Reconstruction Algorithm} +\label{sub:recon} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values + for AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values + for the DC coefficient for each \qi\ value. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values are used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values are used. \\ +\bitvar{RPYW} & Integer & 20 & No & The width of the $Y'$ plane of the + reference frames in pixels. \\ +\bitvar{RPYH} & Integer & 20 & No & The height of the $Y'$ plane of the + reference frames in pixels. \\ +\bitvar{RPCW} & Integer & 20 & No & The width of the $C_b$ and $C_r$ + planes of the reference frames in pixels. \\ +\bitvar{RPCH} & Integer & 20 & No & The height of the $C_b$ and $C_r$ + planes of the reference frames in pixels. \\ +\bitvar{GOLDREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the golden reference + frame. \\ +\bitvar{PREVREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the previous reference + frame. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of + flags indicating which blocks are coded. \\ +\bitvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of + coding modes for each macro block. \\ +\bitvar{MVECTS} & \multicolumn{1}{p{50pt}}{Array of 2D Integer Vectors} & + 6 & Yes & An \bitvar{NBS}-element array of + motion vectors for each block. \\ +\bitvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\bitvar{NCOEFFS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + coefficient count for each block. \\ +\bitvar{QIS} & \multicolumn{1}{p{40pt}}{Integer array} & + 6 & No & An \bitvar{NQIS}-element array of + \qi\ values. \\ +\bitvar{QIIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 2 & No & An \bitvar{NBS}-element array of + \locvar{\qii} values for each block. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the reconstructed frame. \\ +\bitvar{RECCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the reconstructed frame. \\ +\bitvar{RECCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the reconstructed frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{RPW} & Integer & 20 & No & The width of the current plane of the + current reference frame in pixels. \\ +\locvar{RPH} & Integer & 20 & No & The height of the current plane of + the current reference frame in pixels. \\ +\locvar{REFP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of the current plane of the current reference + frame. \\ +\locvar{BX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the current block. \\ +\locvar{BY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the current block. \\ +\locvar{MVX} & Integer & 5 & No & The horizontal component of the first + whole-pixel motion vector. \\ +\locvar{MVY} & Integer & 5 & No & The vertical component of the first + whole-pixel motion vector. \\ +\locvar{MVX2} & Integer & 5 & No & The horizontal component of the second + whole-pixel motion vector. \\ +\locvar{MVY2} & Integer & 5 & No & The vertical component of the second + whole-pixel motion vector. \\ +\locvar{PRED} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & An $8\times 8$ array of predictor + values to use for the current block. \\ +\locvar{RES} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $8\times 8$ array containing the + decoded residual for the current block. \\ +\locvar{QMAT} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of quantization + values for each DCT coefficient in natural order. \\ +\locvar{DC} & Integer & 29 & Yes & The dequantized DC coefficient of a + block. \\ +\locvar{P} & Integer & 17 & Yes & A reconstructed pixel value. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\mbi} & Integer & 32 & No & The index of the macro block + containing block \locvar{\bi}. \\ +\locvar{\pli} & Integer & 2 & No & The color plane index of the current + block. \\ +\locvar{\rfi} & Integer & 2 & No & The index of the reference frame + indicated by the coding mode for macro block \locvar{\mbi}. \\ +\locvar{\idx{bx}} & Integer & 3 & No & The horizontal pixel index in the + block. \\ +\locvar{\idx{by}} & Integer & 3 & No & The vertical pixel index in the + block. \\ +\locvar{\qti} & Integer & 1 & No & A quantization type index. +See Table~\ref{tab:quant-types}.\\ +\locvar{\idx{qi0}} & Integer & 6 & No & The quantization index of the DC + coefficient. \\ +\locvar{\qi} & Integer & 6 & No & The quantization index of the AC + coefficients. \\ +\bottomrule\end{tabularx} +\medskip + +This section takes the decoded packet data and uses the previously defined + procedures to reconstruct each block of the current frame. +For coded blocks, a predictor is formed using the coding mode and, if + applicable, the motion vector, and then the residual is computed from the + quantized DCT coefficients. +For uncoded blocks, the contents of the co-located block are copied from the + previous frame and the residual is cleared to zero. +Then the predictor and residual are added, and the result clamped to the range + $0\ldots 255$ and stored in the current frame. + +In the special case that a block contains only a DC coefficient, the + dequantization and inverse DCT transform is skipped. +Instead the constant pixel value for the entire block is computed in one step. +Note that the truncation of intermediate operations is omitted and the final + rounding is slightly different in this case. +The check for whether or not the block contains only a DC coefficient is based + on the coefficient count returned from the token decode procedure of + Section~\ref{sec:dct-decode}, and not by checking to see if the remaining + coefficient values are zero. +Also note that even when the coefficient count indicates the block contains + zero coefficients, the DC coefficient is still processed, as undoing DC + prediction might have made it non-zero. + +After this procedure, the frame is completely reconstructed, but before it can + be used as a reference frame, a loop filter must be run over it to help reduce + blocking artifacts. +This is detailed in Section~\ref{sec:loopfilter}. + +\begin{enumerate} +\item +Assign \locvar{\idx{qi0}} the value $\bitvar{QIS}[0]$. +\item +For each value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$: +\begin{enumerate} +\item +Assign \locvar{\pli} the index of the color plane block \locvar{\bi} belongs + to. +\item +Assign \locvar{BX} the horizontal pixel index of the lower-left corner of block + \locvar{\bi}. +\item +Assign \locvar{BY} the vertical pixel index of the lower-left corner of block + \locvar{\bi}. +\item +If $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero: +\begin{enumerate} +\item +Assign \locvar{\mbi} the index of the macro block containing block + \locvar{\bi}. +\item +If $\bitvar{MBMODES}[\locvar{\mbi}]$ is 1 (INTRA), assign \locvar{\qti} the + value $0$. +\item +Otherwise, assign \locvar{\qti} the value $1$. +\item +Assign \locvar{\rfi} the value of the Reference Frame Index column of + Table~\ref{tab:cm-refs} corresponding to $\bitvar{MBMODES}[\locvar{\mbi}]$. +\item +If \locvar{\rfi} is zero, compute \locvar{PRED} using the procedure given in + Section~\ref{sub:predintra}. +\item +Otherwise: +\begin{enumerate} +\item +Assign \locvar{REFP}, \locvar{RPW}, and \locvar{RPH} the values given in + Table~\ref{tab:refp} corresponding to current value of \locvar{\rfi} and + \locvar{\pli}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{cclll}\toprule +\locvar{\rfi} & \locvar{\pli} & +\locvar{REFP} & \locvar{RPW} & \locvar{RPH} \\\midrule +$1$ & $0$ & \bitvar{PREVREFY} & \bitvar{RPYW} & \bitvar{RPYH} \\ +$1$ & $1$ & \bitvar{PREVREFCB} & \bitvar{RPCW} & \bitvar{RPCH} \\ +$1$ & $2$ & \bitvar{PREVREFCR} & \bitvar{RPCW} & \bitvar{RPCH} \\ +$2$ & $0$ & \bitvar{GOLDREFY} & \bitvar{RPYW} & \bitvar{RPYH} \\ +$2$ & $1$ & \bitvar{GOLDREFCB} & \bitvar{RPCW} & \bitvar{RPCH} \\ +$2$ & $2$ & \bitvar{GOLDREFCR} & \bitvar{RPCW} & \bitvar{RPCH} \\ +\bottomrule\end{tabular} +\end{center} +\caption{Reference Planes and Sizes for Each \locvar{\rfi} and \locvar{\pli}} +\label{tab:refp} +\end{table} + +\item +Assign \locvar{MVX} the value +\begin{equation*} + \left\lfloor\lvert\bitvar{MVECTS}[\locvar{\bi}]_x\rvert\right\rfloor* + \sign(\bitvar{MVECTS}[\locvar{\bi}]_x). +\end{equation*} +\item +Assign \locvar{MVY} the value +\begin{equation*} + \left\lfloor\lvert\bitvar{MVECTS}[\locvar{\bi}]_y\rvert\right\rfloor* + \sign(\bitvar{MVECTS}[\locvar{\bi}]_y). +\end{equation*} +\item +Assign \locvar{MVX2} the value +\begin{equation*} + \left\lceil\lvert\bitvar{MVECTS}[\locvar{\bi}]_x\rvert\right\rceil* + \sign(\bitvar{MVECTS}[\locvar{\bi}]_x). +\end{equation*} +\item +Assign \locvar{MVY2} the value +\begin{equation*} + \left\lceil\lvert\bitvar{MVECTS}[\locvar{\bi}]_y\rvert\right\rceil* + \sign(\bitvar{MVECTS}[\locvar{\bi}]_y). +\end{equation*} +\item +If \locvar{MVX} equals \locvar{MVX2} and \locvar{MVY} equals \locvar{MVY2}, + use the values \locvar{REFP}, \locvar{RPW}, \locvar{RPH}, \locvar{BX}, + \locvar{BY}, \locvar{MVX}, and \locvar{MVY}, compute \locvar{PRED} using the + procedure given in Section~\ref{sub:predfullpel}. +\item +Otherwise, use the values \locvar{REFP}, \locvar{RPW}, \locvar{RPH}, + \locvar{BX}, \locvar{BY}, \locvar{MVX}, \locvar{MVY}, \locvar{MVX2}, and + \locvar{MVY2} to compute \locvar{PRED} using the procedure given in + Section~\ref{sub:predhalfpel}. +\end{enumerate} +\item +\label{step:dc-only-idct} +If $\bitvar{NCOEFFS}[\locvar{\bi}]$ is less than 2: +\begin{enumerate} +\item +Using \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{BMS}, \bitvar{NQRS}, \\ + \bitvar{QRSIZES}, \bitvar{QRBMIS}, \locvar{\qti}, \locvar{\pli}, and + \locvar{\idx{qi0}}, use the procedure given in Section~\ref{sub:quant-mat} to + compute the DC quantization matrix \locvar{QMAT}. +\item +Assign \locvar{DC} the value +\begin{equation*} + (\bitvar{COEFFS}[\bitvar{\bi}][0]*\locvar{QMAT}[0]+15)>>5. +\end{equation*} +\item +Truncate \locvar{DC} to a 16-bit signed representation by dropping any + higher-order bits. +\item +For each value of \locvar{\idx{by}} from 0 to 7, and each value of + \locvar{\idx{bx}} from 0 to 7, assign + $\locvar{RES}[\locvar{\idx{by}}][\locvar{\idx{bx}}]$ the value \locvar{DC}. +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Assign \locvar{\qi} the value $\bitvar{QIS}[\bitvar{QIIS}[\locvar{\bi}]]$. +\item +Using \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{BMS}, \bitvar{NQRS}, \\ + \bitvar{QRSIZES}, \bitvar{QRBMIS}, \locvar{\qti}, \locvar{\pli}, + \locvar{\idx{qi0}}, and \locvar{\qi}, compute \locvar{DQC} using the procedure + given in Section~\ref{sub:dequant}. +\item +Using \locvar{DQC}, compute \locvar{RES} using the procedure given in + Section~\ref{sub:2d-idct}. +\end{enumerate} +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Assign \locvar{\rfi} the value 1. +\item +Assign \locvar{REFP}, \locvar{RPW}, and \locvar{RPH} the values given in + Table~\ref{tab:refp} corresponding to current value of \locvar{\rfi} and + \locvar{\pli}. +\item +Assign \locvar{MVX} the value 0. +\item +Assign \locvar{MVY} the value 0. +\item +Using the values \locvar{REFP}, \locvar{RPW}, \locvar{RPH}, \locvar{BX}, + \locvar{BY}, \locvar{MVX}, and \locvar{MVY}, compute \locvar{PRED} using the + procedure given in Section~\ref{sub:predfullpel}. +This is simply a copy of the co-located block in the previous reference frame. +\item +For each value of \locvar{\idx{by}} from 0 to 7, and each value of + \locvar{\idx{bx}} from 0 to 7, assign + $\locvar{RES}[\locvar{\idx{by}}][\locvar{\idx{bx}}]$ the value 0. +\end{enumerate} +\item +For each value of \locvar{\idx{by}} from 0 to 7, and each value of + \locvar{\idx{bx}} from 0 to 7: +\begin{enumerate} +\item +Assign \locvar{P} the value + $(\locvar{PRED}[\locvar{\idx{by}}][\locvar{\idx{bx}}]+ + \locvar{RES}[\locvar{\idx{by}}][\locvar{\idx{bx}}])$. +\item +If \locvar{P} is greater than $255$, assign \locvar{P} the value $255$. +\item +If \locvar{P} is less than $0$, assign \locvar{P} the value $0$. +\item +If \locvar{\pli} equals 0, assign + $\bitvar{RECY}[\locvar{BY}+\locvar{\idx{by}}][\locvar{BX}+\locvar{\idx{bx}}]$ + the value \locvar{P}. +\item +Otherwise, if \locvar{\pli} equals 1, assign + $\bitvar{RECB}[\locvar{BY}+\locvar{\idx{by}}][\locvar{BX}+\locvar{\idx{bx}}]$ + the value \locvar{P}. +\item +Otherwise, \locvar{\pli} equals 2, so assign + $\bitvar{RECR}[\locvar{BY}+\locvar{\idx{by}}][\locvar{BX}+\locvar{\idx{bx}}]$ + the value \locvar{P}. +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\section{Loop Filtering} +\label{sec:loopfilter} + +\begin{figure}[htbp] +\begin{center} +\includegraphics{lflim} +\end{center} +\caption{The loop filter response function.} +\label{fig:lflim} +\end{figure} + +The loop filter is a simple deblocking filter that is based on running a small + edge detecting filter over the coded block edges and adjusting the pixel + values by a tapered response. +The filter response is modulated by the following non-linear function: +\begin{align*} +\lflim(\locvar{R},\bitvar{L})&=\left\{\begin{array}{ll} +0, & \locvar{R}\le-2*\bitvar{L} \\ +-\locvar{R}-2*\bitvar{L}, & -2*\bitvar{L}<\locvar{R}\le-\bitvar{L} \\ +\locvar{R}, & -\bitvar{L}<\locvar{R}<\bitvar{L} \\ +-\locvar{R}+2*\bitvar{L}, & \bitvar{L}\le\locvar{R}<2*\bitvar{L} \\ +0, & 2*\bitvar{L}\le\locvar{R} +\end{array}\right. +\end{align*} +Here \bitvar{L} is a limiting value equal to $\bitvar{LFLIMS}[\idx{qi0}]$. +It defines the peaks of the function, illustrated in Figure~\ref{fig:lflim}. +\bitvar{LFLIMS} is an array of values specified in the setup header and is + indexed by \idx{qi0}, the first quantization index for the frame, the one used + for all the DC coefficients. +Larger values of \bitvar{L} indicate a stronger filter. + +\subsection{Horizontal Filter} +\label{sub:filth} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of a plane of the reconstructed frame. \\ +\bitvar{FX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the area to be filtered. \\ +\bitvar{FY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the area to be filtered. \\ +\bitvar{L} & Integer & 7 & No & The loop filter limit value. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of a plane of the reconstructed frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{R} & Integer & 9 & Yes & The edge detector response. \\ +\locvar{P} & Integer & 9 & Yes & A filtered pixel value. \\ +\locvar{\idx{by}} & Integer & 20 & No & The vertical pixel index in the + block. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure applies a $4$-tap horizontal filter to each row of a vertical + block edge. + +\begin{enumerate} +\item +For each value of \locvar{\idx{by}} from $0$ to $7$: +\begin{enumerate} +\item +Assign \locvar{R} the value +\begin{multline*} +(\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}]- + 3*\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+1]+\\ + 3*\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+2]- + \bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+3]+4)>>3 +\end{multline*} +\item +Assign \locvar{P} the value + $(\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+1]+ + \lflim(\locvar{R},\bitvar{L}))$. +\item +If \locvar{P} is less than zero, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+1]$ the value zero. +\item +Otherwise, if \locvar{P} is greater than $255$, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+1]$ the value $255$. +\item +Otherwise, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+1]$ the value + \locvar{P}. +\item +Assign \locvar{P} the value + $(\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+2]- + \lflim(\locvar{R},\bitvar{L}))$. +\item +If \locvar{P} is less than zero, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+2]$ the value zero. +\item +Otherwise, if \locvar{P} is greater than $255$, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+2]$ the value $255$. +\item +Otherwise, assign + $\bitvar{RECP}[\bitvar{FY}+\locvar{\idx{by}}][\bitvar{FX}+2]$ the value + \locvar{P}. +\end{enumerate} +\end{enumerate} + +\subsection{Vertical Filter} +\label{sub:filtv} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of a plane of the reconstructed frame. \\ +\bitvar{FX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the area to be filtered. \\ +\bitvar{FY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the area to be filtered. \\ +\bitvar{L} & Integer & 7 & No & The loop filter limit value. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of a plane of the reconstructed frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{R} & Integer & 9 & Yes & The edge detector response. \\ +\locvar{P} & Integer & 9 & Yes & A filtered pixel value. \\ +\locvar{\idx{bx}} & Integer & 20 & No & The horizontal pixel index in the + block. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure applies a $4$-tap vertical filter to each column of a horizontal + block edge. + +\begin{enumerate} +\item +For each value of \locvar{\idx{bx}} from $0$ to $7$: +\begin{enumerate} +\item +Assign \locvar{R} the value +\begin{multline*} +(\bitvar{RECP}[\bitvar{FY}][\bitvar{FX}+\locvar{\idx{bx}}]- + 3*\bitvar{RECP}[\bitvar{FY}+1][\bitvar{FX}+\locvar{\idx{bx}}]+\\ + 3*\bitvar{RECP}[\bitvar{FY}+2][\bitvar{FX}+\locvar{\idx{bx}}]- + \bitvar{RECP}[\bitvar{FY}+3][\bitvar{FX}+\locvar{\idx{bx}}]+4)>>3 +\end{multline*} +\item +Assign \locvar{P} the value + $(\bitvar{RECP}[\bitvar{FY}+1][\bitvar{FX}+\locvar{\idx{bx}}]+ + \lflim(\locvar{R},\bitvar{L}))$. +\item +If \locvar{P} is less than zero, assign + $\bitvar{RECP}[\bitvar{FY}+1][\bitvar{FX}+\locvar{\idx{bx}}]$ the value zero. +\item +Otherwise, if \locvar{P} is greater than $255$, assign + $\bitvar{RECP}[\bitvar{FY}+1][\bitvar{FX}+\locvar{\idx{bx}}]$ the value $255$. +\item +Otherwise, assign + $\bitvar{RECP}[\bitvar{FY}+1][\bitvar{FX}+\locvar{\idx{bx}}]$ the value + \locvar{P}. +\item +Assign \locvar{P} the value + $(\bitvar{RECP}[\bitvar{FY}+2][\bitvar{FX}+\locvar{\idx{bx}}]- + \lflim(\locvar{R},\bitvar{L}))$. +\item +If \locvar{P} is less than zero, assign + $\bitvar{RECP}[\bitvar{FY}+2][\bitvar{FX}+\locvar{\idx{bx}}]$ the value zero. +\item +Otherwise, if \locvar{P} is greater than $255$, assign + $\bitvar{RECP}[\bitvar{FY}+2][\bitvar{FX}+\locvar{\idx{bx}}]$ the value $255$. +\item +Otherwise, assign + $\bitvar{RECP}[\bitvar{FY}+2][\bitvar{FX}+\locvar{\idx{bx}}]$ the value + \locvar{P}. +\end{enumerate} +\end{enumerate} + +\subsection{Complete Loop Filter} +\label{sub:loop-filt} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{LFLIMS} & \multicolumn{1}{p{40pt}}{Integer array} & + 7 & No & A 64-element array of loop filter limit + values. \\ +\bitvar{RPYW} & Integer & 20 & No & The width of the $Y'$ plane of the + reconstruced frame in pixels. \\ +\bitvar{RPYH} & Integer & 20 & No & The height of the $Y'$ plane of the + reconstruced frame in pixels. \\ +\bitvar{RPCW} & Integer & 20 & No & The width of the $C_b$ and $C_r$ + planes of the reconstruced frame in pixels. \\ +\bitvar{RPCH} & Integer & 20 & No & The height of the $C_b$ and $C_r$ + planes of the reconstruced frame in pixels. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of + flags indicating which blocks are coded. \\ +\bitvar{QIS} & \multicolumn{1}{p{40pt}}{Integer array} & + 6 & No & An \bitvar{NQIS}-element array of + \qi\ values. \\ +\bitvar{RECY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the reconstructed frame. \\ +\bitvar{RECCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the reconstructed frame. \\ +\bitvar{RECCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the reconstructed frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the reconstructed frame. \\ +\bitvar{RECCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the reconstructed frame. \\ +\bitvar{RECCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the reconstructed frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{RPW} & Integer & 20 & No & The width of the current plane of the + reconstructed frame in pixels. \\ +\locvar{RPH} & Integer & 20 & No & The height of the current plane of + the reconstructed frame in pixels. \\ +\locvar{RECP} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPH}\times\bitvar{RPW}$ + array containing the contents of the current plane of the reconstruced + frame. \\ +\locvar{BX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the current block. \\ +\locvar{BY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the current block. \\ +\locvar{FX} & Integer & 20 & No & The horizontal pixel index of the + lower-left corner of the area to be filtered. \\ +\locvar{FY} & Integer & 20 & No & The vertical pixel index of the + lower-left corner of the area to be filtered. \\ +\locvar{L} & Integer & 7 & No & The loop filter limit value. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in + coded order. \\ +\locvar{\bj} & Integer & 36 & No & The index of a neighboring block in + coded order. \\ +\locvar{\pli} & Integer & 2 & No & The color plane index of the current + block. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure defines the order that the various block edges are filtered. +Because each application of one of the two filters above destructively modifies + the contents of the reconstructed image, the precise output obtained differs + depending on the order that horizontal and vertical filters are applied to the + edges of a single block. +The order defined here conforms to that used by VP3. + +\begin{enumerate} +\item +Assign \locvar{L} the value $\bitvar{LFLIMS}[\bitvar{QIS}[0]]$. +\item +For each block in {\em raster} order, with coded-order index \locvar{\bi}: +\begin{enumerate} +\item +If $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero: +\begin{enumerate} +\item +Assign \locvar{\pli} the index of the color plane block \locvar{\bi} belongs + to. +\item +Assign \locvar{RECP}, \locvar{RPW}, and \locvar{RPH} the values given in + Table~\ref{tab:recp} corresponding to the value of \locvar{\pli}. + +\begin{table}[htbp] +\begin{center} +\begin{tabular}{clll}\toprule +\locvar{\pli} & \locvar{RECP} & \locvar{RPW} & \locvar{RPH} \\\midrule +$0$ & \bitvar{RECY} & \bitvar{RPYW} & \bitvar{RPYH} \\ +$1$ & \bitvar{RECCB} & \bitvar{RPCW} & \bitvar{RPCH} \\ +$2$ & \bitvar{RECCR} & \bitvar{RPCW} & \bitvar{RPCH} \\ +\bottomrule\end{tabular} +\end{center} +\caption{Reconstructed Planes and Sizes for Each \locvar{\pli}} +\label{tab:recp} +\end{table} + +\item +Assign \locvar{BX} the horizontal pixel index of the lower-left corner of the + block \locvar{\bi}. +\item +Assign \locvar{BY} the vertical pixel index of the lower-left corner of the + block \locvar{\bi}. +\item +If \locvar{BX} is greater than zero: +\begin{enumerate} +\item +Assign \locvar{FX} the value $(\locvar{BX}-2)$. +\item +Assign \locvar{FY} the value \locvar{BY}. +\item +Using \locvar{RECP}, \locvar{FX}, \locvar{FY}, and \locvar{L}, apply the + horizontal block filter to the left edge of block \locvar{\bi} with the + procedure described in Section~\ref{sub:filth}. +\end{enumerate} +\item +If \locvar{BY} is greater than zero: +\begin{enumerate} +\item +Assign \locvar{FX} the value \locvar{BX}. +\item +Assign \locvar{FY} the value $(\locvar{BY}-2)$ +\item +Using \locvar{RECP}, \locvar{FX}, \locvar{FY}, and \locvar{L}, apply the + vertical block filter to the bottom edge of block \locvar{\bi} with the + procedure described in Section~\ref{sub:filtv}. +\end{enumerate} +\item +If $(\locvar{BX}+8)$ is less than \locvar{RPW} and + $\bitvar{BCODED}[\locvar{\bj}]$ is zero, where \locvar{\bj} is the coded-order + index of the block adjacent to \locvar{\bi} on the right: +\begin{enumerate} +\item +Assign \locvar{FX} the value $(\locvar{BX}+6)$. +\item +Assign \locvar{FY} the value \locvar{BY}. +\item +Using \locvar{RECP}, \locvar{FX}, \locvar{FY}, and \locvar{L}, apply the + horizontal block filter to the right edge of block \locvar{\bi} with the + procedure described in Section~\ref{sub:filth}. +\end{enumerate} +\item +If $(\locvar{BY}+8)$ is less than \locvar{RPH} and + $\bitvar{BCODED}[\locvar{\bj}]$ is zero, where \locvar{\bj} is the coded-order + index of the block adjacent to \locvar{\bi} above: +\begin{enumerate} +\item +Assign \locvar{FX} the value \locvar{BX}. +\item +Assign \locvar{FY} the value $(\locvar{BY}+6)$ +\item +Using \locvar{RECP}, \locvar{FX}, \locvar{FY}, and \locvar{L}, apply the + vertical block filter to the top edge of block \locvar{\bi} with the + procedure described in Section~\ref{sub:filtv}. +\end{enumerate} +\end{enumerate} +\end{enumerate} +\end{enumerate} + +\paragraph{VP3 Compatibility} + +The original VP3 decoder implemented unrestricted motion vectors by enlarging + the reconstructed frame buffers and repeating the pixels on its edges into the + padding region. +However, for the previous reference frame this padding ocurred before the loop + filter was applied, but for the golden reference frame it occurred afterwards. + +This means that for the previous reference frame, the padding values were + required to be stored separately from the main image values. +Furthermore, even if the previous and golden reference frames were in fact the + same frame, they could have different padding values. +Finally, the encoder did not apply the loop filter at all, which resulted in + artifacts, particularly in near-static scenes, due to prediction-loop + mismatch. +This last can only be considered a bug in the VP3 encoder. + +Given all these things, Theora now uniformly applies the loop filter before + the reference frames are padded. +This means it is possible to use the same buffer for the previous and golden + reference frames when they do indeed refer to the same frame. +It also means that on architectures where memory bandwidth is limited, it is + possible to avoid storing padding values, and simply clamp the motion vectors + applied to each pixel as described in Sections~\ref{sub:predfullpel} + and~\ref{sub:predhalfpel}. +This means that the predicted pixel values along the edges of the frame might + differ slightly between VP3 and Theora, but since the VP3 encoder did not + apply the loop filter in the first place, this is not likely to impose any + serious compatibility issues. + +\section{Complete Frame Decode} + +\paragraph{Input parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{FMBW} & Integer & 16 & No & The width of the frame in macro + blocks. \\ +\bitvar{FMBH} & Integer & 16 & No & The height of the frame in macro + blocks. \\ +\bitvar{NSBS} & Integer & 32 & No & The total number of super blocks in a + frame. \\ +\bitvar{NBS} & Integer & 36 & No & The total number of blocks in a + frame. \\ +\bitvar{NMBS} & Integer & 32 & No & The total number of macro blocks in a + frame. \\ +\bitvar{FRN} & Integer & 32 & No & The frame-rate numerator. \\ +\bitvar{FRD} & Integer & 32 & No & The frame-rate denominator. \\ +\bitvar{PARN} & Integer & 24 & No & The pixel aspect-ratio numerator. \\ +\bitvar{PARD} & Integer & 24 & No & The pixel aspect-ratio + denominator. \\ +\bitvar{CS} & Integer & 8 & No & The color space. \\ +\bitvar{PF} & Integer & 2 & No & The pixel format. \\ +\bitvar{NOMBR} & Integer & 24 & No & The nominal bitrate of the stream, in + bits per second. \\ +\bitvar{QUAL} & Integer & 6 & No & The quality hint. \\ +\bitvar{KFGSHIFT} & Integer & 5 & No & The amount to shift the key frame + number by in the granule position. \\ +\bitvar{LFLIMS} & \multicolumn{1}{p{40pt}}{Integer array} & + 7 & No & A 64-element array of loop filter + limit values. \\ +\bitvar{ACSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values + for AC coefficients for each \qi\ value. \\ +\bitvar{DCSCALE} & \multicolumn{1}{p{40pt}}{Integer array} & + 16 & No & A 64-element array of scale values + for the DC coefficient for each \qi\ value. \\ +\bitvar{NBMS} & Integer & 10 & No & The number of base matrices. \\ +\bitvar{BMS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 8 & No & A $\bitvar{NBMS}\times 64$ array + containing the base matrices. \\ +\bitvar{NQRS} & \multicolumn{1}{p{50pt}}{2D Integer array} & + 6 & No & A $2\times 3$ array containing the + number of quant ranges for a given \qti\ and \pli, respectively. +This is at most $63$. \\ +\bitvar{QRSIZES} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 6 & No & A $2\times 3\times 63$ array of the + sizes of each quant range for a given \qti\ and \pli, respectively. +Only the first $\bitvar{NQRS}[\qti][\pli]$ values will be used. \\ +\bitvar{QRBMIS} & \multicolumn{1}{p{50pt}}{3D Integer array} & + 9 & No & A $2\times 3\times 64$ array of the + \bmi's used for each quant range for a given \qti\ and \pli, respectively. +Only the first $(\bitvar{NQRS}[\qti][\pli]+1)$ values will be used. \\ +\bitvar{HTS} & \multicolumn{3}{l}{Huffman table array} + & An 80-element array of Huffman tables + with up to 32 entries each. \\ +\bitvar{GOLDREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the golden reference + frame. \\ +\bitvar{PREVREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the previous reference + frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Output parameters:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\bitvar{RECY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the reconstructed frame. \\ +\bitvar{RECCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the reconstructed + frame. \\ +\bitvar{RECCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the reconstructed + frame. \\ +\bitvar{GOLDREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the golden reference + frame. \\ +\bitvar{GOLDREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the golden reference + frame. \\ +\bitvar{PREVREFY} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPYH}\times\bitvar{RPYW}$ + array containing the contents of the $Y'$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCB} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_b$ plane of the previous reference + frame. \\ +\bitvar{PREVREFCR} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 8 & No & A $\bitvar{RPCH}\times\bitvar{RPCW}$ + array containing the contents of the $C_r$ plane of the previous reference + frame. \\ +\bottomrule\end{tabularx} + +\paragraph{Variables used:}\hfill\\* +\begin{tabularx}{\textwidth}{@{}llrcX@{}}\toprule +\multicolumn{1}{c}{Name} & +\multicolumn{1}{c}{Type} & +\multicolumn{1}{p{30pt}}{\centering Size (bits)} & +\multicolumn{1}{c}{Signed?} & +\multicolumn{1}{c}{Description and restrictions} \\\midrule\endhead +\locvar{FTYPE} & Integer & 1 & No & The frame type. \\ +\locvar{NQIS} & Integer & 2 & No & The number of \qi\ values. \\ +\locvar{QIS} & \multicolumn{1}{p{40pt}}{Integer array} & + 6 & No & An \locvar{NQIS}-element array of + \qi\ values. \\ +\locvar{BCODED} & \multicolumn{1}{p{40pt}}{Integer Array} & + 1 & No & An \bitvar{NBS}-element array of flags + indicating which blocks are coded. \\ +\locvar{MBMODES} & \multicolumn{1}{p{40pt}}{Integer Array} & + 3 & No & An \bitvar{NMBS}-element array of + coding modes for each macro block. \\ +\locvar{MVECTS} & \multicolumn{1}{p{50pt}}{Array of 2D Integer Vectors} & + 6 & Yes & An \bitvar{NBS}-element array of motion + vectors for each block. \\ +\locvar{QIIS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 2 & No & An \bitvar{NBS}-element array of + \locvar{\qii} values for each block. \\ +\locvar{COEFFS} & \multicolumn{1}{p{50pt}}{2D Integer Array} & + 16 & Yes & An $\bitvar{NBS}\times 64$ array of + quantized DCT coefficient values for each block in zig-zag order. \\ +\locvar{NCOEFFS} & \multicolumn{1}{p{40pt}}{Integer Array} & + 7 & No & An \bitvar{NBS}-element array of the + coefficient count for each block. \\ +\bitvar{RPYW} & Integer & 20 & No & The width of the $Y'$ plane of the + reference frames in pixels. \\ +\bitvar{RPYH} & Integer & 20 & No & The height of the $Y'$ plane of the + reference frames in pixels. \\ +\bitvar{RPCW} & Integer & 20 & No & The width of the $C_b$ and $C_r$ + planes of the reference frames in pixels. \\ +\bitvar{RPCH} & Integer & 20 & No & The height of the $C_b$ and $C_r$ + planes of the reference frames in pixels. \\ +\locvar{\bi} & Integer & 36 & No & The index of the current block in coded + order. \\ +\bottomrule\end{tabularx} +\medskip + +This procedure uses all the procedures defined in the previous section of this + chapter to decode and reconstruct a complete frame. +It takes as input values decoded from the headers, as well as the current + reference frames. +As output, it gives the uncropped, reconstructed frame. +This should be cropped to picture region before display. +As a special case, a 0-byte packet is treated exactly like an inter frame with + no coded blocks. + +\begin{enumerate} +\item +If the size of the data packet is non-zero: +\begin{enumerate} +\item +Decode the frame header values \locvar{FTYPE}, \locvar{NQIS}, and \locvar{QIS} + using the procedure given in Section~\ref{sub:frame-header}. +\item +Using \locvar{FTYPE}, \bitvar{NSBS}, and \bitvar{NBS}, decode the list of coded + block flags into \locvar{BCODED} using the procedure given in + Section~\ref{sub:coded-blocks}. +\item +Using \locvar{FTYPE}, \bitvar{NMBS}, \bitvar{NBS}, and \bitvar{BCODED}, decode + the macro block coding modes into \locvar{MBMODES} using the procedure given + in Section~\ref{sub:mb-modes}. +\item +If \locvar{FTYPE} is non-zero (inter frame), using \bitvar{PF}, \bitvar{NMBS}, + \locvar{MBMODES}, \bitvar{NBS}, and \locvar{BCODED}, decode the motion vectors + into \locvar{MVECTS} using the procedure given in + Section~\ref{sub:mb-mv-decode}. +\item +Using \bitvar{NBS}, \locvar{BCODED}, and \locvar{NQIS}, decode the block-level + \qi\ values into \locvar{QIIS} using the procedure given in + Section~\ref{sub:block-qis}. +\item +Using \bitvar{NBS}, \bitvar{NMBS}, \locvar{BCODED}, and \bitvar{HTS}, decode + the DCT coefficients into \locvar{NCOEFFS} and \locvar{NCOEFFS} using the + procedure given in Section~\ref{sub:dct-coeffs}. +\item +Using \locvar{BCODED} and \locvar{MBMODES}, undo the DC prediction on the DC + coefficients stored in \locvar{COEFFS} using the procedure given in + Section~\ref{sub:dc-pred-undo}. +\end{enumerate} +\item +Otherwise: +\begin{enumerate} +\item +Assign \locvar{FTYPE} the value 1 (inter frame). +\item +Assign \locvar{NQIS} the value 1. +\item +Assign $\locvar{QIS}[0]$ the value 63. +\item +For each value of \locvar{\bi} from 0 to $(\bitvar{NBS}-1)$, assign + $\locvar{BCODED}[\locvar{\bi}]$ the value zero. +\end{enumerate} +\item +Assign \locvar{RPYW} and \locvar{RPYH} the values $(16*\bitvar{FMBW})$ and + $(16*\bitvar{FMBH})$, respectively. +\item +Assign \locvar{RPCW} and \locvar{RPCH} the values from the row of + Table~\ref{tab:rpcwh-for-pf} corresponding to \bitvar{PF}. + +\begin{table}[tb] +\begin{center} +\begin{tabular}{crr}\toprule +\bitvar{PF} & \multicolumn{1}{c}{\locvar{RPCW}} + & \multicolumn{1}{c}{\locvar{RPCH}} \\\midrule +$0$ & $8*\bitvar{FMBW}$ & $8*\bitvar{FMBH}$ \\ +$2$ & $8*\bitvar{FMBW}$ & $16*\bitvar{FMBH}$ \\ +$3$ & $16*\bitvar{FMBW}$ & $16*\bitvar{FMBH}$ \\ +\bottomrule\end{tabular} +\end{center} +\caption{Width and Height of Chroma Planes for each Pixel Format} +\label{tab:rpcwh-for-pf} +\end{table} + +\item +Using \bitvar{ACSCALE}, \bitvar{DCSCALE}, \bitvar{BMS}, \bitvar{NQRS}, + \bitvar{QRSIZES}, \bitvar{QRBMIS}, \bitvar{NBS}, \locvar{BCODED}, + \locvar{MBMODES}, \locvar{MVECTS}, \locvar{COEFFS}, \locvar{NCOEFFS}, + \locvar{QIS}, \locvar{QIIS}, \locvar{RPYW}, \locvar{RPYH}, \locvar{RPCW}, + \locvar{RPCH}, \bitvar{GOLDREFY}, \bitvar{GOLDREFCB}, \bitvar{GOLDREFCR}, + \bitvar{PREVREFY}, \bitvar{PREVREFCB}, and \bitvar{PREVREFCR}, reconstruct the + complete frame into \bitvar{RECY}, \bitvar{RECCB}, and \bitvar{RECCR} using + the procedure given in Section~\ref{sub:recon}. +\item +Using \bitvar{LFLIMS}, \locvar{RPYW}, \locvar{RPYH}, \locvar{RPCW}, + \locvar{RPCH}, \bitvar{NBS}, \locvar{BCODED}, and \locvar{QIS}, apply the loop + filter to the reconstructed frame in \bitvar{RECY}, \bitvar{RECCB}, and + \bitvar{RECCR} using the procedure given in Section~\ref{sub:loop-filt}. +\item +If \locvar{FTYPE} is zero (intra frame), assign \bitvar{GOLDREFY}, + \bitvar{GOLDREFCB}, and \bitvar{GOLDREFCR} the values \bitvar{RECY}, + \bitvar{RECCB}, and \bitvar{RECCR}, respectively. +\item +Assign \bitvar{PREVREFY}, \bitvar{PREVREFCB}, and \bitvar{PREVREFCR} the values + \bitvar{RECY}, \bitvar{RECCB}, and \bitvar{RECCR}, respectively. +\end{enumerate} + +%\backmatter +\appendix + +\chapter{Ogg Bitstream Encapsulation} +\label{app:oggencapsulation} + +\section{Overview} + +This document specifies the embedding or encapsulation of Theora packets + in an Ogg transport stream. + +Ogg is a stream oriented wrapper for coded, linear time-based data. +It provides syncronization, multiplexing, framing, error detection and + seeking landmarks for the decoder and complements the raw packet format + used by the Theora codec. + +This document assumes familiarity with the details of the Ogg standard. +The Xiph.Org documentation provides an overview of the Ogg transport stream + format at \url{http://www.xiph.org/ogg/doc/oggstream.html} and a detailed + description at \url{http://www.xiph.org/ogg/doc/framing.html}. +The format is also defined in RFC~3533 \cite{rfc3533}. +While Theora packets can be embedded in a wide variety of media + containers and streaming mechanisms, the Xiph.Org Foundation + recommends Ogg as the native format for Theora video in file-oriented + storage and transmission contexts. + +\subsection{MIME type} + +The generic MIME type of any Ogg file is {\tt application/ogg}. +The specific MIME type for the Ogg Theora profile documented here +is {\tt video/ogg}. This is the MIME type recommended for files +conforming to this appendix. The recommended filename extension +is {\tt .ogv}. + +Outside of an encapsulation, the mime type {\tt video/theora} may + be used to refer specifically to the Theora compressed video stream. + +\section{Embedding in a logical bitstream} + +Ogg separates the concept of a {\em logical bitstream} consisting of the + framing of a particular sequence of packets and complete within itself + from the {\em physical bitstream} which may consist either of a single + logical bitstream or a number of logical bitstreams multiplexed + together. +This section specifies the embedding of Theora packets in a logical Ogg + bitstream. +The mapping of Ogg Theora logical bitstreams into a multiplexed physical Ogg + stream is described in the next section. + +\subsection{Headers} + +The initial identification header packet appears by itself in a + single Ogg page. +This page defines the start of the logical stream and MUST have + the `beginning of stream' flag set. + +The second and third header packets (comment metadata and decoder + setup data) can together span one or more Ogg pages. +If there are additional non-normative header packets, they MUST be + included in this sequence of pages as well. +The comment header packet MUST begin the second Ogg page in the logical + bitstream, and there MUST be a page break between the last header + packet and the first frame data packet. + +These two page break requirements facilitate stream identification and + simplify header acquisition for seeking and live streaming applications. + +All header pages MUST have their granule position field set to zero. + +\subsection{Frame data} + +The first frame data packet in a logical bitstream MUST begin a new Ogg + page. +All other data packets are placed one at a time into Ogg pages + until the end of the stream. +Packets can span pages and multiple packets can be placed within any + one page. +The last page in the logical bitstream SHOULD have its + 'end of stream' flag set to indicate complete transmission + of the available video. + +Frame data pages MUST be marked with a granule position corresponding to + the end of the display interval of the last frame/packet that finishes + in that page. See the next section for details. + +\subsection{Granule position} + +Data packets are marked by a granulepos derived from the count of decodable +frames after that packet is processed. The field itself is divided into two +sections, the width of the less significant section being given by the KFGSHIFT +parameter decoded from the identification header +(Section~\ref{sec:idheader}). +The more significant portion of the field gives the count of coded +frames after the coding of the last keyframe in stream, and the less +significant portion gives the count of frames since the last keyframe. +Thus a stream would begin with a split granulepos of $1|0$ (a keyframe), +followed by $1|1$, $1|2$, $1|3$, etc. Around a keyframe in the +middle of the stream the granulepos sequence might be $1234|35$, +$1234|36$, $1234|37$, $1271|0$ (for the keyframe), $1271|1$, and so +on. In this way the granulepos field increased monotonically as required +by the Ogg format, but contains information necessary to efficiently +find the previous keyframe to continue decoding after a seek. + +Prior to bitstream version 3.2.1, data packets were marked by a +granulepos derived from the index of the frame being decoded, +rather than the count. That is they marked the beginning of the +display interval of a frame rather than the end. Such streams +have the VREV field of the identification header set to `0' +instead of `1'. They can be interpreted according to the description +above by adding 1 to the more signification field of the split +granulepos when VREV is less than 1. + +\section{Multiplexed stream mapping} + +Applications supporting Ogg Theora must support Theora bitstreams + multiplexed with compressed audio data in the Vorbis I and Speex + formats, and should support Ogg-encapsulated MNG graphics for overlays. + +Multiple audio and video bitstreams may be multiplexed together. +How playback of multiple/alternate streams is handled is up to the + application. +Some conventions based on included metadata aide interoperability + in this respect. +%TODO: describe multiple vs. alternate streams, language mapping +% and reference metadata descriptions. + +\subsection{Chained streams} + +Ogg Theora decoders and playback applications MUST support both grouped + streams (multiplexed concurrent logical streams) and chained streams + (sequential concatenation of independent physical bitstreams). + +The number and codec data types of multiplexed streams and the decoder + parameters for those stream types that re-occur can all change at a + chaining boundary. +A playback application MUST be prepared to handle such changes and + SHOULD do so smoothly with the minimum possible visible disruption. +The specification of grouped streams below applies independently to each + segment of a chained bitstream. + +\subsection{Grouped streams} + +At the beginning of a multiplexed stream, the `beginning of stream' + pages for each logical bitstream will be grouped together. +Within these, the first page to occur MUST be the Theora page. +This facilitates identification of Ogg Theora files among other + Ogg-encapsulated content. +A playback application must nevertheless handle streams where this + arrangement is not correct. +%TBT: Then what's the point of requiring it in the spec? + +If there is more than one Theora logical stream, the first page should + be from the primary stream. +That is, the best choice for the stream a generic player should begin + displaying without special user direction. +If there is more than one audio stream, or of any other stream + type, the identification page of the primary stream of that type + should be placed before the others. +%TBT: That's all pretty vague. + +After the `beginning of stream' pages, the header pages of each of + the logical streams MUST be grouped together before any data pages + occur. + +After all the header pages have been placed, + the data pages are multiplexed together. +They should be placed in the stream in increasing order by the + time equivalents of their granule position fields. +This facilitates seeking while limiting the buffering requirements of the + playback demultiplexer. +%TODO: A lot of this language is encoder-oriented. +%TODO: We define a decoder-oriented specification. +%TODO: The language should be changed to match. + +\cleardoublepage +\chapter{VP3} + +\section{VP3 Compatibility} +\label{app:vp3-compat} +This section lists all of the encoder and decoder issues that may affect VP3 + compatibly. +Each is described in more detail in the text itself. +This list is provided merely for reference. + +\begin{itemize} +\item +Bitstream headers (Section~\ref{sec:headers}). +\begin{itemize} +\item +Identification header (Section~\ref{sec:idheader}). +\begin{itemize} +\item +Non-multiple of 16 picture sizes. +\item +Standardized color spaces. +\item +Support for $4:4:4$ and $4:2:2$ pixel formats. +\end{itemize} +\item +Setup header +\begin{itemize} +\item +Loop filter limit values (Section~\ref{sub:loop-filter-limits}). +\item +Quantization parameters (Section~\ref{sub:quant-params}). +\item +Huffman tables (Section~\ref{sub:huffman-tables}). +\end{itemize} +\end{itemize} +\item +Frame header format (Section~\ref{sub:frame-header}). +\item +Extended long-run bit strings (Section~\ref{sub:long-run}). +\item +INTER\_MV\_FOUR handling of uncoded blocks (Section~\ref{sub:mb-mv-decode}). +\item +Block-level \qi\ values (Section~\ref{sub:block-qis}). +\item +Zero-length EOB runs (Section~\ref{sub:eob-token}). +\item +Unrestricted motion vector padding and the loop filter + (Section~\ref{sub:loop-filt}). +\end{itemize} + +\section{Loop Filter Limit Values} +\label{app:vp3-loop-filter-limits} + +The hard-coded loop filter limit values used in VP3 are defined as follows: +\begin{align*} +\bitvar{LFLIMS} = & \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 30, & 25, & 20, & 20, & 15, & 15, & 14, & 14, & \\ + & 13, & 13, & 12, & 12, & 11, & 11, & 10, & 10, & \\ + & 9, & 9, & 8, & 8, & 7, & 7, & 7, & 7, & \\ + & 6, & 6, & 6, & 6, & 5, & 5, & 5, & 5, & \\ + & 4, & 4, & 4, & 4, & 3, & 3, & 3, & 3, & \\ + & 2, & 2, & 2, & 2, & 2, & 2, & 2, & 2, & \\ + & 0, & 0, & 0, & 0, & 0, & 0, & 0, & 0, & \\ + & 0, & 0, & 0, & 0, & 0, & 0, & 0, & 0\;\ & \!\} \\ +\end{array} +\end{align*} + +\section{Quantization Parameters} +\label{app:vp3-quant-params} + +The hard-coded quantization parameters used by VP3 are defined as follows: + +\begin{align*} +\bitvar{ACSCALE} = & \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 500, & 450, & 400, & 370, & 340, & 310, & 285, & 265, & \\ + & 245, & 225, & 210, & 195, & 185, & 180, & 170, & 160, & \\ + & 150, & 145, & 135, & 130, & 125, & 115, & 110, & 107, & \\ + & 100, & 96, & 93, & 89, & 85, & 82, & 75, & 74, & \\ + & 70, & 68, & 64, & 60, & 57, & 56, & 52, & 50, & \\ + & 49, & 45, & 44, & 43, & 40, & 38, & 37, & 35, & \\ + & 33, & 32, & 30, & 29, & 28, & 25, & 24, & 22, & \\ + & 21, & 19, & 18, & 17, & 15, & 13, & 12, & 10\;\ & \!\} \\ +\end{array} \\ +\bitvar{DCSCALE} = & \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 220, & 200, & 190, & 180, & 170, & 170, & 160, & 160, & \\ + & 150, & 150, & 140, & 140, & 130, & 130, & 120, & 120, & \\ + & 110, & 110, & 100, & 100, & 90, & 90, & 90, & 80, & \\ + & 80, & 80, & 70, & 70, & 70, & 60, & 60, & 60, & \\ + & 60, & 50, & 50, & 50, & 50, & 40, & 40, & 40, & \\ + & 40, & 40, & 30, & 30, & 30, & 30, & 30, & 30, & \\ + & 30, & 20, & 20, & 20, & 20, & 20, & 20, & 20, & \\ + & 20, & 10, & 10, & 10, & 10, & 10, & 10, & 10\;\ & \!\} \\ +\end{array} +\end{align*} + +VP3 defines only a single quantization range for each quantization type and + color plane, and the base matrix used is constant throughout the range. +There are three base matrices defined. +The first is used for the $Y'$ channel of INTRA mode blocks, and the second for + both the $C_b$ and $C_r$ channels of INTRA mode blocks. +The last is used for INTER mode blocks of all channels. + +\begin{align*} +\bitvar{BMS} = \{ & \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 16, & 11, & 10, & 16, & 24, & 40, & 51, & 61, & \\ + & 12, & 12, & 14, & 19, & 26, & 58, & 60, & 55, & \\ + & 14, & 13, & 16, & 24, & 40, & 57, & 69, & 56, & \\ + & 14, & 17, & 22, & 29, & 51, & 87, & 80, & 62, & \\ + & 18, & 22, & 37, & 58, & 68, & 109, & 103, & 77, & \\ + & 24, & 35, & 55, & 64, & 81, & 104, & 113, & 92, & \\ + & 49, & 64, & 78, & 87, & 103, & 121, & 120, & 101, & \\ + & 72, & 92, & 95, & 98, & 112, & 100, & 103, & 99\;\ & \!\}, \\ +%\end{array} \\ +%& \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 17, & 18, & 24, & 47, & 99, & 99, & 99, & 99, & \\ + & 18, & 21, & 26, & 66, & 99, & 99, & 99, & 99, & \\ + & 24, & 26, & 56, & 99, & 99, & 99, & 99, & 99, & \\ + & 47, & 66, & 99, & 99, & 99, & 99, & 99, & 99, & \\ + & 99, & 99, & 99, & 99, & 99, & 99, & 99, & 99, & \\ + & 99, & 99, & 99, & 99, & 99, & 99, & 99, & 99, & \\ + & 99, & 99, & 99, & 99, & 99, & 99, & 99, & 99, & \\ + & 99, & 99, & 99, & 99, & 99, & 99, & 99, & 99\;\ & \!\}, \\ +%\end{array} \\ +%& \begin{array}[t]{r@{}rrrrrrrr@{}l} +\{ & 16, & 16, & 16, & 20, & 24, & 28, & 32, & 40, & \\ + & 16, & 16, & 20, & 24, & 28, & 32, & 40, & 48, & \\ + & 16, & 20, & 24, & 28, & 32, & 40, & 48, & 64, & \\ + & 20, & 24, & 28, & 32, & 40, & 48, & 64, & 64, & \\ + & 24, & 28, & 32, & 40, & 48, & 64, & 64, & 64, & \\ + & 28, & 32, & 40, & 48, & 64, & 64, & 64, & 96, & \\ + & 32, & 40, & 48, & 64, & 64, & 64, & 96, & 128, & \\ + & 40, & 48, & 64, & 64, & 64, & 96, & 128, & 128\;\ & \!\}\;\;\} \\ +\end{array} +\end{align*} + +The remaining parameters simply assign these matrices to the proper quant + ranges. + +\begin{align*} +\bitvar{NQRS} = & \{ \{1, 1, 1\}, \{1, 1, 1\} \} \\ +\bitvar{QRSIZES} = & + \{ \{ \{63\}, \{63\}, \{63\} \}, \{ \{63\}, \{63\}, \{63\} \} \} \\ +\bitvar{QRBMIS} = & + \{ \{ \{0, 0\}, \{1, 1\}, \{1, 1\} \}, \{ \{2, 2\}, \{2, 2\}, \{2, 2\} \} \} \\ +\end{align*} + +\section{Huffman Tables} +\label{app:vp3-huffman-tables} + +The following tables contain the hard-coded Huffman codes used by VP3. +There are 80 tables in all, each with a Huffman code for all 32 token values. +The tokens are sorted by the most significant bits of their Huffman code. +This is the same order in which they will be decoded from the setup header. + +\include{vp3huff} + +\cleardoublepage +\chapter{Colophon} + +Ogg is a \href{http://www.xiph.org}{Xiph.Org Foundation} effort to protect + essential tenets of Internet multimedia from corporate hostage-taking; Open + Source is the net's greatest tool to keep everyone honest. +See \href{http://www.xiph.org/about.html}{About the Xiph.Org Foundation} for + details. + +Ogg Theora is the first Ogg video codec. +Anyone may freely use and distribute the Ogg and Theora specifications, whether + in private, public, or corporate capacity. +However, the Xiph.Org Foundation and the Ogg project reserve the right to set + the Ogg Theora specification and certify specification compliance. + +Xiph.Org's Theora software codec implementation is distributed under a BSD-like + license. +This does not restrict third parties from distributing independent + implementations of Theora software under other licenses. + +\begin{wrapfigure}{l}{0pt} +\includegraphics[width=2.5cm]{xifish} +\end{wrapfigure} + +These pages are Copyright \textcopyright{} 2004-2007 Xiph.Org Foundation. +All rights reserved. +Ogg, Theora, Vorbis, Xiph.Org Foundation and their logos are trademarks + (\texttrademark) of the \href{http://www.xiph.org}{Xiph.Org Foundation}. + +This document is set in \LaTeX. + + + +\cleardoublepage +\bibliography{spec} + +\end{document} diff --git a/libs/libtheora-1.1/doc/spec/superblock.fig b/libs/libtheora-1.1/doc/spec/superblock.fig new file mode 100644 index 00000000..082c31f1 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/superblock.fig @@ -0,0 +1,72 @@ +#FIG 3.2 Produced by xfig version 3.2.5-alpha4 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 270 180 5905 4860 +6 387 3531 1542 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 4687 675 4687 675 4397 387 4397 387 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 675 4687 963 4687 963 4397 675 4397 675 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 963 4687 1252 4687 1252 4397 963 4397 963 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1252 4397 1542 4397 1542 4109 1252 4109 1252 4397 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 4397 675 4397 675 4109 387 4109 387 4397 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 4109 675 4109 675 3820 387 3820 387 4109 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 963 4109 1252 4109 1252 3820 963 3820 963 4109 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1252 4109 1542 4109 1542 3820 1252 3820 1252 4109 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1252 3820 1542 3820 1542 3531 1252 3531 1252 3820 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 675 3820 963 3820 963 3531 675 3531 675 3820 +-6 +6 387 3531 1542 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1252 4687 1542 4687 1542 4397 1252 4397 1252 4687 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 963 4397 1252 4397 1252 4109 963 4109 963 4397 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 963 3820 1252 3820 1252 3531 963 3531 963 3820 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 3820 675 3820 675 3531 387 3531 387 3820 +-6 +6 357 3502 1570 4715 +6 675 3820 963 4397 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 675 4397 963 4397 963 4109 675 4109 675 4397 +2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 675 4109 963 4109 963 3820 675 3820 675 4109 +-6 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 3531 1542 3531 1542 4687 387 4687 387 3531 +-6 +2 2 1 2 0 7 50 -1 -1 6.000 0 0 -1 0 0 5 + 387 353 5876 353 5876 4687 387 4687 387 353 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1542 3531 2697 3531 2697 4687 1542 4687 1542 3531 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 2697 3531 3854 3531 3854 4687 2697 4687 2697 3531 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 2375 1542 2375 1542 3531 387 3531 387 2375 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 1542 2375 2697 2375 2697 3531 1542 3531 1542 2375 +2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 387 1220 1542 1220 1542 2375 387 2375 387 1220 +4 0 0 50 -1 0 7 0.0000 4 125 270 270 4831 (0,0)\001 +4 0 0 50 -1 0 7 0.0000 4 96 367 473 297 Frame\001 +4 0 0 50 -1 0 7 0.0000 4 125 1002 501 3474 Super Block (4x4)\001 +4 0 0 50 -1 0 7 0.0000 4 96 203 415 4657 8x8\001 +4 0 0 50 -1 0 7 0.0000 4 96 318 357 4513 Block\001 +4 0 0 50 -1 0 13 0.0000 4 20 145 4085 4081 ...\001 +4 0 0 50 -1 0 13 4.7124 4 20 145 848 815 ...\001 +-6 diff --git a/libs/libtheora-1.1/doc/spec/vp3huff.c b/libs/libtheora-1.1/doc/spec/vp3huff.c new file mode 100644 index 00000000..87c93b40 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/vp3huff.c @@ -0,0 +1,918 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + function: dump the VP3.1 huffman tables in a form suitable for + inclusion in the spec. + last mod: $Id: vp3huff.c 14078 2007-10-31 21:24:44Z giles $ + + ********************************************************************/ + +#include +#include +#include + + + +typedef struct{ + unsigned long pattern; + int nbits; +}theora_huff_code; + + + +/*The default Huffman codes used for VP3.1. + These tables were generated by /experimental/derf/theora-exp/tools/huffgen.c + using the same algorithm and sampled frequency counts used by VP3.*/ +const theora_huff_code TH_VP31_HUFF_CODES[80][32]={ + { + {0x002D, 6},{0x0026, 7},{0x0166, 9},{0x004E, 8}, + {0x02CE,10},{0x059E,11},{0x027D,11},{0x0008, 5}, + {0x04F9,12},{0x000F, 4},{0x000E, 4},{0x001B, 5}, + {0x0006, 4},{0x0008, 4},{0x0005, 4},{0x001A, 5}, + {0x0015, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x0029, 6}, + {0x0028, 6},{0x00B2, 8},{0x04F8,12},{0x059F,11}, + {0x009E, 9},{0x013F,10},{0x0012, 6},{0x0058, 7} + }, + { + {0x0010, 5},{0x0047, 7},{0x01FF, 9},{0x008C, 8}, + {0x03FC,10},{0x046A,11},{0x0469,11},{0x0022, 6}, + {0x11A1,13},{0x000E, 4},{0x000D, 4},{0x0004, 4}, + {0x0005, 4},{0x0009, 4},{0x0006, 4},{0x001E, 5}, + {0x0016, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x000A, 4},{0x0017, 5},{0x007D, 7}, + {0x007E, 7},{0x011B, 9},{0x08D1,12},{0x03FD,10}, + {0x046B,11},{0x11A0,13},{0x007C, 7},{0x00FE, 8} + }, + { + {0x0016, 5},{0x0020, 6},{0x0086, 8},{0x0087, 8}, + {0x0367,10},{0x06CC,11},{0x06CB,11},{0x006E, 7}, + {0x366D,14},{0x000F, 4},{0x000E, 4},{0x0004, 4}, + {0x0005, 4},{0x000A, 4},{0x0006, 4},{0x001A, 5}, + {0x0011, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x006F, 7}, + {0x006D, 7},{0x0364,10},{0x0D9A,12},{0x06CA,11}, + {0x1B37,13},{0x366C,14},{0x0042, 7},{0x00D8, 8} + }, + { + {0x0000, 4},{0x002D, 6},{0x00F7, 8},{0x0058, 7}, + {0x0167, 9},{0x02CB,10},{0x02CA,10},{0x000E, 6}, + {0x1661,13},{0x0003, 3},{0x0002, 3},{0x0008, 4}, + {0x0009, 4},{0x000D, 4},{0x0002, 4},{0x001F, 5}, + {0x0017, 5},{0x0001, 4},{0x000C, 4},{0x000E, 4}, + {0x000A, 4},{0x0006, 5},{0x0078, 7},{0x000F, 6}, + {0x007A, 7},{0x0164, 9},{0x0599,11},{0x02CD,10}, + {0x0B31,12},{0x1660,13},{0x0079, 7},{0x00F6, 8} + }, + { + {0x0003, 4},{0x003C, 6},{0x000F, 7},{0x007A, 7}, + {0x001D, 8},{0x0020, 9},{0x0072,10},{0x0006, 6}, + {0x0399,13},{0x0004, 3},{0x0005, 3},{0x0005, 4}, + {0x0006, 4},{0x000E, 4},{0x0004, 4},{0x0000, 4}, + {0x0019, 5},{0x0002, 4},{0x000D, 4},{0x0007, 4}, + {0x001F, 5},{0x0030, 6},{0x0011, 8},{0x0031, 6}, + {0x0005, 6},{0x0021, 9},{0x00E7,11},{0x0038, 9}, + {0x01CD,12},{0x0398,13},{0x007B, 7},{0x0009, 7} + }, + { + {0x0009, 4},{0x0002, 5},{0x0074, 7},{0x0007, 6}, + {0x00EC, 8},{0x00D1, 9},{0x01A6,10},{0x0006, 6}, + {0x0D21,13},{0x0005, 3},{0x0006, 3},{0x0008, 4}, + {0x0007, 4},{0x000F, 4},{0x0004, 4},{0x0000, 4}, + {0x001C, 5},{0x0002, 4},{0x0005, 4},{0x0003, 4}, + {0x000C, 5},{0x0035, 7},{0x01A7,10},{0x001B, 6}, + {0x0077, 7},{0x01A5,10},{0x0349,11},{0x00D0, 9}, + {0x0691,12},{0x0D20,13},{0x0075, 7},{0x00ED, 8} + }, + { + {0x000A, 4},{0x000C, 5},{0x0012, 6},{0x001B, 6}, + {0x00B7, 8},{0x016C, 9},{0x0099, 9},{0x005A, 7}, + {0x16D8,13},{0x0007, 3},{0x0006, 3},{0x0009, 4}, + {0x0008, 4},{0x0000, 3},{0x0005, 4},{0x0017, 5}, + {0x000E, 5},{0x0002, 4},{0x0003, 4},{0x000F, 5}, + {0x001A, 6},{0x004D, 8},{0x2DB3,14},{0x002C, 6}, + {0x0011, 6},{0x02DA,10},{0x05B7,11},{0x0098, 9}, + {0x0B6D,12},{0x2DB2,14},{0x0010, 6},{0x0027, 7} + }, + { + {0x000D, 4},{0x000F, 5},{0x001D, 6},{0x0008, 5}, + {0x0051, 7},{0x0056, 8},{0x00AF, 9},{0x002A, 7}, + {0x148A,13},{0x0007, 3},{0x0000, 2},{0x0008, 4}, + {0x0009, 4},{0x000C, 4},{0x0006, 4},{0x0017, 5}, + {0x000B, 5},{0x0016, 5},{0x0015, 5},{0x0009, 5}, + {0x0050, 7},{0x00AE, 9},{0x2917,14},{0x001C, 6}, + {0x0014, 6},{0x0290,10},{0x0523,11},{0x0149, 9}, + {0x0A44,12},{0x2916,14},{0x0053, 7},{0x00A5, 8} + }, + { + {0x0001, 4},{0x001D, 6},{0x00F5, 8},{0x00F4, 8}, + {0x024D,10},{0x0499,11},{0x0498,11},{0x0001, 5}, + {0x0021, 6},{0x0006, 3},{0x0005, 3},{0x0006, 4}, + {0x0005, 4},{0x0002, 4},{0x0007, 5},{0x0025, 6}, + {0x007B, 7},{0x001C, 6},{0x0020, 6},{0x000D, 6}, + {0x0048, 7},{0x0092, 8},{0x0127, 9},{0x000E, 4}, + {0x0004, 4},{0x0011, 5},{0x000C, 6},{0x003C, 6}, + {0x000F, 5},{0x0000, 5},{0x001F, 5},{0x0013, 5} + }, + { + {0x0005, 4},{0x003C, 6},{0x0040, 7},{0x000D, 7}, + {0x0031, 9},{0x0061,10},{0x0060,10},{0x0002, 5}, + {0x00F5, 8},{0x0006, 3},{0x0005, 3},{0x0007, 4}, + {0x0006, 4},{0x0002, 4},{0x0009, 5},{0x0025, 6}, + {0x0007, 6},{0x0021, 6},{0x0024, 6},{0x0010, 6}, + {0x0041, 7},{0x00F4, 8},{0x0019, 8},{0x000E, 4}, + {0x0003, 4},{0x0011, 5},{0x0011, 6},{0x003F, 6}, + {0x003E, 6},{0x007B, 7},{0x0000, 4},{0x0013, 5} + }, + { + {0x000A, 4},{0x0007, 5},{0x0001, 6},{0x0009, 6}, + {0x0131, 9},{0x0261,10},{0x0260,10},{0x0015, 6}, + {0x0001, 7},{0x0007, 3},{0x0006, 3},{0x0008, 4}, + {0x0007, 4},{0x0006, 4},{0x0012, 5},{0x002F, 6}, + {0x0014, 6},{0x0027, 6},{0x002D, 6},{0x0016, 6}, + {0x004D, 7},{0x0099, 8},{0x0000, 7},{0x0004, 4}, + {0x0001, 4},{0x0005, 5},{0x0017, 6},{0x002E, 6}, + {0x002C, 6},{0x0008, 6},{0x0006, 5},{0x0001, 5} + }, + { + {0x0000, 3},{0x000E, 5},{0x0017, 6},{0x002A, 6}, + {0x0010, 7},{0x00F9,10},{0x00F8,10},{0x001E, 7}, + {0x003F, 8},{0x0007, 3},{0x0006, 3},{0x0009, 4}, + {0x0008, 4},{0x0006, 4},{0x000F, 5},{0x0005, 5}, + {0x0016, 6},{0x0029, 6},{0x002B, 6},{0x0015, 6}, + {0x0050, 7},{0x0011, 7},{0x007D, 9},{0x0004, 4}, + {0x0017, 5},{0x0006, 5},{0x0014, 6},{0x002C, 6}, + {0x002D, 6},{0x000E, 6},{0x0009, 6},{0x0051, 7} + }, + { + {0x0002, 3},{0x0018, 5},{0x002F, 6},{0x000D, 5}, + {0x0053, 7},{0x0295,10},{0x0294,10},{0x00A4, 8}, + {0x007C, 8},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x001B, 5},{0x000C, 5},{0x0028, 6}, + {0x006A, 7},{0x001E, 6},{0x001D, 6},{0x0069, 7}, + {0x00D7, 8},{0x007D, 8},{0x014B, 9},{0x0019, 5}, + {0x0016, 5},{0x002E, 6},{0x001C, 6},{0x002B, 6}, + {0x002A, 6},{0x0068, 7},{0x003F, 7},{0x00D6, 8} + }, + { + {0x0002, 3},{0x001B, 5},{0x000C, 5},{0x0018, 5}, + {0x0029, 6},{0x007F, 8},{0x02F0,10},{0x0198, 9}, + {0x0179, 9},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x001A, 5},{0x000D, 5},{0x002A, 6}, + {0x0064, 7},{0x001E, 6},{0x0067, 7},{0x005F, 7}, + {0x00CD, 8},{0x007E, 8},{0x02F1,10},{0x0016, 5}, + {0x000E, 5},{0x002E, 6},{0x0065, 7},{0x002B, 6}, + {0x0028, 6},{0x003E, 7},{0x00BD, 8},{0x0199, 9} + }, + { + {0x0002, 3},{0x0007, 4},{0x0016, 5},{0x0006, 4}, + {0x0036, 6},{0x005C, 7},{0x015D, 9},{0x015C, 9}, + {0x02BF,10},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x0018, 5},{0x0034, 6},{0x002A, 6}, + {0x005E, 7},{0x006A, 7},{0x0064, 7},{0x005D, 7}, + {0x00CB, 8},{0x00AD, 8},{0x02BE,10},{0x0014, 5}, + {0x0033, 6},{0x006E, 7},{0x005F, 7},{0x006F, 7}, + {0x006B, 7},{0x00CA, 8},{0x00AC, 8},{0x015E, 9} + }, + { + {0x000F, 4},{0x001D, 5},{0x0018, 5},{0x000B, 4}, + {0x0019, 5},{0x0029, 6},{0x00D6, 8},{0x0551,11}, + {0x0AA1,12},{0x0001, 2},{0x0000, 2},{0x0009, 4}, + {0x0008, 4},{0x001B, 5},{0x0038, 6},{0x0028, 6}, + {0x0057, 7},{0x006A, 7},{0x0068, 7},{0x0056, 7}, + {0x00E5, 8},{0x0155, 9},{0x0AA0,12},{0x0073, 7}, + {0x0069, 7},{0x00D7, 8},{0x00AB, 8},{0x00E4, 8}, + {0x00A9, 8},{0x0151, 9},{0x0150, 9},{0x02A9,10} + }, + { + {0x0008, 5},{0x0025, 7},{0x017A, 9},{0x02F7,10}, + {0x0BDB,12},{0x17B4,13},{0x2F6B,14},{0x001D, 5}, + {0x2F6A,14},{0x0008, 4},{0x0007, 4},{0x0001, 4}, + {0x0002, 4},{0x000A, 4},{0x0006, 4},{0x0000, 4}, + {0x001C, 5},{0x0009, 4},{0x000D, 4},{0x000F, 4}, + {0x000C, 4},{0x0003, 4},{0x000A, 5},{0x0016, 5}, + {0x0013, 6},{0x005D, 7},{0x0024, 7},{0x00BC, 8}, + {0x005C, 7},{0x05EC,11},{0x000B, 5},{0x005F, 7} + }, + { + {0x000F, 5},{0x0010, 6},{0x004B, 8},{0x00C6, 8}, + {0x031D,10},{0x0C71,12},{0x0C70,12},{0x0001, 4}, + {0x0C73,12},{0x0008, 4},{0x0009, 4},{0x0002, 4}, + {0x0003, 4},{0x000B, 4},{0x0006, 4},{0x0000, 4}, + {0x001C, 5},{0x0005, 4},{0x000D, 4},{0x000F, 4}, + {0x000A, 4},{0x0019, 5},{0x0013, 6},{0x001D, 5}, + {0x0030, 6},{0x0062, 7},{0x0024, 7},{0x004A, 8}, + {0x018F, 9},{0x0C72,12},{0x000E, 5},{0x0011, 6} + }, + { + {0x001B, 5},{0x0003, 6},{0x008D, 8},{0x0040, 7}, + {0x0239,10},{0x0471,11},{0x08E0,12},{0x0003, 4}, + {0x11C3,13},{0x000A, 4},{0x0009, 4},{0x0004, 4}, + {0x0005, 4},{0x000E, 4},{0x0007, 4},{0x0001, 4}, + {0x001E, 5},{0x0006, 4},{0x000C, 4},{0x000B, 4}, + {0x0002, 4},{0x0000, 5},{0x0041, 7},{0x001F, 5}, + {0x0022, 6},{0x0002, 6},{0x008F, 8},{0x008C, 8}, + {0x011D, 9},{0x11C2,13},{0x001A, 5},{0x0021, 6} + }, + { + {0x001F, 5},{0x0003, 6},{0x0003, 7},{0x0043, 7}, + {0x000B, 9},{0x0015,10},{0x0051,12},{0x0003, 4}, + {0x0050,12},{0x000D, 4},{0x000C, 4},{0x0004, 4}, + {0x0006, 4},{0x000E, 4},{0x000A, 4},{0x0001, 4}, + {0x001E, 5},{0x0005, 4},{0x0009, 4},{0x0007, 4}, + {0x0011, 5},{0x0002, 6},{0x0004, 8},{0x0002, 4}, + {0x002D, 6},{0x0020, 6},{0x0042, 7},{0x0001, 7}, + {0x0000, 7},{0x0029,11},{0x0017, 5},{0x002C, 6} + }, + { + {0x0003, 4},{0x001F, 6},{0x003A, 7},{0x005D, 7}, + {0x0173, 9},{0x02E4,10},{0x172D,13},{0x0004, 4}, + {0x172C,13},{0x000F, 4},{0x000E, 4},{0x0009, 4}, + {0x0008, 4},{0x000C, 4},{0x000A, 4},{0x0001, 4}, + {0x0016, 5},{0x0002, 4},{0x0005, 4},{0x001A, 5}, + {0x002F, 6},{0x0038, 7},{0x05CA,11},{0x0006, 4}, + {0x0037, 6},{0x001E, 6},{0x003B, 7},{0x0039, 7}, + {0x00B8, 8},{0x0B97,12},{0x0000, 4},{0x0036, 6} + }, + { + {0x0006, 4},{0x0037, 6},{0x005D, 7},{0x000C, 6}, + {0x00B9, 8},{0x02E3,10},{0x05C4,11},{0x0004, 4}, + {0x1715,13},{0x0000, 3},{0x000F, 4},{0x0008, 4}, + {0x0007, 4},{0x000C, 4},{0x0009, 4},{0x001D, 5}, + {0x0016, 5},{0x001C, 5},{0x001A, 5},{0x000B, 5}, + {0x005E, 7},{0x0170, 9},{0x1714,13},{0x000A, 4}, + {0x000A, 5},{0x0036, 6},{0x005F, 7},{0x001B, 7}, + {0x001A, 7},{0x0B8B,12},{0x0002, 4},{0x0007, 5} + }, + { + {0x000C, 4},{0x000B, 5},{0x0079, 7},{0x0022, 6}, + {0x00F0, 8},{0x0119, 9},{0x0230,10},{0x001D, 5}, + {0x08C4,12},{0x0001, 3},{0x0000, 3},{0x000A, 4}, + {0x0009, 4},{0x000B, 4},{0x0007, 4},{0x001C, 5}, + {0x003D, 6},{0x000D, 5},{0x0008, 5},{0x0015, 6}, + {0x008D, 8},{0x118B,13},{0x118A,13},{0x000D, 4}, + {0x0010, 5},{0x0009, 5},{0x0014, 6},{0x0047, 7}, + {0x00F1, 8},{0x0463,11},{0x001F, 5},{0x000C, 5} + }, + { + {0x0000, 3},{0x001A, 5},{0x0033, 6},{0x000C, 5}, + {0x0046, 7},{0x01E3, 9},{0x03C5,10},{0x0017, 5}, + {0x1E21,13},{0x0002, 3},{0x0001, 3},{0x0009, 4}, + {0x000A, 4},{0x0007, 4},{0x001B, 5},{0x003D, 6}, + {0x001B, 6},{0x0022, 6},{0x0079, 7},{0x00F0, 8}, + {0x1E20,13},{0x1E23,13},{0x1E22,13},{0x000E, 4}, + {0x0016, 5},{0x0018, 5},{0x0032, 6},{0x001A, 6}, + {0x0047, 7},{0x0789,11},{0x001F, 5},{0x0010, 5} + }, + { + {0x001D, 5},{0x0061, 7},{0x004E, 8},{0x009E, 9}, + {0x027C,11},{0x09F5,13},{0x09F4,13},{0x0003, 4}, + {0x0060, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4}, + {0x000A, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5}, + {0x0031, 6},{0x0008, 5},{0x0038, 6},{0x0012, 6}, + {0x0026, 7},{0x013F,10},{0x04FB,12},{0x000D, 4}, + {0x0002, 4},{0x000C, 5},{0x0039, 6},{0x001C, 6}, + {0x000F, 5},{0x001D, 6},{0x0008, 4},{0x0019, 5} + }, + { + {0x0007, 4},{0x0019, 6},{0x00AB, 8},{0x00AA, 8}, + {0x0119,10},{0x0461,12},{0x0460,12},{0x001B, 5}, + {0x0047, 8},{0x0001, 3},{0x0000, 3},{0x000C, 4}, + {0x000B, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5}, + {0x0035, 6},{0x003D, 6},{0x003C, 6},{0x0018, 6}, + {0x0022, 7},{0x008D, 9},{0x0231,11},{0x000E, 4}, + {0x001F, 5},{0x0009, 5},{0x002B, 6},{0x0010, 6}, + {0x0034, 6},{0x0054, 7},{0x0008, 4},{0x0014, 5} + }, + { + {0x000C, 4},{0x0005, 5},{0x0008, 6},{0x005B, 7}, + {0x004D, 9},{0x0131,11},{0x0261,12},{0x001A, 5}, + {0x0012, 7},{0x0000, 3},{0x000F, 4},{0x000A, 4}, + {0x0009, 4},{0x0006, 4},{0x001B, 5},{0x0006, 5}, + {0x001C, 6},{0x002C, 6},{0x0015, 6},{0x005A, 7}, + {0x0027, 8},{0x0099,10},{0x0260,12},{0x000E, 4}, + {0x0004, 4},{0x000F, 5},{0x0007, 5},{0x001D, 6}, + {0x000B, 5},{0x0014, 6},{0x0008, 4},{0x0017, 5} + }, + { + {0x000F, 4},{0x0013, 5},{0x0075, 7},{0x0024, 6}, + {0x0095, 8},{0x0251,10},{0x04A0,11},{0x0010, 5}, + {0x00C8, 8},{0x0002, 3},{0x0001, 3},{0x0001, 4}, + {0x0000, 4},{0x001A, 5},{0x0011, 5},{0x002C, 6}, + {0x0065, 7},{0x0074, 7},{0x004B, 7},{0x00C9, 8}, + {0x0129, 9},{0x0943,12},{0x0942,12},{0x0003, 3}, + {0x000A, 4},{0x001C, 5},{0x0018, 5},{0x0033, 6}, + {0x0017, 5},{0x002D, 6},{0x001B, 5},{0x003B, 6} + }, + { + {0x0003, 3},{0x001A, 5},{0x002D, 6},{0x0038, 6}, + {0x0028, 7},{0x0395,10},{0x0E51,12},{0x0037, 6}, + {0x00E4, 8},{0x0001, 3},{0x0000, 3},{0x001F, 5}, + {0x001E, 5},{0x0017, 5},{0x003A, 6},{0x0073, 7}, + {0x002A, 7},{0x002B, 7},{0x0029, 7},{0x01CB, 9}, + {0x0729,11},{0x1CA1,13},{0x1CA0,13},{0x0004, 3}, + {0x000A, 4},{0x0004, 4},{0x0018, 5},{0x0036, 6}, + {0x000B, 5},{0x002C, 6},{0x0019, 5},{0x003B, 6} + }, + { + {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0017, 5}, + {0x0075, 7},{0x01F5, 9},{0x07D1,11},{0x0017, 6}, + {0x01F6, 9},{0x0001, 3},{0x0000, 3},{0x001B, 5}, + {0x001A, 5},{0x000A, 5},{0x0032, 6},{0x0074, 7}, + {0x00F8, 8},{0x00F9, 8},{0x01F7, 9},{0x03E9,10}, + {0x0FA0,12},{0x1F43,13},{0x1F42,13},{0x0003, 3}, + {0x000A, 4},{0x001E, 5},{0x001C, 5},{0x003B, 6}, + {0x0018, 5},{0x0016, 6},{0x0016, 5},{0x0033, 6} + }, + { + {0x0004, 3},{0x0007, 4},{0x0018, 5},{0x001E, 5}, + {0x0036, 6},{0x0031, 7},{0x0177, 9},{0x0077, 7}, + {0x0176, 9},{0x0001, 3},{0x0000, 3},{0x001A, 5}, + {0x0019, 5},{0x003A, 6},{0x0019, 6},{0x005C, 7}, + {0x00BA, 8},{0x0061, 8},{0x00C1, 9},{0x0180,10}, + {0x0302,11},{0x0607,12},{0x0606,12},{0x0002, 3}, + {0x000A, 4},{0x001F, 5},{0x001C, 5},{0x0037, 6}, + {0x0016, 5},{0x0076, 7},{0x000D, 5},{0x002F, 6} + }, + { + {0x0000, 3},{0x000A, 4},{0x001A, 5},{0x000C, 4}, + {0x001D, 5},{0x0039, 6},{0x0078, 7},{0x005E, 7}, + {0x0393,11},{0x0002, 3},{0x0001, 3},{0x0016, 5}, + {0x000F, 5},{0x002E, 6},{0x005F, 7},{0x0073, 8}, + {0x00E5, 9},{0x01C8,10},{0x0E4A,13},{0x1C97,14}, + {0x1C96,14},{0x0E49,13},{0x0E48,13},{0x0004, 3}, + {0x0006, 4},{0x001F, 5},{0x001B, 5},{0x001D, 6}, + {0x0038, 6},{0x0038, 7},{0x003D, 6},{0x0079, 7} + }, + { + {0x000B, 5},{0x002B, 7},{0x0054, 8},{0x01B7, 9}, + {0x06D9,11},{0x0DB1,12},{0x0DB0,12},{0x0002, 4}, + {0x00AB, 9},{0x0009, 4},{0x000A, 4},{0x0007, 4}, + {0x0008, 4},{0x000F, 4},{0x000C, 4},{0x0003, 4}, + {0x001D, 5},{0x0004, 4},{0x000B, 4},{0x0006, 4}, + {0x001A, 5},{0x0003, 6},{0x00AA, 9},{0x0001, 4}, + {0x0000, 5},{0x0014, 6},{0x006C, 7},{0x00DA, 8}, + {0x0002, 6},{0x036D,10},{0x001C, 5},{0x0037, 6} + }, + { + {0x001D, 5},{0x0004, 6},{0x00B6, 8},{0x006A, 8}, + {0x05B9,11},{0x16E1,13},{0x16E0,13},{0x0007, 4}, + {0x016F, 9},{0x000C, 4},{0x000D, 4},{0x0009, 4}, + {0x0008, 4},{0x000F, 4},{0x000A, 4},{0x0003, 4}, + {0x0017, 5},{0x0002, 4},{0x0004, 4},{0x001C, 5}, + {0x002C, 6},{0x006B, 8},{0x0B71,12},{0x0005, 4}, + {0x0003, 5},{0x001B, 6},{0x005A, 7},{0x0034, 7}, + {0x0005, 6},{0x02DD,10},{0x0000, 4},{0x000C, 5} + }, + { + {0x0003, 4},{0x007F, 7},{0x00A1, 8},{0x00A0, 8}, + {0x020C,10},{0x0834,12},{0x106B,13},{0x0007, 4}, + {0x0082, 8},{0x000E, 4},{0x000D, 4},{0x000B, 4}, + {0x000C, 4},{0x0000, 3},{0x0009, 4},{0x0002, 4}, + {0x0011, 5},{0x001E, 5},{0x0015, 5},{0x003E, 6}, + {0x0040, 7},{0x041B,11},{0x106A,13},{0x0006, 4}, + {0x000A, 5},{0x0029, 6},{0x007E, 7},{0x0051, 7}, + {0x0021, 6},{0x0107, 9},{0x0004, 4},{0x000B, 5} + }, + { + {0x0007, 4},{0x001B, 6},{0x00F6, 8},{0x00E9, 8}, + {0x03A1,10},{0x0740,11},{0x0E82,12},{0x001F, 5}, + {0x01EF, 9},{0x0001, 3},{0x0002, 3},{0x000B, 4}, + {0x000C, 4},{0x000D, 4},{0x0008, 4},{0x001C, 5}, + {0x0003, 5},{0x0012, 5},{0x0002, 5},{0x0075, 7}, + {0x01D1, 9},{0x1D07,13},{0x1D06,13},{0x000A, 4}, + {0x0013, 5},{0x003B, 6},{0x001A, 6},{0x007A, 7}, + {0x003C, 6},{0x01EE, 9},{0x0000, 4},{0x000C, 5} + }, + { + {0x000D, 4},{0x003D, 6},{0x0042, 7},{0x0037, 7}, + {0x00D9, 9},{0x0362,11},{0x06C6,12},{0x001F, 5}, + {0x0086, 8},{0x0001, 3},{0x0002, 3},{0x000C, 4}, + {0x000B, 4},{0x000A, 4},{0x0001, 4},{0x000F, 5}, + {0x0025, 6},{0x003C, 6},{0x001A, 6},{0x0087, 8}, + {0x01B0,10},{0x0D8F,13},{0x0D8E,13},{0x000E, 4}, + {0x0013, 5},{0x000C, 5},{0x0024, 6},{0x0020, 6}, + {0x0011, 5},{0x006D, 8},{0x0000, 4},{0x000E, 5} + }, + { + {0x0000, 3},{0x0012, 5},{0x0076, 7},{0x0077, 7}, + {0x014D, 9},{0x0533,11},{0x14C9,13},{0x0013, 5}, + {0x00A5, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x0008, 4},{0x001A, 5},{0x002B, 6}, + {0x0075, 7},{0x0074, 7},{0x00A7, 8},{0x0298,10}, + {0x14C8,13},{0x14CB,13},{0x14CA,13},{0x000F, 4}, + {0x001C, 5},{0x0007, 5},{0x002A, 6},{0x0028, 6}, + {0x001B, 5},{0x00A4, 8},{0x0002, 4},{0x0006, 5} + }, + { + {0x0002, 3},{0x001A, 5},{0x002B, 6},{0x003A, 6}, + {0x00ED, 8},{0x0283,10},{0x0A0A,12},{0x0004, 5}, + {0x00A1, 8},{0x0004, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x001F, 5},{0x0006, 5},{0x0077, 7}, + {0x00A3, 8},{0x00A2, 8},{0x0140, 9},{0x1417,13}, + {0x1416,13},{0x0A09,12},{0x0A08,12},{0x0000, 3}, + {0x001E, 5},{0x0007, 5},{0x002A, 6},{0x0029, 6}, + {0x001C, 5},{0x00EC, 8},{0x001B, 5},{0x0005, 5} + }, + { + {0x0002, 3},{0x0002, 4},{0x0018, 5},{0x001D, 5}, + {0x0035, 6},{0x00E4, 8},{0x01CF,11},{0x001D, 7}, + {0x0072, 9},{0x0004, 3},{0x0005, 3},{0x0006, 4}, + {0x0007, 4},{0x0006, 5},{0x0073, 7},{0x0038, 8}, + {0x01CE,11},{0x039B,12},{0x0398,12},{0x0733,13}, + {0x0732,13},{0x0735,13},{0x0734,13},{0x0000, 3}, + {0x001F, 5},{0x001B, 5},{0x0034, 6},{0x000F, 6}, + {0x001E, 5},{0x00E5, 8},{0x0019, 5},{0x0038, 6} + }, + { + {0x0016, 5},{0x0050, 7},{0x0172, 9},{0x02E7,10}, + {0x1732,13},{0x2E67,14},{0x2E66,14},{0x0006, 4}, + {0x0051, 7},{0x0001, 3},{0x0000, 3},{0x000D, 4}, + {0x000C, 4},{0x0009, 4},{0x001C, 5},{0x0009, 5}, + {0x001C, 6},{0x001D, 6},{0x005D, 7},{0x00B8, 8}, + {0x05CD,11},{0x1731,13},{0x1730,13},{0x000F, 4}, + {0x0005, 4},{0x000F, 5},{0x0008, 5},{0x0029, 6}, + {0x001D, 5},{0x002F, 6},{0x0008, 4},{0x0015, 5} + }, + { + {0x0009, 4},{0x0021, 6},{0x0040, 7},{0x00AD, 8}, + {0x02B0,10},{0x1589,13},{0x1588,13},{0x001C, 5}, + {0x005F, 7},{0x0000, 3},{0x000F, 4},{0x000D, 4}, + {0x000C, 4},{0x0006, 4},{0x0011, 5},{0x002A, 6}, + {0x0057, 7},{0x005E, 7},{0x0041, 7},{0x0159, 9}, + {0x0563,11},{0x158B,13},{0x158A,13},{0x0001, 3}, + {0x0005, 4},{0x0014, 5},{0x003B, 6},{0x002E, 6}, + {0x0004, 4},{0x003A, 6},{0x0007, 4},{0x0016, 5} + }, + { + {0x000E, 4},{0x0007, 5},{0x0046, 7},{0x0045, 7}, + {0x0064, 9},{0x032A,12},{0x0657,13},{0x0018, 5}, + {0x000D, 6},{0x0000, 3},{0x000F, 4},{0x000A, 4}, + {0x000B, 4},{0x001A, 5},{0x0036, 6},{0x0047, 7}, + {0x0044, 7},{0x0018, 7},{0x0033, 8},{0x00CB,10}, + {0x0656,13},{0x0329,12},{0x0328,12},{0x0002, 3}, + {0x0006, 4},{0x0019, 5},{0x000E, 5},{0x0037, 6}, + {0x0009, 4},{0x000F, 5},{0x0002, 4},{0x0010, 5} + }, + { + {0x0003, 3},{0x0018, 5},{0x0023, 6},{0x0077, 7}, + {0x0194, 9},{0x1956,13},{0x32AF,14},{0x003A, 6}, + {0x0076, 7},{0x0002, 3},{0x0001, 3},{0x001F, 5}, + {0x001E, 5},{0x0014, 5},{0x0022, 6},{0x0064, 7}, + {0x0197, 9},{0x0196, 9},{0x032B,10},{0x0654,11}, + {0x32AE,14},{0x1955,13},{0x1954,13},{0x0000, 3}, + {0x0009, 4},{0x001C, 5},{0x0015, 5},{0x0010, 5}, + {0x000D, 4},{0x0017, 5},{0x0016, 5},{0x0033, 6} + }, + { + {0x0005, 3},{0x0006, 4},{0x003E, 6},{0x0010, 5}, + {0x0048, 7},{0x093F,12},{0x24FA,14},{0x0032, 6}, + {0x0067, 7},{0x0002, 3},{0x0001, 3},{0x001B, 5}, + {0x001E, 5},{0x0034, 6},{0x0066, 7},{0x0092, 8}, + {0x0126, 9},{0x024E,10},{0x049E,11},{0x49F7,15}, + {0x49F6,15},{0x24F9,14},{0x24F8,14},{0x0000, 3}, + {0x0007, 4},{0x0018, 5},{0x0011, 5},{0x003F, 6}, + {0x000E, 4},{0x0013, 5},{0x0035, 6},{0x0025, 6} + }, + { + {0x0005, 3},{0x0008, 4},{0x0012, 5},{0x001C, 5}, + {0x001C, 6},{0x00EA, 9},{0x1D75,14},{0x001E, 6}, + {0x0066, 7},{0x0001, 3},{0x0002, 3},{0x001B, 5}, + {0x001A, 5},{0x001F, 6},{0x003B, 7},{0x0074, 8}, + {0x01D6,10},{0x03AF,11},{0x1D74,14},{0x1D77,14}, + {0x1D76,14},{0x0EB9,13},{0x0EB8,13},{0x000F, 4}, + {0x0006, 4},{0x0013, 5},{0x003B, 6},{0x003A, 6}, + {0x0000, 3},{0x0018, 5},{0x0032, 6},{0x0067, 7} + }, + { + {0x0004, 3},{0x000A, 4},{0x001B, 5},{0x000C, 4}, + {0x000D, 5},{0x00E6, 8},{0x0684,11},{0x0072, 7}, + {0x00E7, 8},{0x0002, 3},{0x0001, 3},{0x0017, 5}, + {0x0016, 5},{0x0018, 6},{0x00D1, 8},{0x01A0, 9}, + {0x0686,11},{0x0D0F,12},{0x0D0A,12},{0x1A17,13}, + {0x1A16,13},{0x1A1D,13},{0x1A1C,13},{0x000F, 4}, + {0x001D, 5},{0x000E, 5},{0x0035, 6},{0x0038, 6}, + {0x0000, 3},{0x000F, 5},{0x0019, 6},{0x0069, 7} + }, + { + {0x0003, 3},{0x000C, 4},{0x001B, 5},{0x0000, 3}, + {0x0003, 4},{0x002E, 6},{0x0051, 9},{0x00BC, 8}, + {0x0053, 9},{0x0004, 3},{0x0002, 3},{0x0016, 5}, + {0x0015, 5},{0x0015, 7},{0x0050, 9},{0x00A4,10}, + {0x0294,12},{0x052B,13},{0x052A,13},{0x052D,13}, + {0x052C,13},{0x052F,13},{0x052E,13},{0x000E, 4}, + {0x001A, 5},{0x0004, 5},{0x0028, 6},{0x0029, 6}, + {0x000F, 4},{0x000B, 6},{0x005F, 7},{0x00BD, 8} + }, + { + {0x0003, 4},{0x0009, 6},{0x00D0, 8},{0x01A3, 9}, + {0x0344,10},{0x0D14,12},{0x1A2B,13},{0x0004, 4}, + {0x0015, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4}, + {0x000C, 4},{0x000E, 4},{0x0009, 4},{0x001B, 5}, + {0x000A, 5},{0x0014, 5},{0x000D, 5},{0x002A, 6}, + {0x0014, 7},{0x068B,11},{0x1A2A,13},{0x0008, 4}, + {0x000B, 5},{0x002B, 6},{0x000B, 6},{0x0069, 7}, + {0x0035, 6},{0x0008, 6},{0x0007, 4},{0x000C, 5} + }, + { + {0x000A, 4},{0x003C, 6},{0x0032, 7},{0x0030, 7}, + {0x00C5, 9},{0x0621,12},{0x0620,12},{0x001F, 5}, + {0x0033, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4}, + {0x000D, 4},{0x000C, 4},{0x0004, 4},{0x000D, 5}, + {0x0026, 6},{0x0027, 6},{0x0014, 6},{0x0063, 8}, + {0x0189,10},{0x0623,12},{0x0622,12},{0x000B, 4}, + {0x0012, 5},{0x003D, 6},{0x0022, 6},{0x0015, 6}, + {0x000B, 5},{0x0023, 6},{0x0007, 4},{0x0010, 5} + }, + { + {0x000F, 4},{0x000C, 5},{0x0043, 7},{0x0010, 6}, + {0x0044, 8},{0x0114,10},{0x0455,12},{0x0018, 5}, + {0x0023, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4}, + {0x000D, 4},{0x0009, 4},{0x0019, 5},{0x0009, 5}, + {0x0017, 6},{0x0016, 6},{0x0042, 7},{0x008B, 9}, + {0x0454,12},{0x0457,12},{0x0456,12},{0x000B, 4}, + {0x0015, 5},{0x000A, 5},{0x0029, 6},{0x0020, 6}, + {0x000D, 5},{0x0028, 6},{0x0007, 4},{0x0011, 5} + }, + { + {0x0001, 3},{0x001A, 5},{0x0029, 6},{0x002A, 6}, + {0x00A0, 8},{0x0285,10},{0x1425,13},{0x0002, 5}, + {0x0000, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4}, + {0x000B, 4},{0x0008, 4},{0x0012, 5},{0x0001, 6}, + {0x0051, 7},{0x0001, 7},{0x0143, 9},{0x0508,11}, + {0x1424,13},{0x1427,13},{0x1426,13},{0x000F, 4}, + {0x001C, 5},{0x0003, 5},{0x0037, 6},{0x002B, 6}, + {0x0013, 5},{0x0036, 6},{0x001D, 5},{0x0001, 5} + }, + { + {0x0004, 3},{0x001F, 5},{0x003D, 6},{0x0006, 5}, + {0x0016, 7},{0x0053, 9},{0x014A,11},{0x0034, 6}, + {0x002A, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x001C, 5},{0x0037, 6},{0x0017, 7}, + {0x002B, 8},{0x0028, 8},{0x00A4,10},{0x052D,13}, + {0x052C,13},{0x052F,13},{0x052E,13},{0x0000, 3}, + {0x001D, 5},{0x0007, 5},{0x0004, 5},{0x0035, 6}, + {0x0014, 5},{0x0036, 6},{0x0015, 5},{0x003C, 6} + }, + { + {0x0004, 3},{0x000A, 4},{0x0007, 5},{0x001D, 5}, + {0x0009, 6},{0x01F3, 9},{0x07C7,11},{0x0008, 6}, + {0x01F0, 9},{0x0003, 3},{0x0002, 3},{0x000D, 4}, + {0x000C, 4},{0x0017, 5},{0x007D, 7},{0x01F2, 9}, + {0x07C6,11},{0x07C5,11},{0x1F12,13},{0x3E27,14}, + {0x3E26,14},{0x1F11,13},{0x1F10,13},{0x0000, 3}, + {0x001E, 5},{0x0006, 5},{0x0039, 6},{0x0038, 6}, + {0x003F, 6},{0x002C, 6},{0x0005, 5},{0x002D, 6} + }, + { + {0x0002, 3},{0x0007, 4},{0x0018, 5},{0x0003, 4}, + {0x0005, 5},{0x0035, 7},{0x004F, 9},{0x0012, 7}, + {0x04E5,13},{0x0005, 3},{0x0004, 3},{0x000D, 4}, + {0x000E, 4},{0x0033, 6},{0x0026, 8},{0x009D,10}, + {0x04E4,13},{0x04E7,13},{0x04E6,13},{0x04E1,13}, + {0x04E0,13},{0x04E3,13},{0x04E2,13},{0x0000, 3}, + {0x001F, 5},{0x000C, 5},{0x003D, 6},{0x003C, 6}, + {0x0032, 6},{0x0034, 7},{0x001B, 6},{0x0008, 6} + }, + { + {0x0000, 3},{0x0004, 4},{0x001C, 5},{0x000F, 4}, + {0x0002, 4},{0x0007, 5},{0x0075, 7},{0x00E8, 8}, + {0x1D2A,13},{0x0005, 3},{0x0004, 3},{0x000D, 4}, + {0x000C, 4},{0x0077, 7},{0x0E96,12},{0x3A57,14}, + {0x3A56,14},{0x3A5D,14},{0x3A5C,14},{0x3A5F,14}, + {0x3A5E,14},{0x1D29,13},{0x1D28,13},{0x0003, 3}, + {0x0006, 5},{0x000A, 5},{0x002C, 7},{0x0017, 6}, + {0x0076, 7},{0x01D3, 9},{0x03A4,10},{0x002D, 7} + }, + { + {0x000A, 4},{0x0024, 6},{0x00BF, 8},{0x0085, 8}, + {0x0211,10},{0x0842,12},{0x1087,13},{0x0018, 5}, + {0x0020, 6},{0x0001, 3},{0x0002, 3},{0x000E, 4}, + {0x000D, 4},{0x0007, 4},{0x0013, 5},{0x0025, 6}, + {0x005E, 7},{0x0043, 7},{0x00BE, 8},{0x0109, 9}, + {0x1086,13},{0x0841,12},{0x0840,12},{0x000F, 4}, + {0x0001, 4},{0x0011, 5},{0x0000, 5},{0x002E, 6}, + {0x0019, 5},{0x0001, 5},{0x0006, 4},{0x0016, 5} + }, + { + {0x0002, 3},{0x000F, 5},{0x006F, 7},{0x0061, 7}, + {0x0374,10},{0x1BA8,13},{0x3753,14},{0x0012, 5}, + {0x0036, 6},{0x0000, 3},{0x0001, 3},{0x000A, 4}, + {0x000B, 4},{0x001A, 5},{0x0031, 6},{0x0060, 7}, + {0x00DC, 8},{0x01BB, 9},{0x06EB,11},{0x1BAB,13}, + {0x3752,14},{0x3755,14},{0x3754,14},{0x000E, 4}, + {0x0006, 4},{0x0013, 5},{0x000E, 5},{0x003E, 6}, + {0x0008, 4},{0x001E, 5},{0x0019, 5},{0x003F, 6} + }, + { + {0x0003, 3},{0x001C, 5},{0x0025, 6},{0x0024, 6}, + {0x01DA, 9},{0x1DBD,13},{0x3B7C,14},{0x003C, 6}, + {0x003D, 6},{0x0000, 3},{0x0001, 3},{0x000B, 4}, + {0x000A, 4},{0x000B, 5},{0x0077, 7},{0x00EC, 8}, + {0x03B6,10},{0x076E,11},{0x1DBF,13},{0x76FB,15}, + {0x76FA,15},{0x3B79,14},{0x3B78,14},{0x000D, 4}, + {0x001F, 5},{0x0013, 5},{0x000A, 5},{0x0008, 5}, + {0x000C, 4},{0x0008, 4},{0x0009, 5},{0x003A, 6} + }, + { + {0x0005, 3},{0x0003, 4},{0x0004, 5},{0x0010, 5}, + {0x008F, 8},{0x0475,11},{0x11D1,13},{0x0079, 7}, + {0x0027, 6},{0x0002, 3},{0x0003, 3},{0x0001, 4}, + {0x0000, 4},{0x0026, 6},{0x0046, 7},{0x011C, 9}, + {0x0477,11},{0x08ED,12},{0x11D0,13},{0x11D3,13}, + {0x11D2,13},{0x11D9,13},{0x11D8,13},{0x000D, 4}, + {0x001F, 5},{0x0012, 5},{0x0005, 5},{0x003D, 6}, + {0x000C, 4},{0x000E, 4},{0x0022, 6},{0x0078, 7} + }, + { + {0x0005, 3},{0x000C, 4},{0x001B, 5},{0x0000, 4}, + {0x0006, 6},{0x03E2,10},{0x3E3D,14},{0x000F, 7}, + {0x0034, 6},{0x0003, 3},{0x0002, 3},{0x001E, 5}, + {0x001D, 5},{0x007D, 7},{0x01F0, 9},{0x07C6,11}, + {0x3E3C,14},{0x3E3F,14},{0x3E3E,14},{0x3E39,14}, + {0x3E38,14},{0x3E3B,14},{0x3E3A,14},{0x0008, 4}, + {0x001C, 5},{0x0002, 5},{0x003F, 6},{0x0035, 6}, + {0x0009, 4},{0x0001, 3},{0x000E, 7},{0x00F9, 8} + }, + { + {0x0004, 3},{0x000B, 4},{0x0001, 4},{0x000A, 4}, + {0x001E, 6},{0x00E0, 9},{0x0E1E,13},{0x0071, 8}, + {0x0039, 7},{0x0007, 3},{0x0006, 3},{0x000D, 5}, + {0x000C, 5},{0x0020, 7},{0x01C2,10},{0x1C3F,14}, + {0x1C3E,14},{0x0E19,13},{0x0E18,13},{0x0E1B,13}, + {0x0E1A,13},{0x0E1D,13},{0x0E1C,13},{0x0000, 4}, + {0x0009, 5},{0x001D, 6},{0x001F, 6},{0x0011, 6}, + {0x0005, 4},{0x0001, 3},{0x0043, 8},{0x0042, 8} + }, + { + {0x0004, 3},{0x000D, 4},{0x0007, 4},{0x0002, 3}, + {0x0014, 5},{0x016C, 9},{0x16D1,13},{0x02DF,10}, + {0x016E, 9},{0x0000, 2},{0x0007, 3},{0x002C, 6}, + {0x002B, 6},{0x02DE,10},{0x16D0,13},{0x16D3,13}, + {0x16D2,13},{0x2DB5,14},{0x2DB4,14},{0x2DB7,14}, + {0x2DB6,14},{0x16D9,13},{0x16D8,13},{0x000C, 5}, + {0x002A, 6},{0x005A, 7},{0x001B, 6},{0x001A, 6}, + {0x0017, 5},{0x000C, 4},{0x05B7,11},{0x05B5,11} + }, + { + {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4}, + {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14}, + {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7}, + {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14}, + {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14}, + {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9}, + {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8}, + {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14} + }, + { + {0x0000, 3},{0x0010, 5},{0x0072, 7},{0x0071, 7}, + {0x0154, 9},{0x0AAB,12},{0x0AA8,12},{0x0014, 5}, + {0x0070, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4}, + {0x000B, 4},{0x0003, 4},{0x0011, 5},{0x0073, 7}, + {0x0054, 7},{0x00AB, 8},{0x02AB,10},{0x1553,13}, + {0x1552,13},{0x1555,13},{0x1554,13},{0x000D, 4}, + {0x001E, 5},{0x0012, 5},{0x003E, 6},{0x002B, 6}, + {0x0002, 4},{0x003F, 6},{0x001D, 5},{0x0013, 5} + }, + { + {0x0003, 3},{0x001F, 5},{0x0029, 6},{0x003D, 6}, + {0x000C, 7},{0x0069,10},{0x0345,13},{0x0002, 5}, + {0x0028, 6},{0x0002, 3},{0x0001, 3},{0x000E, 4}, + {0x000C, 4},{0x0015, 5},{0x0007, 6},{0x001B, 8}, + {0x006B,10},{0x006A,10},{0x0344,13},{0x0347,13}, + {0x0346,13},{0x01A1,12},{0x01A0,12},{0x000B, 4}, + {0x001A, 5},{0x0012, 5},{0x0000, 5},{0x003C, 6}, + {0x0008, 4},{0x001B, 5},{0x0013, 5},{0x0001, 5} + }, + { + {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0014, 5}, + {0x0056, 7},{0x015C, 9},{0x15D5,13},{0x003C, 6}, + {0x002A, 6},{0x0000, 3},{0x0001, 3},{0x000E, 4}, + {0x000D, 4},{0x000C, 5},{0x00AF, 8},{0x02BB,10}, + {0x15D4,13},{0x15D7,13},{0x15D6,13},{0x15D1,13}, + {0x15D0,13},{0x15D3,13},{0x15D2,13},{0x000B, 4}, + {0x0019, 5},{0x000D, 5},{0x003E, 6},{0x0031, 6}, + {0x0007, 4},{0x0005, 4},{0x003D, 6},{0x0030, 6} + }, + { + {0x0005, 3},{0x0008, 4},{0x001A, 5},{0x0000, 4}, + {0x0036, 6},{0x0011, 8},{0x0106,12},{0x000A, 7}, + {0x006E, 7},{0x0002, 3},{0x0003, 3},{0x0003, 4}, + {0x0002, 4},{0x006F, 7},{0x0021, 9},{0x020F,13}, + {0x020E,13},{0x0101,12},{0x0100,12},{0x0103,12}, + {0x0102,12},{0x0105,12},{0x0104,12},{0x000C, 4}, + {0x001E, 5},{0x0003, 5},{0x003E, 6},{0x003F, 6}, + {0x0009, 4},{0x000E, 4},{0x000B, 7},{0x0009, 7} + }, + { + {0x0002, 3},{0x000E, 4},{0x001E, 5},{0x000C, 4}, + {0x001F, 5},{0x006E, 7},{0x00AD,10},{0x00AF,10}, + {0x0014, 7},{0x0004, 3},{0x0003, 3},{0x001A, 5}, + {0x0017, 5},{0x002A, 8},{0x0576,13},{0x0AEF,14}, + {0x0AEE,14},{0x0571,13},{0x0570,13},{0x0573,13}, + {0x0572,13},{0x0575,13},{0x0574,13},{0x0003, 4}, + {0x0016, 5},{0x0004, 5},{0x0036, 6},{0x000B, 6}, + {0x000A, 4},{0x0000, 3},{0x006F, 7},{0x00AC,10} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0003, 3},{0x0011, 5},{0x0020, 6},{0x0074, 7}, + {0x010D, 9},{0x0863,12},{0x0860,12},{0x000A, 5}, + {0x0075, 7},{0x0001, 3},{0x0000, 3},{0x000B, 4}, + {0x000A, 4},{0x0018, 5},{0x0038, 6},{0x0042, 7}, + {0x010F, 9},{0x010E, 9},{0x0219,10},{0x10C3,13}, + {0x10C2,13},{0x10C5,13},{0x10C4,13},{0x000F, 4}, + {0x0004, 4},{0x0019, 5},{0x000B, 5},{0x0039, 6}, + {0x0009, 4},{0x001B, 5},{0x001A, 5},{0x003B, 6} + }, + { + {0x0005, 3},{0x0001, 4},{0x003E, 6},{0x0001, 5}, + {0x00E2, 8},{0x1C6F,13},{0x38D9,14},{0x0039, 6}, + {0x001F, 6},{0x0002, 3},{0x0001, 3},{0x0009, 4}, + {0x0008, 4},{0x0000, 5},{0x0070, 7},{0x01C7, 9}, + {0x038C,10},{0x071A,11},{0x38D8,14},{0x38DB,14}, + {0x38DA,14},{0x38DD,14},{0x38DC,14},{0x000D, 4}, + {0x001D, 5},{0x000E, 5},{0x003F, 6},{0x003C, 6}, + {0x000C, 4},{0x0006, 4},{0x003D, 6},{0x001E, 6} + }, + { + {0x0006, 3},{0x000B, 4},{0x0011, 5},{0x001E, 5}, + {0x0074, 7},{0x03AA,10},{0x1D5C,13},{0x0001, 6}, + {0x0021, 6},{0x0001, 3},{0x0002, 3},{0x0007, 4}, + {0x0006, 4},{0x003E, 6},{0x00EB, 8},{0x01D4, 9}, + {0x0EAF,12},{0x3ABB,14},{0x3ABA,14},{0x1D59,13}, + {0x1D58,13},{0x1D5B,13},{0x1D5A,13},{0x000A, 4}, + {0x001C, 5},{0x0001, 5},{0x003F, 6},{0x003B, 6}, + {0x0001, 4},{0x0009, 4},{0x0020, 6},{0x0000, 6} + }, + { + {0x0004, 3},{0x000A, 4},{0x0017, 5},{0x0004, 4}, + {0x0016, 6},{0x016A, 9},{0x16B1,13},{0x0017, 7}, + {0x005B, 7},{0x0006, 3},{0x0007, 3},{0x0001, 4}, + {0x0000, 4},{0x000A, 6},{0x02D7,10},{0x0B5A,12}, + {0x16B0,13},{0x16B3,13},{0x16B2,13},{0x2D6D,14}, + {0x2D6C,14},{0x2D6F,14},{0x2D6E,14},{0x0006, 4}, + {0x000A, 5},{0x0004, 5},{0x002C, 6},{0x0017, 6}, + {0x0003, 4},{0x0007, 4},{0x0016, 7},{0x00B4, 8} + }, + { + {0x0005, 3},{0x000D, 4},{0x0005, 4},{0x0009, 4}, + {0x0033, 6},{0x0193, 9},{0x192C,13},{0x0061, 8}, + {0x0031, 7},{0x0000, 2},{0x0007, 3},{0x0010, 5}, + {0x0011, 5},{0x00C8, 8},{0x192F,13},{0x325B,14}, + {0x325A,14},{0x1929,13},{0x1928,13},{0x192B,13}, + {0x192A,13},{0x325D,14},{0x325C,14},{0x0018, 5}, + {0x001A, 6},{0x001B, 6},{0x0065, 7},{0x0019, 6}, + {0x0004, 4},{0x0007, 4},{0x0060, 8},{0x0324,10} + }, + { + {0x0006, 3},{0x0000, 3},{0x0002, 4},{0x000F, 4}, + {0x0039, 6},{0x01D9, 9},{0x1D82,13},{0x0761,11}, + {0x03BE,10},{0x0001, 2},{0x0002, 2},{0x000F, 6}, + {0x000E, 6},{0x0762,11},{0x3B07,14},{0x3B06,14}, + {0x3B1D,14},{0x3B1C,14},{0x3B1F,14},{0x3B1E,14}, + {0x3B19,14},{0x3B18,14},{0x3B1B,14},{0x0038, 6}, + {0x01DE, 9},{0x00ED, 8},{0x03BF,10},{0x00EE, 8}, + {0x003A, 6},{0x0006, 5},{0x0EC0,12},{0x3B1A,14} + }, + { + {0x0000, 2},{0x0002, 3},{0x000F, 5},{0x0006, 4}, + {0x001C, 6},{0x01D0,10},{0x0E8C,13},{0x1D1B,14}, + {0x1D1A,14},{0x0003, 2},{0x0002, 2},{0x00EA, 9}, + {0x00E9, 9},{0x0E89,13},{0x0E88,13},{0x0E8B,13}, + {0x0E8A,13},{0x1D65,14},{0x1D64,14},{0x1D67,14}, + {0x1D66,14},{0x1D61,14},{0x1D60,14},{0x03AD,11}, + {0x1D63,14},{0x1D62,14},{0x1D1D,14},{0x1D1C,14}, + {0x003B, 7},{0x01D7,10},{0x1D1F,14},{0x1D1E,14} + }, + { + {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4}, + {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14}, + {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7}, + {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14}, + {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14}, + {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9}, + {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8}, + {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14} + } +}; + + + +/*A description of a Huffman code value used when encoding the tree.*/ +typedef struct{ + /*The bit pattern, left-shifted so that the MSB of all patterns is + aligned.*/ + unsigned long pattern; + /*The amount the bit pattern was shifted.*/ + int shift; + /*The token this bit pattern represents.*/ + int token; +}th_huff_entry; + + + +/*Compares two th_huff_entry structures by their bit patterns. + _c1: The first entry to compare. + _c2: The second entry to compare. + Return: <0 if _c1<_c2, >0 if _c1>_c2.*/ +static int huff_entry_cmp(const void *_c1,const void *_c2){ + unsigned long b1; + unsigned long b2; + b1=((const th_huff_entry *)_c1)->pattern; + b2=((const th_huff_entry *)_c2)->pattern; + return b1b2?1:0; +} + +int th_huff_codes2latex(const theora_huff_code _codes[80][32]){ + int i; + printf("\\twocolumn\n"); + for(i=0;i<80;i++){ + th_huff_entry entries[32]; + int maxlen; + int mask; + int j; + /*First, find the maximum code length so we can align all the bit + patterns.*/ + maxlen=_codes[i][0].nbits; + for(j=1;j<32;j++)if(maxlen<_codes[i][j].nbits)maxlen=_codes[i][j].nbits; + mask=(1<entries[j].shift;){ + printf("%c",(int)(entries[j].pattern>>k&1)+'0'); + } + printf("}"); + for(;k>=0;k--)printf(" "); + printf(" & "); + if(entries[j].token<10)printf(" "); + printf("$%i$ \\\\\n",entries[j].token); + } + printf("\\bottomrule\n"); + printf("\\\\\n"); + printf("\\multicolumn{2}{c}{VP3.1 Huffman Table Number $%i$}\n",i); + printf("\\end{tabular}\n"); + printf("\\end{center}\n"); + printf("\\vfill\n"); + printf("\n"); + } + printf("\\onecolumn\n"); + return 0; +} + +int main(int _argc,char **_argv){ + th_huff_codes2latex(TH_VP31_HUFF_CODES); + return 0; +} diff --git a/libs/libtheora-1.1/doc/spec/xifish.fig b/libs/libtheora-1.1/doc/spec/xifish.fig new file mode 100644 index 00000000..f044a2b5 --- /dev/null +++ b/libs/libtheora-1.1/doc/spec/xifish.fig @@ -0,0 +1,85 @@ +#FIG 3.2 +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +0 32 #496d9e +0 33 #304d71 +0 34 #8eb2cf +1 4 0 6 0 7 1 0 20 0.000 1 0.0000 1470 3255 270 270 1200 3255 1740 3255 +1 3 0 0 0 0 0 0 20 0.000 1 0.0000 1485 3255 75 75 1485 3255 1560 3255 +2 1 0 7 0 3 8 0 20 0.000 0 0 -1 0 0 6 + 2445 4140 2505 4350 2385 4425 2145 4425 2025 4380 1890 4320 +2 1 0 7 0 3 8 0 20 0.000 0 0 -1 0 0 20 + 2445 3480 2775 3450 2955 3390 3090 3315 3285 3285 3555 3285 + 3615 3390 3540 3675 3465 3720 3315 3765 3105 3810 3330 3765 + 3420 3825 3540 3900 3480 4260 3330 4320 3165 4305 2910 4260 + 2715 4185 2520 4185 +2 1 0 7 0 3 11 0 20 0.000 0 0 -1 0 0 9 + 1575 3150 1755 2985 2040 2820 2355 2760 2670 2850 2850 2985 + 3165 3270 3435 3420 2835 3780 +2 1 0 7 0 6 6 0 20 0.000 0 0 -1 0 0 15 + 900 3570 1020 3450 1095 3360 1395 3150 1545 3090 1725 3075 + 2025 3090 2205 3150 2295 3225 2385 3300 2445 3375 2550 3465 + 2655 3540 2775 3600 2865 3600 +2 1 0 7 0 3 4 0 20 0.000 0 0 -1 0 0 7 + 1515 4080 1770 4080 1875 3945 1965 3870 2025 3780 1995 3780 + 1665 3780 +2 1 0 0 -1 6 7 0 20 0.000 0 0 -1 0 0 11 + 2865 3615 2850 3735 2775 3945 2685 4080 2595 4155 2010 4185 + 1185 4170 1035 3990 1035 3870 975 3540 1155 3435 +2 1 0 0 0 3 5 0 20 0.000 0 0 -1 0 0 7 + 1035 3885 1005 4020 1095 4065 1245 4065 1245 3870 1050 3870 + 1065 3870 +2 1 0 7 0 3 0 0 20 0.000 0 0 -1 0 0 11 + 1245 3915 1245 3840 1170 3750 1005 3585 930 3510 750 3510 + 630 3600 645 3690 765 3780 885 3825 1035 3975 +2 1 0 7 0 3 0 0 20 0.000 0 0 -1 0 0 8 + 1095 3990 945 3990 855 4050 795 4140 885 4200 1095 4200 + 1155 4140 1245 4050 +2 1 0 7 0 6 6 0 20 0.000 0 0 -1 0 0 8 + 2685 4185 2400 4185 2220 4215 1920 4305 1695 4335 1485 4320 + 1245 4215 1155 4125 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2250 3900 2250 3825 2175 3825 2175 3900 2250 3900 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2250 3750 2250 3675 2175 3675 2175 3750 2250 3750 +2 1 0 0 -1 3 5 0 20 0.000 0 0 -1 0 0 9 + 1650 3780 1590 3975 1485 4035 1530 4080 1770 4065 1845 3960 + 1920 3900 1965 3795 1695 3780 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 1950 3450 1950 3375 1875 3375 1875 3450 1950 3450 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2400 3900 2400 3825 2325 3825 2325 3900 2400 3900 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2550 3975 2550 3900 2475 3900 2475 3975 2550 3975 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2700 3900 2700 3825 2625 3825 2625 3900 2700 3900 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2700 3750 2700 3675 2625 3675 2625 3750 2700 3750 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2550 3675 2550 3600 2475 3600 2475 3675 2550 3675 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2400 3750 2400 3675 2325 3675 2325 3750 2400 3750 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2400 3600 2400 3525 2325 3525 2325 3600 2400 3600 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2250 3600 2250 3525 2175 3525 2175 3600 2250 3600 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2250 3450 2250 3375 2175 3375 2175 3450 2250 3450 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2100 3525 2100 3450 2025 3450 2025 3525 2100 3525 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2100 3375 2100 3300 2025 3300 2025 3375 2100 3375 +2 2 0 0 0 0 3 0 20 0.000 0 0 0 0 0 5 + 2550 3825 2550 3750 2475 3750 2475 3825 2550 3825 +2 3 0 0 -1 32 13 0 20 0.000 0 0 7 0 0 5 + 2160 2055 3810 3705 2160 5355 510 3705 2160 2055 +2 1 0 0 32 34 12 0 20 0.000 0 0 -1 0 0 3 + 2160 2055 2160 3705 510 3705 +2 1 0 0 32 33 12 0 20 0.000 0 0 -1 0 0 3 + 3810 3705 2160 3705 2160 5355 diff --git a/libs/libtheora-1.1/doc/vp3-format.txt b/libs/libtheora-1.1/doc/vp3-format.txt new file mode 100644 index 00000000..408febe4 --- /dev/null +++ b/libs/libtheora-1.1/doc/vp3-format.txt @@ -0,0 +1,1305 @@ +VP3 Bitstream Format and Decoding Process +by Mike Melanson (mike at multimedia.cx) +v0.5: December 8, 2004 + + +[December 8, 2004: Note that this document is not complete and likely +will never be completed. However, it helped form the basis of Theora I +specification available at + http://www.theora.org/doc/Theora_I_spec.pdf ] + + +Contents +-------- + * Introduction + * Underlying Coding Concepts + * VP3 Coding Overview + * VP3 Chunk Format + * Decoding The Frame Header + * Initializing The Quantization Matrices + * Hilbert Coding Pattern + * Unpacking The Block Coding Information + * Unpacking The Macroblock Coding Mode Information + * Unpacking The Macroblock Motion Vectors + * Unpacking The DCT Coefficients + * Reversing The DC Prediction + * Reconstructing The Frame + * Theora Specification + * Appendix A: Quantization Matrices And Scale Factors + * Appendix B: Macroblock Coding Mode Alphabets + * Appendix C: DCT Coefficient VLC Tables + * Appendix D: The VP3 IDCT + * Acknowledgements + * References + * Changelog + + +Introduction +------------ +A company named On2 (http://www.on2.com) created a video codec named +VP3. Eventually, they decided to open source it. Like any body of code +that was produced on a deadline, the source code was not particularly +clean or well-documented. This makes it difficult to understand the +fundamental operation of the codec. + +This document describes the VP3 bitstream format and decoding process at +a higher level than source code. + + +Underlying Coding Concepts +-------------------------- +In order to understand the VP3 coding method it is necessary to +understand the individual steps in the process. Like many multimedia +compression algorithms VP3 does not consist of a single coding method. +Rather, it uses a chain of methods to achieve compression. + +If you are acquainted with the MPEG video clique then many of VP3's +coding concepts should look familiar as well. What follows is a list of +the coding methods used in VP3 and a brief description of each. + +* Discrete Cosine Transform (DCT): This is a magical mathematical +function that takes a group of numbers and turns it into another group +of numbers. The transformed group of numbers exhibits some curious +properties. Notably, larger numbers are concentrated in certain areas of +the transformed group. + +A video codec like VP3 often operates on 8x8 blocks of numbers. When +these 8x8 blocks are transformed using a DCT the larger numbers occur +mostly in the up and left areas of the block with the largest number +occurring as the first in the block (up-left corner). This number is +called the DC coefficient. The other 63 numbers are called the AC +coefficients. + +The DCT and its opposite operation, the inverse DCT, require a lot of +multiplications. Much research and experimentation is focused of +optimizing this phase of the coding/decoding process. + +* Quantization: This coding step tosses out information by essentially +dividing a number to be coded by a factor and throwing away the +remainder. The inverse process (dequantization) involves multiplying by +the same factor to obtain a number that is close enough to the original. + +* Run Length Encoding (RLE): The concept behind RLE is to shorten runs +of numbers that are the same. For example, the string "88888" is encoded +as (5, 8), indicating a run of 5 '8' numbers. In VP3 (and MPEG/JPEG), +RLE is used to record the number of zero-value coefficients that occur +before a non-zero coefficient. For example: + + 0 0 0 0 5 0 2 0 0 0 9 + +is encoded as: + + (4, 5), (1, 2), (3, 9) + +This indicates that a run of 4 zeroes is followed by a coefficient of 5; +then a run of 1 zero is followed by 2; then a run of 3 zeroes is +followed by 9. + +* Zigzag Ordering: After transforming and quantizing a block of samples, +the samples are not in an optimal order for run length encoding. Zigzag +ordering rearranges the samples to put more zeros between non-zero +samples. + +* Differential (or Delta) Pulse Code Modulation (DPCM): 1 + 1 = 2. Got +that? Seriously, that is what DPCM means. Rather than encoding absolute +values, encode the differences between successive values. For example: + + 82 84 81 80 86 88 85 + +Can be delta-encoded as: + + 82 +2 -3 -1 +6 +2 -3 + +Most of the numbers turn into smaller numbers which require less +information to encode. + +* Motion Compensation: Simply, this coding method specifies that a block +from a certain position in the previous frame is to be copied into a new +position in the current frame. This technique is often combined with DCT +and DPCM coding, as well as fractional pixel motion. + +* Entropy Coding (a.k.a. Huffman Coding): This is the process of coding +frequently occurring symbols with fewer bits than symbols that are not +likely to occur as frequently. + +* Variable Length Run Length Booleans: An initial Boolean bit is +extracted from the bitstream. A variable length code (VLC) is extracted +from the bitstream and converted to a count. This count indicates that +the next (count) elements are to be set to the Boolean value. +Afterwards, the Boolean value is toggled, the next VLC is extracted and +converted to a count, and the process continues until all elements are +set to either 0 or 1. + +* YUV Colorspace: Like many modern video codecs, VP3 operates on a YUV +colorspace rather than a RGB colorspace. Specifically, VP3 uses YUV +4:2:0, alias YUV420P, YV12. Note: Throughout the course of this +document, the U and V planes (a.k.a., Cb and Cr planes) will be +collectively referred to as C planes (color or chrominance planes). + +* Frame Types: VP3 has intra-coded frames, a.k.a. intraframes, I-frames, +or keyframes. VP3 happens to call these golden frames. VP3 has +interframes, a.k.a. predicted frames or P-frames. These frames can use +information from either the previous interframe or from the previous +golden frame. + + +VP3 Overview +------------ +The first thing to understand about the VP3 coding method is that it +encodes all 3 planes upside down. That is, the data is encoded from +bottom-to-top rather than top-to-bottom as is done with many video +codecs. + +VP3 codes a video frame by first breaking each of the 3 planes (Y, U, +and V) into a series of 8x8 blocks called fragments. VP3 also has a +notion of superblocks. Superblocks encapsulate 16 fragments arranged in +a 4x4 matrix. Each plane has its own set of superblocks. Further, VP3 +also uses the notion of macroblocks which is the same as that found in +JPEG/MPEG. One macroblock encompasses 4 blocks from the Y plane arranged +in a 2x2 matrix, 1 block from the U plane, and 1 block from the V plane. +While a fragment or a superblock applies to 1 and only 1 plane, a +macroblock extends over all 3 planes. + +VP3 compresses golden frames by transforming each fragment with a +discrete cosine transform. Each transformed sample is then quantized and +the DC coefficient is reduced via DPCM using a combination of DC +coefficients from surrounding fragments as predictors. Then, each +fragment's DC coefficient is entropy-coded in the output bitstream, +followed by each fragment's first AC coefficient, then each second AC +coefficient, and so on. + +An interframe, naturally, is more complicated. While there is only one +coding mode available for a golden frame (intra coding), there are 8 +coding modes that the VP3 coder can choose from for interframe +macroblocks. Intra coding as seen in the keyframe is still available. +The rest of the modes involve encoding a fragment diff, either from the +previous frame or the golden frame, from the same coordinate or from the +same coordinate plus a motion vector. All of the macroblock coding modes +and motion vectors are encoded in an interframe bitstream. + + +VP3 Chunk Format +---------------- +The high-level format of a compressed VP3 frame is laid out as: + + * chunk header + * block coding information + * macroblock coding mode information + * motion vectors + * DC coefficients + * 1st AC coefficients + * 2nd AC coefficients + * ... + * 63rd AC coefficients + + +Decoding The Frame Header +------------------------- +The chunk header always contains at least 1 byte which has the following +format: + + bit 7: 0 = golden frame, 1 = interframe + bit 6: unused + bits 5-0: Quality index (0..63) + +Further, if the frame is a golden frame, there are 2 more bytes in the +header: + + byte 0: version byte 0 + byte 1: + bits 7-3: VP3 version number (stored) + bit 2: key frame coding method (0 = DCT key frame, only type + supported) + bits 1-0: unused, spare bits + +All frame headers are encoded with a quality index. This 6-bit value is +used to index into 2 dequantizer scaling tables, 1 for DC values and 1 +for AC values. Each of the 3 dequantization tables is modified per these +scaling values. + + +Initializing The Quantization Matrices +-------------------------------------- +VP3 has three static matrices for quantizing and dequantizing fragments. +One matrix is for quantizing golden frame Y fragments, one matrix is for +quantizing golden frame C fragments, and one matrix is for quantizing both +golden frame and interframe Y or C fragments. While these matrices are +static, they are adjusted according to quality index coded in the header. + +The quality index is an index into 2 64-element tables: +dc_scale_factor[] and ac_scale_factor[]. Each quantization factor from +each of the three quantization matrices is adjusted by the appropriate +scale factor according to this formula: + + base quantizer * scale factor + quantizer = ----------------------------- + 100 + + where scale factor = + dc_scale_factor[quality_index] for DC dequantizer + ac_scale_factor[quality_index] for AC dequantizer + +The quantization matrices need to be recalculated at the beginning of a +frame decode if the current frame's quality index is different from the +previous frame's quality index. + +See Appendix A for the complete VP3 quantization matrices and scale factor +tables. + +As an example, this is the base quantization matrix for golden frame Y +fragments: + + 16 11 10 16 24 40 51 61 + 12 12 14 19 26 58 60 55 + 14 13 16 24 40 57 69 56 + 14 17 22 29 51 87 80 62 + 18 22 37 58 68 109 103 77 + 24 35 55 64 81 104 113 92 + 49 64 78 87 103 121 120 101 + 72 92 95 98 112 100 103 99 + +If a particular coded frame specifies a quality index of 54. Element 54 +of the dc_scale_factor table is 20, thus: + + 16 * 20 + DC coefficient quantizer = ------- = 3 + 100 + +Element 54 of the ac_scale_factor table is 24. The AC coefficient +quantizers are each scaled using this factor, e.g.: + + 11 * 24 + ------- = 2 + 100 + + 100 * 24 + -------- = 24 + 100 + +[not complete; still need to explain how these quantizers are saturated +and scaled with respect to the DCT process] + + +Hilbert Coding Pattern +---------------------- +VP3 uses a Hilbert pattern to code fragments within a superblock. A +Hilbert pattern is a recursive pattern that can grow quite complicated. +The coding pattern that VP3 uses is restricted to this pattern subset, +where each fragment in a superblock is represented by a 'X': + + X -> X X -> X + | ^ + v | + X <- X X <- X + | ^ + v | + X X -> X X + | ^ | ^ + v | v | + X -> X X -> X + +As an example of this pattern, consider a plane that is 256 samples wide +and 64 samples high. Each fragment row will be 32 fragments wide. The +first superblock in the plane will be comprised of these 16 fragments: + + 0 1 2 3 ... 31 + 32 33 34 35 ... 63 + 64 65 66 67 ... 95 + 96 97 98 99 ... 127 + +The order in which these 16 fragments are coded is: + + 0 | 0 1 14 15 + 32 | 3 2 13 12 + 64 | 4 7 8 11 + 96 | 5 6 9 10 + +All of the image coding information, including the block coding status +and modes, the motion vectors, and the DCT coefficients, are all coded +and decoded using this pattern. Thus, it is rather critical to have the +pattern and all of its corner cases handled correctly. In the above +example, if the bottom row and left column were not present due to the +superblock being in a corner, the pattern proceeds as if the missing +fragments were present, but the missing fragments are omitted in the +final coding list. The coding order would be: + + 0, 1, 2, 3, 4, 7, 8, 13, 14 + + +Unpacking The Block Coding Information +-------------------------------------- +After unpacking the frame header, the decoder unpacks the block coding +information. The only information determined in this phase is whether a +particular superblock and its fragments are coded in the current frame +or unchanged from the previous frame. The actual coding method is +determined in the next phase. + +If the frame is a golden frame then every superblock, macroblock, and +fragment is marked as coded. + +If the frame is an interframe, then the block coding information must be +decoded. This is the phase where a decoder will build a list of coded +fragments for which coding mode, motion vector, and DCT coefficient data +must be decoded. + +First, a list of partially-coded superblocks is unpacked from the +stream. This list is coded as a series of variable-length run length +codes (VLRLC). First, the code is initialized by reading the next bit in +the stream. Then, while there are still superblocks remaining in the +list, fetch a VLC from the stream according to this table: + + Codeword Run Length + 0 1 + 10x 2-3 + 110x 4-5 + 1110xx 6-9 + 11110xxx 10-17 + 111110xxxx 18-33 + 111111xxxxxxxxxxxx 34-4129 + +For example, a VLC of 1101 represents a run length of 5. If the VLRLC +was initialized to 1, then the next 5 superblocks would be set to 1, +indicating that they are partially coded in the current frame. Then the +bit value is toggled to 0, another VLC is fetched from the stream and +the process continues until each superblock has been marked either +partially coded (1) or not (0). + +If any of the superblocks were marked as not partially coded in the +previous step, then a list of fully-coded superblocks is unpacked next +using the same VLRLC as the list of partially-coded superblocks. +Initialize the VLRLC with the next bit in the stream. For each +superblock that was not marked as partially coded, mark it with either a +0 or 1 according to the current VLRLC. By the end of this step, each +superblock will be marked as either not coded, partially coded, or fully +coded. + +Let's work through an example with an image frame that is 256x64 pixels. +This means that the Y plane contains 4x2 superblocks and each of the C +planes contains 2 superblocks each. The superblocks are numbered as +follows: + + Y: 0 1 2 3 U: 8 9 + 4 5 6 7 V: 10 11 + +This is the state of the bitstream: + + 1100011001101 + +Which is interpreted as: + + initial 2 1's 1 0 4 1's 5 0's + 1 100 0 1100 1101 + +Superblocks 0-1 and 3-6 are marked as partially coded. Since there were +blocks that were not marked, proceed to unpack the list of fully-coded +superblocks. This is the state of the bitstream: + + 1101101 + +Which is interpreted as: + + initial 3 1's 3 0's + 1 101 100 + +Superblocks 2, 7, and 8 are marked as fully coded while superblocks 9, +10, and 11 are marked as not coded. + +If any of the superblocks were marked as partially coded, the next data +in the bitstream will define which fragments inside each partially-coded +superblock are coded. This is the first place where the Hilbert pattern +comes into play. + +For each partially-coded superblock, iterate through each fragment +according to the Hilbert pattern. Use the VLRLC method, only with a +different table, to determine which fragments are coded. The VLRLC table +for fragment coding runs is: + + Codeword Run Length + 0x 1-2 + 10x 3-4 + 110x 5-6 + 1110xx 7-10 + 11110xx 11-14 + 11111xxxx 15-30 + +Continuing with the contrived example, superblocks 0 and 1 are both +partially coded. This is the state of the bitstream: + + 0011001111010001111010...(not complete) + +Which is interpreted as: + initial 2 0's 3 1's 13 0's 1 1 13 0's + 0 01 100 1111010 00 1111010 ... + +This indicates that fragments 2-4 in superblock 0 are coded, while +fragments 0, 1, and 5-15 are not. Note that the run of 12 0's cascades +over into the next fragment, indicating that fragment 0 of superblock 1 +is not coded. Fragment 1 of superblock 1 is coded, while the rest of the +superblock's fragments are not coded. The example ends there (a real +bitstream should have enough data to describe all of the partially-coded +superblocks). Superblock 2 is fully coded which means all 16 fragments +are coded. Thus, superblocks 0-2 have the following coded fragments: + + 0 | x x x x x x x x 0 1 14 15 + 32 | 3 2 x x x 2 x x 3 2 13 12 + 64 | 4 x x x x x x x 4 7 8 11 + 96 | x x x x x x x x 5 6 9 10 + +This is a good place to generate the list of coded fragment numbers for +this frame. In this case, the list will begin as: + + 33 32 64 37 8 9 41 40 72 104 105 73 ... + +and so on through the remaining 8 fragments of superblock 2 and onto the +fragments for the remaining superblocks that are either fully or +partially coded. + + +Unpacking The Macroblock Coding Mode Information +------------------------------------------------ +After unpacking the block coding information, the decoder unpacks the +macroblock coding mode information. This process is simple when +decoding a golden frame-- since the only possible decoding mode is INTRA, +no macroblock coding mode information is transmitted. However, in an +interframe, each coded macroblock is encoded with one of 8 methods: + +0, INTER_NO_MV: + current fragment = + (fragment from previous frame @ same coordinates) + + (DCT-encoded residual) + +1, INTRA: + current fragment = DCT-encoded block, just like in a golden frame + +2, INTER_PLUS_MV: + current fragment = + (fragment from previous frame @ (same coords + motion vector)) + + (DCT-encoded residual) + +3, INTER_LAST_MV: + same as INTER_PLUS_MV but using the last motion vector decoded from + the bitstream + +4, INTER_PRIOR_LAST; + same as INTER_PLUS_MV but using the second-to-last motion vector + decoded from the bitstream + +5, USING_GOLDEN: + same as INTER_NO_MV but referencing the golden frame instead of + previous interframe + +6, GOLDEN_MV: + same as INTER_PLUS_MV but referencing the golden frame instead of + previous interframe + +7, INTER_FOURMV: + same as INTER_PLUS_MV except that each of the 4 Y fragments gets its + own motion vector, and the U and V fragments share the same motion + vector which is the average of the 4 Y fragment vectors + +The MB coding mode information is encoded using one of 8 alphabets. The +first 3 bits of the MB coding mode stream indicate which of the 8 +alphabets, 0..7, to use to decode the MB coding information in this frame. +The reason for the different alphabets is to minimize the number of bits +needed to encode this section of information. Each alphabet arranges the +coding modes in a different order, indexing the 8 modes into 8 index +slots. Index 0 is encoded with 1 bit (0), index 1 is encoded with 2 bits +(10), index 2 is encoded with 3 bits (110), and so on up to indices 6 and +7 which are encoded with 6 bits each (1111110 and 1111111, respectively): + + index encoding + ----- -------- + 0 0 + 1 10 + 2 110 + 3 1110 + 4 11110 + 5 111110 + 6 1111110 + 7 1111111 + +For example, the coding modes are arranged in alphabet 1 as follows: + + index coding mode + ----- ----------- + 0 MODE_INTER_LAST_MV + 1 MODE_INTER_PRIOR_LAST + 2 MODE_INTER_PLUS_MV + 3 MODE_INTER_NO_MV + 4 MODE_INTRA + 5 MODE_USING_GOLDEN, + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +This alphabet arrangement is designed for frames in which motion vectors +based off of the previous interframe dominate. + +When unpacking MB coding mode information for a frame, the decoder first +reads 3 bits from the stream to determine the alphabet. In this example, +the 3 bits would be 001 to indicate alphabet 1. Consider this contrived +bitstream following the alphabet number: + + 1010000011000011111110... + +The bits are read as follows: + + 10 10 0 0 0 0 110 0 0 0 1111111 0 + index: 1 1 0 0 0 0 2 0 0 0 7 0 + +This arrangement of indices translates to this series of coding modes: + + index coding mode + ----- ----------- + 1 MODE_INTER_PRIOR_LAST + 1 MODE_INTER_PRIOR_LAST + 0 MODE_INTER_LAST_MV + 0 MODE_INTER_LAST_MV + 0 MODE_INTER_LAST_MV + 0 MODE_INTER_LAST_MV + 2 MODE_INTER_PLUS_MV + 0 MODE_INTER_LAST_MV + 0 MODE_INTER_LAST_MV + 0 MODE_INTER_LAST_MV + 7 MODE_INTER_FOURMV + 0 MODE_INTER_LAST_MV + +There are 6 pre-defined alphabets. Consult Appendix B for the complete +alphabets. What happens if none of the 6 pre-defined alphabets fit? The +VP3 encoder can choose to use alphabet 0 which indicates a custom +alphabet. The 3-bit coding mode numbers for each index, 0..7, are stored +after the alphabet number in the bitstream. For example, the sequence: + + 000 111 110 101 100 011 010 001 000 + +would indicate coding alphabet 0 (custom alphabet), index 0 corresponds to +coding mode 7 (INTER_FOURMV), index 1 corresponds to coding mode 6 +(GOLDEN_MV), and so on down to index 7 which would correspond to coding +mode 0 (INTER_NO_MV). + +There is one more possible alphabet: Alphabet 7. This alphabet is +reserved for when there is such a mixture of coding modes used in a frame +that using any variable-length coding mode would result in more bits than +a fixed-length representation. When alphabet 7 is specified, the decoder +reads 3 bits at a time from the bitstream, and uses those directly as the +macroblock coding modes. + +To recap, this is the general algorithm for decoding macroblock coding +mode information: + + if (golden frame) + all frames are intracoded, there is no MB coding mode information + else + read 3 bits from bitstream to determine alphabet + if alphabet = 0 + this is a custom alphabet, populate index table with 8 3-bit coding + modes read from bitstream + foreach coded macroblock, unpack a coding mode: + if alphabet = 7 + read 3 bits from the bitstream as the coding mode for the + macroblock + else + read a VLC from the bitstream + use the decoded VLC value to index into the coding mode alphabet + selected for this frame and assign the indexed coding mode to + this macroblock + + +Unpacking The Macroblock Motion Vectors +--------------------------------------- +After unpacking the macroblock coding mode information, the decoder +unpacks the macroblock motion vectors. This phase essentially assigns a +motion vector to each of the 6 constituent fragments of any coded +macroblock that requires motion vectors. + +If the frame is a golden frame then there is no motion compensation and +no motion vectors are encoded in the bitstream. + +If the frame is an interframe, the next bit is read from the bitstream +to determine the vector entropy coding method used. If the coding method +is zero then all of the vectors will be unpacked using a VLC method. If +the coding method is 1 then all of the vectors will be unpacked using a +fixed length method. + +The VLC unpacking method reads 3 bits from the bitstream. These 3 bits +comprise a number ranging from 0..7 which indicate the next action: + +0, MV component = 0 +1, MV component = 1 +2, MV component = -1 +3, MV component = 2, read next bit for sign +4, MV component = 3, read next bit for sign +5, MV component = 4 + (read next 2 bits), read next bit for sign + range: (4..7, -4..-7) +6, MV component = 8 + (read next 3 bits), read next bit for sign + range: (8..15, -8..-15) +7, MV component = 16 + (read next 4 bits), read next bit for sign + range: (16..31, -16..-31) + +The fixed length vector unpacking method simply reads the next 5 bits +from the bitstream, reads the next bit for sign, and calls the whole +thing a motion vector component. This gives a range of (-31..31), which +is the same range as the VLC method. + +For example, consider the following contrived motion vector bitstream: + + 000001011011111000... + +The stream is read as: + + 0 (000 010) (110 111 1 100 0) + +The first bit indicates the entropy method which, in this example, is +variable length as opposed to fixed length. The next 3 bits are 0 which +indicate a X MV component of 0. The next 3 bits are 2 which indicate a Y +MV component of -1. The first motion vector encoded in this stream is +(0, -1). The next 3 bits are 6 which indicate 8 + next 3 bits (7) with +another bit indicating sign (1 in this case, which is negative). Thus, +the X MV component is -15. The next 3 bits are 4 which indicate a Y MV +component of 3 with one more bit for the sign (0 is positive). So the +second motion vector encoded in this stream is (-15, 3). + +As an example of the fixed-length entropy method, consider the following +contrived bitstream: + + 1010101101010... + +The stream is read as: + + 1 01010 1 10101 0 + +The first bit indicates the fixed length entropy method. The first 5 bits +are 10 followed by a negative sign bit. The next 5 bits are 21 followed by +a positive sign bit. The first motion vector in this stream is (-10, 21). + +During this phase of the decoding process, it is traditional to assign all +motion vectors for all coded macroblocks that require them, whether they +are unpacked from the motion vector bitstream or copied from previous +coded macroblocks. It is necessary to track the motion vectors for both +the previous macroblock as well as the next-to-last (prior) macroblock. +The general algorithm for this phase is as follows: + + foreach coded macroblock + last MV = 0 + prior last MV = 0 + if coding mode = MODE_INTER_PLUS_MV or MODE_GOLDEN_MV + read current MV pair from the bitstream and set all fragment motion + vectors to that pair + prior last MV = last MV + last MV = current MV + + if coding mode = MODE_INTER_FOURMV + read MV for first Y fragment in macroblock + read MV for second Y fragment in macroblock + read MV for third Y fragment in macroblock + read MV for fourth Y fragment in macroblock + set U & V fragment motion vectors to average of 4 Y vectors, + calculated as follows: + if sum of all 4 X motion components is positive, the X + motion component for the U & V fragments is (sum + 2) / 4, + otherwise, it is (sum - 2) / 4; repeat the same process for the + Y components + prior last MV = last MV + last MV = MV for fourth Y fragment from this macroblock + + if coding mode = MODE_INTER_LAST_MV + motion vectors for this macroblock are the same as last MV; note + that in this case, the last MV remains the last MV and the prior + last MV remains the prior last MV + + if coding mode = MODE_INTER_PRIOR_LAST + motion vectors for this macroblock are the same as prior last MV + prior last MV = last MV + last MV = current MV (effectively, swap last and prior last vectors) + + +Unpacking The DCT Coefficients +------------------------------ +After unpacking the macroblock motion vectors, the decoder unpacks the +fragment DCT coefficient data. Each coded fragment has 64 DCT +coefficients. Some of the coefficients will be non-zero. Many of the +coefficients will, or should be 0 as this is where the coding method +derives much of its compression. + +During this phase, the decoder will be unpacking DCT coefficients, zero +runs, and end-of-block (EOB) codes. The decoder unpacks the the DC +coefficients for all fragments, then all of the first AC coefficients, +and so on until all of the 64 DCT coefficients are unpacked from the +bitstream. + +To obtain the DCT coefficients, the decoder unpacks a series of VLCs +from the bitstream which turn into a series of tokens ranging from +0..31. Each of these tokens specifies which action to take next. VP3 +defines 80 different 32-element histograms for VLC decoding: + + 16 histograms for DC token decoding + 16 histograms for group 1 AC token decoding + 16 histograms for group 2 AC token decoding + 16 histograms for group 3 AC token decoding + 16 histograms for group 4 AC token decoding + +The decoder fetches 4 bits from the bitstream that will be used to +select a DC histogram and 4 bits that will be used to select 4 AC +histograms, one for each AC group. + +The meaning of each of the 32 possible tokens follows. 'EB' stands for +extra bits read from bitstream directly after the VLC token: + +0, DCT_EOB_TOKEN +set the current block to EOB, meaning that the block is marked as being +fully unpacked + +1, DCT_EOB_PAIR_TOKEN +set the next 2 blocks to EOB + +2. DCT_EOB_TRIPLE_TOKEN +set the next 3 blocks to EOB + +3, DCT_REPEAT_RUN_TOKEN +set the next (2 EBs + 4) blocks to EOB + +4, DCT_REPEAT_RUN2_TOKEN +set the next (3 EBs + 8) blocks to EOB + +5, DCT_REPEAT_RUN3_TOKEN +set the next (4 EBs + 16) blocks to EOB + +6, DCT_REPEAT_RUN4_TOKEN +set the next (12 EBs) blocks to EOB + +7, DCT_SHORT_ZRL_TOKEN +skip (3 EBs + 1) positions in the output matrix + +8, DCT_ZRL_TOKEN +skip (6 EBs + 1) positions in the output matrix + +9, ONE_TOKEN +output 1 as coefficient + +10, MINUS_ONE_TOKEN +output -1 as coefficient + +11, TWO_TOKEN +output 2 as coefficient + +12, MINUS_TWO_TOKEN +output -2 as coefficient + +13, 14, 15, 16, LOW_VAL_TOKENS +next EB determines coefficient sign; coeff = DCT_VAL_CAT2_MIN (3) + +(token - 13) (this gives a range of +/- 3..6) + +17, DCT_VAL_CATEGORY3 +next EB determines coefficient sign; coeff = DCT_VAL_CAT3_MIN (7) + next +EB (this gives a range of +/- 7..8) + +18, DCT_VAL_CATEGORY4 +next EB determines coefficient sign; coeff = DCT_VAL_CAT4_MIN (9) + next +2 EBs (this gives a range of +/- 9..12) + +19, DCT_VAL_CATEGORY5 +next EB determines coefficient sign; coeff = DCT_VAL_CAT5_MIN (13) + +next 3 EBs (this gives a range of +/- 13..20) + +20, DCT_VAL_CATEGORY6 +next EB determines coefficient sign; coeff = DCT_VAL_CAT6_MIN (21) + +next 4 EBs (this gives a range of +/- 21..36) + +21, DCT_VAL_CATEGORY7 +next EB determines coefficient sign; coeff = DCT_VAL_CAT7_MIN (37) + +next 5 EBs (this gives a range of +/- 37..68) + +22, DCT_VAL_CATEGORY8 +next EB determines coefficient sign; coeff = DCT_VAL_CAT8_MIN (69) + +next 9 EBs (this gives a range of +/- 69..580) + +23, 24, 25, 26, 27, DCT_RUN_CATEGORY1 +coefficient of +/- 1 preceded by a number of 0s; next EB determines sign +of coefficient; skip (token - 22) 0s in the output matrix before +placing the final coefficient (this gives a range of 1..5 0s) + +28, DCT_RUN_CATEGORY1B +coefficient of +/- 1 preceded by a number of 0s; next EB determines sign +of coefficient; skip (next 2 EBs + 6) 0s in the output matrix before +placing the final coefficient (this gives a range of 6..9 0s) + +29, DCT_RUN_CATEGORY1C +coefficient of +/- 1 preceded by a number of 0s; next EB determines sign +of coefficient; skip (next 3 EBs + 10) 0s in the output matrix before +placing the final coefficient (this gives a range of 10..17 0s) + +30, DCT_RUN_CATEGORY2 +coefficient of +/- 2..3 preceded by a single zero; next EB determines +sign of coefficient; coefficient = (next EB + 2) + +31, DCT_RUN_CATEGORY2B (not specifically named in VP3 source) +coefficient of +/- 2..3 preceded by 2 or 3 0s; next EB determines +sign of coefficient; coefficient = (next EB + 2); skip (next EB + 2) 0s +before placing coefficient in output matrix + +Note: EOB runs can, and often do, cross threshold stages and plane +boundaries. For example, a decoder may have decoded all of the AC #2 +coefficients for all fragments and still have an EOB run of 2. That +means that during the AC #3 decode process, the first 2 coded fragments +that are not already EOB will be set to EOB. + +Let's work through a highly contrived example to illustrate the +coefficient decoding process. + + + +[not finished] + + + + +When the decoder is finished unpacking the DCT coefficients, the entire +encoded VP3 frame bitstream should be consumed. + + +Reversing The DC Prediction +--------------------------- +Now that all of the DCT coefficient data has been unpacked, the DC +coefficients need to be fully reconstructed before the IDCT can be +performed. + +VP3 uses a somewhat involved process for DC prediction which uses up to +four DC coefficients from surrounding fragments. For each fragment to be +transformed with the IDCT, the DC coefficient is predicted from weighted +sum of the DC coefficients in the left (l), up-left (ul), up (u), and +up-right (ur) fragments, if they are coded (not unchanged from the +previous frame) in a compatible frame (current, previous, or golden). + +In a golden frame, the prediction is quite straightforward since all +fragments will be coded. A fragment's DC prediction will fall into 1 of +5 groups: + + abbbbbbbbb + cdddddddde + cdddddddde + cdddddddde + cdddddddde + +* Group a is the top left corner fragment. There is nothing to predict +from. This DC coefficient has a lot of energy and requires many bits to +code. + +* Group b is the remainder of the top row of fragments. These fragments +can only predict from the left fragment. + +* Group c is the left column of fragments, not including the top left +fragment. These fragments have the top and top-right fragments from +which to predict. + +* Group d is the main body of fragments. These fragments have access to +all 4 predictors. + +* Group e is the right column of fragments, not including the top right +fragment. These fragments can predict from the left, up-left and up +fragments. + +The process of reversing prediction for interframes grows more complex. +First, the decoder must evaluate which candidate fragments (l, ul, u, or +ur) are available for as predictors. Then, it can only use fragments +that are coded within the same frame (current, previous, or golden). +Further, there are auxiliary predictors for each frame type that are +initialized to 0 at the start of each video frame decode operation. The +decoder falls back on these auxiliary predictors when it can not find +any valid candidate predictors for the current fragment. + +To work through some examples, consider the following notation, e.g.: + + ul-C = up-left fragment, coded in the current frame + u-P = up fragment, coded as a motion residual from the previous frame + ur-C = up-right fragment, coded in the current frame + l-G = left fragment, coded as a motion residual from the golden frame + x-P = current fragment where DC prediction is being performed, coded + as a motion residual from the previous frame + +This is a simple case: + + ul-C u-C ur-C + l-C x-C + +The current fragment predicts from all four of the candidate fragments +since they are coded in the same frame. + + ul-P u-C ur-C + l-P x-P + +The current fragment predicts from the left and up-left fragments. + + ul-C u-P ur-G + l-P x-G + +The current fragment predicts from the up-right fragment. + + ul-C u-C ur-C + l-C x-G + +The current fragment does not predict from any of the candidate +fragments since the current fragment is a motion residual from the +golden frame. Rather, add the auxiliary golden frame predictor to the +current fragment's DC coefficient. Save the new DC coefficient as the +new golden frame auxiliary DC predictor. + +If the decoder only finds one valid candidate predictor, then it is used +by itself. When the decoder finds multiple valid candidate fragments +from which to predict DC, it applies a weighting function to the +surrounding fragments' DC coefficients. The following table presents all +16 possible combinations of available/not available predictors and what +to do in each case: + + ul u ur l + -- -- -- -- + 0 0 0 0 no predictors available: + use the last predictor saved for the frame type + (either intra, inter, or golden) + + 0 0 0 1 left predictor available: + pred = l.dc + + 0 0 1 0 up-right predictor available: + pred = ur.dc + + 0 0 1 1 up-right, left predictors available: + pred = (53 * ur.dc) + (75 * l.dc) + -------------------------- + 128 + + 0 1 0 0 up predictor available: + pred = u.dc + + 0 1 0 1 up, left predictors available: + pred = (u.dc + l.dc) + ------------- + 2 + + 0 1 1 0 up, up-right predictors available: + discard up-right predictor + pred = u.dc + + 0 1 1 1 up, up-right, left predictors available: + discard up predictor + pred = (53 * ur.dc) + (75 * l.dc) + -------------------------- + 128 + + 1 0 0 0 up-left predictor available: + pred = ul.dc + + 1 0 0 1 up-left, left predictors available: + discard up-left predictor + pred = l.dc + + 1 0 1 0 up-left, up-right predictors available: + pred = (ul.dc + ur.dc) + --------------- + 2 + + 1 0 1 1 up-left, up-right, left predictors available: + discard up-left predictor + pred = (53 * ur.dc) + (75 * l.dc) + -------------------------- + 128 + + 1 1 0 0 up-left, up predictors available: + discard up-left + pred = u.dc + + 1 1 0 1 up-left, up, left predictors available: + pred = (-26 * ul.dc + 29 * u.dc + 29 * l.dc) + ------------------------------------- + 32 + + 1 1 1 0 up-left, up, up-right predictors available: + pred = (3 * ul.dc + 10 * u.dc + 3 * ur.dc) + ----------------------------------- + 16 + + 1 1 1 1 all 4 predictors available: + discard up-right predictor + pred = (-26 * ul.dc + 29 * u.dc + 29 * l.dc) + ------------------------------------- + 32 + +Note that this final prediction case ([ul u l]) risks outranging. The +difference of the predicted DC is checked against u.dc, l.dc, and ul.dc, +in that order, and if the difference is greater than 128 in any case, +the predictor is assigned as that DC coefficient. In pseudocode: + + if (ABSOLUTE_VALUE(pred - u.dc) > 128) + pref = u.dc + else if (ABSOLUTE_VALUE(pred - l.dc) > 128) + pref = l.dc + else if (ABSOLUTE_VALUE(pred - ul.dc) > 128) + pref = ul.dc + +The predicted value is, at long last, added to the fragment's decoded DC +coefficient. Finally, the new DC coefficient is saved as the frame +type's auxiliary predictor. For example, if this fragment is coded as a +motion residual from the previous frame, save the fragment's DC +coefficient as the previous frame auxiliary predictor. + + +[still need to mention precise rounding considerations, a.k.a, the +HIGHTBITDUPPED() macro] + + + +Reconstructing The Frame +------------------------ +rough outline: + - foreach fragment: + - if motion vector + - copy motion fragment from appropriate frame into current frame + (don't forget to account for unrestricted motion vectors) + - dequantize fragment coefficients + - run coefficients through inverse DCT + - if INTRA coded fragment + - output transformed coefficients + - else + - apply transformed residual to motion fragment + +[not finished] + + +Theora Specification +-------------------- +The Theora project leverages the VP3 codec into a new video coding +system. The algorithm and bitstream format are the same as VP3 with a +few minor differences: + +1) The frame orientation is reversed-- VP3 is coded from bottom to top +while Theora video is coded from top to bottom. +[nope-- only true in the first few alpha releases; final Theora spec will +be upside-down, the same as VP3] + +2) Variable histograms-- VP3 uses a hardcoded set of histograms for DCT +coefficient coding (described in section "Unpacking The DCT +Coefficients"). Theora packs the histogram information in the header of +the transport format (which is meant to be Ogg, but can probably be +coerced into a variety of other multimedia container formats). + +3) Variable quantization-- As with the histograms, Theora codes the +quantization tables and quality thresholds (described in section +"Initializing The Quantization Matrices") into the header. + +4) [special VLRLC case for encoding unusually large runs of blocks; +necessary for HD resolutions] + +[still need coding format of histogram and quantizer information] + + +Appendix A: VP31 Quantization Matrices And Scale Factors +-------------------------------------------------------- +The following quantization matrices and scale factor tables are hardcoded +into the VP31 coding standard. These tables can vary according to the +setup information transported along with a Theora file. + +Base quantization matrix for golden frame Y fragments (note that this +is the same as JPEG): + + 16 11 10 16 24 40 51 61 + 12 12 14 19 26 58 60 55 + 14 13 16 24 40 57 69 56 + 14 17 22 29 51 87 80 62 + 18 22 37 58 68 109 103 77 + 24 35 55 64 81 104 113 92 + 49 64 78 87 103 121 120 101 + 72 92 95 98 112 100 103 99 + + +Base quantization matrix for golden frame C fragments (note that this +is the same as JPEG): + + 17 18 24 47 99 99 99 99 + 18 21 26 66 99 99 99 99 + 24 26 56 99 99 99 99 99 + 47 66 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + 99 99 99 99 99 99 99 99 + + +Base quantization matrix for interframe Y and C fragments: + + 16 16 16 20 24 28 32 40 + 16 16 20 24 28 32 40 48 + 16 20 24 28 32 40 48 64 + 20 24 28 32 40 48 64 64 + 24 28 32 40 48 64 64 64 + 28 32 40 48 64 64 64 96 + 32 40 48 64 64 64 96 128 + 40 48 64 64 64 96 128 128 + + +DC coefficient scale factor table: + + 220 200 190 180 170 170 160 160 + 150 150 140 140 130 130 120 120 + 110 110 100 100 90 90 90 80 + 80 80 70 70 70 60 60 60 + 60 50 50 50 50 40 40 40 + 40 40 30 30 30 30 30 30 + 30 20 20 20 20 20 20 20 + 20 10 10 10 10 10 10 10 + + +AC coefficient scale factor table: + + 500 450 400 370 340 310 285 265 + 245 225 210 195 185 180 170 160 + 150 145 135 130 125 115 110 107 + 100 96 93 89 85 82 75 74 + 70 68 64 60 57 56 52 50 + 49 45 44 43 40 38 37 35 + 33 32 30 29 28 25 24 22 + 21 19 18 17 15 13 12 10 + + +Appendix B: Macroblock Coding Mode Alphabets +-------------------------------------------- +These are the 6 pre-defined alphabets used to decode macroblock coding +mode information: + +Alphabet 1: + index coding mode + ----- ----------- + 0 MODE_INTER_LAST_MV + 1 MODE_INTER_PRIOR_LAST + 2 MODE_INTER_PLUS_MV + 3 MODE_INTER_NO_MV + 4 MODE_INTRA + 5 MODE_USING_GOLDEN, + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +Alphabet 2: + index coding mode + ----- ----------- + 0 MODE_INTER_LAST_MV + 1 MODE_INTER_PRIOR_LAST + 2 MODE_INTER_NO_MV + 3 MODE_INTER_PLUS_MV + 4 MODE_INTRA + 5 MODE_USING_GOLDEN + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +Alphabet 3: + index coding mode + ----- ----------- + 0 MODE_INTER_LAST_MV + 1 MODE_INTER_PLUS_MV + 2 MODE_INTER_PRIOR_LAST + 3 MODE_INTER_NO_MV + 4 MODE_INTRA + 5 MODE_USING_GOLDEN + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +Alphabet 4: + index coding mode + ----- ----------- + 0 MODE_INTER_LAST_MV + 1 MODE_INTER_PLUS_MV + 2 MODE_INTER_NO_MV + 3 MODE_INTER_PRIOR_LAST + 4 MODE_INTRA + 5 MODE_USING_GOLDEN + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +Alphabet 5: + index coding mode + ----- ----------- + 0 MODE_INTER_NO_MV + 1 MODE_INTER_LAST_MV + 2 MODE_INTER_PRIOR_LAST + 3 MODE_INTER_PLUS_MV + 4 MODE_INTRA + 5 MODE_USING_GOLDEN + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + +Alphabet 6: + index coding mode + ----- ----------- + 0 MODE_INTER_NO_MV + 1 MODE_USING_GOLDEN + 2 MODE_INTER_LAST_MV + 3 MODE_INTER_PRIOR_LAST + 4 MODE_INTER_PLUS_MV + 5 MODE_INTRA + 6 MODE_GOLDEN_MV + 7 MODE_INTER_FOURMV + + +Appendix C: DCT Coefficient VLC Tables +-------------------------------------- +- VP31 tables are hardcoded +- Theora tables are transported with video stream + +[not finished] + + +Appendix D: The VP3 IDCT +------------------------ + +[not finished] + + +Acknowledgements +---------------- +Thanks to Michael Niedermayer (michaelni at gmx dot at) for peer review, +corrections, and recommendations for improvement. + +Dan Miller (dan at on2 dot com) for clarifications on pieces of the +format. + +Timothy B. Terriberry (tterribe at vt dot edu) for clarification about the +differences between VP3 and Theora, detailed explanation of motion +vector mechanics. + + +References +---------- +Tables necessary for decoding VP3: +http://mplayerhq.hu/cgi-bin/cvsweb.cgi/~checkout~/ffmpeg/libavcodec/vp3data.h?content-type=text/x-cvsweb-markup&cvsroot=FFMpeg + +Official VP3 site: +http://www.vp3.com/ + +Theora, based on VP3: +http://www.theora.org/ + +On2, creators of the VP3 format: +http://www.on2.com/ + + +ChangeLog +--------- +v0.5: December 8, 2004 +- reworked section "Reversing The DC Prediction" to include a tabular +representation of all 16 prediction modes + +v0.4: March 2, 2004 +- renamed and expanded section "Initializing The Quantization Matrices" +- outlined section "Reconstructing The Frame" +- moved Theora Differences Appendix to its own section entitled "Theora +Specification" +- added Appendix: Quantization Matrices And Scale Factors +- added Appendix: DCT Coefficient VLC Tables + +v0.3: February 29, 2004 +- expanded section "Unpacking The Macroblock Coding Mode Information" +- expanded section "Unpacking The Macroblock Motion Vectors" +- added Appendix: Macroblock Coding Mode Alphabets + +v0.2: October 9, 2003 +- expanded section "Reversing the DC Prediction" +- added Appendix: Theora Differences + +v0.1: June 17, 2003 +- initial release, nowhere near complete diff --git a/libs/libtheora-1.1/examples/Makefile.am b/libs/libtheora-1.1/examples/Makefile.am new file mode 100644 index 00000000..93ff45d3 --- /dev/null +++ b/libs/libtheora-1.1/examples/Makefile.am @@ -0,0 +1,41 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = -I$(top_srcdir)/include + +noinst_PROGRAMS = dump_video dump_psnr $(BUILDABLE_EXAMPLES) + +# possible contents of BUILDABLE_EXAMPLES: +EXTRA_PROGRAMS = player_example encoder_example png2theora + +AM_CFLAGS = $(OGG_CFLAGS) +LDADD = ../lib/libtheora.la $(OGG_LIBS) +LDADDDEC = ../lib/libtheoradec.la $(OGG_LIBS) +LDADDENC = ../lib/libtheoraenc.la ../lib/libtheoradec.la $(OGG_LIBS) + +dump_video_SOURCES = dump_video.c +EXTRA_dump_video_SOURCES = getopt.c getopt1.c getopt.h +dump_video_LDADD = $(GETOPT_OBJS) $(LDADDDEC) + +dump_psnr_SOURCES = dump_psnr.c +EXTRA_dump_psnr_SOURCES = getopt.c getopt1.c getopt.h +dump_psnr_LDADD = $(GETOPT_OBJS) $(LDADDDEC) -lm + +player_example_SOURCES = player_example.c +player_example_CFLAGS = $(SDL_CFLAGS) $(OGG_CFLAGS) $(VORBIS_CFLAGS) +player_example_LDADD = $(LDADDDEC) $(SDL_LIBS) $(VORBIS_LIBS) $(OSS_LIBS) + +encoder_example_SOURCES = encoder_example.c +EXTRA_encoder_example_SOURCES = getopt.c getopt1.c getopt.h +encoder_example_CFLAGS = $(OGG_CFLAGS) $(VORBIS_CFLAGS) +encoder_example_LDADD = $(GETOPT_OBJS) $(LDADDENC) $(VORBIS_LIBS) $(VORBISENC_LIBS) -lm + +png2theora_SOURCES = png2theora.c +png2theora_CFLAGS = $(OGG_CFLAGS) $(PNG_CFLAGS) +png2theora_LDADD = $(GETOPT_OBJS) $(LDADDENC) $(PNG_LIBS) -lm + +debug: + $(MAKE) all CFLAGS="@DEBUG@" + +profile: + $(MAKE) all CFLAGS="@PROFILE@" + diff --git a/libs/libtheora-1.1/examples/README_SPLAYER b/libs/libtheora-1.1/examples/README_SPLAYER new file mode 100644 index 00000000..1a32fb46 --- /dev/null +++ b/libs/libtheora-1.1/examples/README_SPLAYER @@ -0,0 +1,21 @@ +06/09/03 - by mau (mauricio at xiph.org) + +The splayer example is a experimental simple Theora player using SDL and +Portaudio for cross platform compatibility. To build the windows version +please use the Visual C++ project available at the +win32/experimental/splayer directory. + +By default this sample will not be built on Linux, unless Portaudio is +properly installed. Follow these steps to install Portaudio: + +1) Get portaudio tar package from www.portaudio.com +2) Uncompress it to a local directory +3) Run './configure' in the portaudio directory +4) Run 'make install' + +This will install Portaudio libraries in /usr/local/lib, and the Portaudio +include file at /usr/local/include. On linux you may need to manually +execute 'ldconfig' to rebuild the library cache. + +Switch to theora's directory, re-run theora's autogen.sh script to +re-generate the appropriate makefiles, and 'make install' to build. diff --git a/libs/libtheora-1.1/examples/dump_psnr.c b/libs/libtheora-1.1/examples/dump_psnr.c new file mode 100644 index 00000000..06f71721 --- /dev/null +++ b/libs/libtheora-1.1/examples/dump_psnr.c @@ -0,0 +1,1210 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: example dumpvid application; dumps Theora streams + last mod: $Id: dump_psnr.c 17974 2011-05-07 22:31:49Z giles $ + + ********************************************************************/ + +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE +#endif +#if !defined(_LARGEFILE_SOURCE) +#define _LARGEFILE_SOURCE +#endif +#if !defined(_LARGEFILE64_SOURCE) +#define _LARGEFILE64_SOURCE +#endif +#if !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + +#include +#if !defined(_WIN32) +#include +#include +#else +#include "getopt.h" +#endif +#include +#include +#include +#include +#include +/*Yes, yes, we're going to hell.*/ +#if defined(_WIN32) +#include +#endif +#include +#include +#include +#include "theora/theoradec.h" + +const char *optstring = "fsy"; +struct option options [] = { + {"frame-type",no_argument,NULL,'f'}, + {"summary",no_argument,NULL,'s'}, + {"luma-only",no_argument,NULL,'y'}, + {NULL,0,NULL,0} +}; + +static int show_frame_type; +static int summary_only; +static int luma_only; + +typedef struct y4m_input y4m_input; + +/*The function used to perform chroma conversion.*/ +typedef void (*y4m_convert_func)(y4m_input *_y4m, + unsigned char *_dst,unsigned char *_aux); + +struct y4m_input{ + int frame_w; + int frame_h; + int pic_w; + int pic_h; + int pic_x; + int pic_y; + int fps_n; + int fps_d; + int par_n; + int par_d; + char interlace; + int src_c_dec_h; + int src_c_dec_v; + int dst_c_dec_h; + int dst_c_dec_v; + char chroma_type[16]; + /*The size of each converted frame buffer.*/ + size_t dst_buf_sz; + /*The amount to read directly into the converted frame buffer.*/ + size_t dst_buf_read_sz; + /*The size of the auxilliary buffer.*/ + size_t aux_buf_sz; + /*The amount to read into the auxilliary buffer.*/ + size_t aux_buf_read_sz; + y4m_convert_func convert; + unsigned char *dst_buf; + unsigned char *aux_buf; +}; + + +static int y4m_parse_tags(y4m_input *_y4m,char *_tags){ + int got_w; + int got_h; + int got_fps; + int got_interlace; + int got_par; + int got_chroma; + char *p; + char *q; + got_w=got_h=got_fps=got_interlace=got_par=got_chroma=0; + for(p=_tags;;p=q){ + /*Skip any leading spaces.*/ + while(*p==' ')p++; + /*If that's all we have, stop.*/ + if(p[0]=='\0')break; + /*Find the end of this tag.*/ + for(q=p+1;*q!='\0'&&*q!=' ';q++); + /*Process the tag.*/ + switch(p[0]){ + case 'W':{ + if(sscanf(p+1,"%d",&_y4m->pic_w)!=1)return -1; + got_w=1; + }break; + case 'H':{ + if(sscanf(p+1,"%d",&_y4m->pic_h)!=1)return -1; + got_h=1; + }break; + case 'F':{ + if(sscanf(p+1,"%d:%d",&_y4m->fps_n,&_y4m->fps_d)!=2){ + return -1; + } + got_fps=1; + }break; + case 'I':{ + _y4m->interlace=p[1]; + got_interlace=1; + }break; + case 'A':{ + if(sscanf(p+1,"%d:%d",&_y4m->par_n,&_y4m->par_d)!=2){ + return -1; + } + got_par=1; + }break; + case 'C':{ + if(q-p>16)return -1; + memcpy(_y4m->chroma_type,p+1,q-p-1); + _y4m->chroma_type[q-p-1]='\0'; + got_chroma=1; + }break; + /*Ignore unknown tags.*/ + } + } + if(!got_w||!got_h||!got_fps||!got_interlace||!got_par)return -1; + /*Chroma-type is not specified in older files, e.g., those generated by + mplayer.*/ + if(!got_chroma)strcpy(_y4m->chroma_type,"420"); + return 0; +} + +/*All anti-aliasing filters in the following conversion functions are based on + one of two window functions: + The 6-tap Lanczos window (for down-sampling and shifts): + sinc(\pi*t)*sinc(\pi*t/3), |t|<3 (sinc(t)==sin(t)/t) + 0, |t|>=3 + The 4-tap Mitchell window (for up-sampling): + 7|t|^3-12|t|^2+16/3, |t|<1 + -(7/3)|x|^3+12|x|^2-20|x|+32/3, |t|<2 + 0, |t|>=2 + The number of taps is intentionally kept small to reduce computational + overhead and limit ringing. + + The taps from these filters are scaled so that their sum is 1, and the result + is scaled by 128 and rounded to integers to create a filter whose + intermediate values fit inside 16 bits. + Coefficients are rounded in such a way as to ensure their sum is still 128, + which is usually equivalent to normal rounding.*/ + +#define OC_MINI(_a,_b) ((_a)>(_b)?(_b):(_a)) +#define OC_MAXI(_a,_b) ((_a)<(_b)?(_b):(_a)) +#define OC_CLAMPI(_a,_b,_c) (OC_MAXI(_a,OC_MINI(_b,_c))) + +/*420jpeg chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + 420mpeg2 chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + BR | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + BR | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + We use a resampling filter to shift the site locations one quarter pixel (at + the chroma plane's resolution) to the right. + The 4:2:2 modes look exactly the same, except there are twice as many chroma + lines, and they are vertically co-sited with the luma samples in both the + mpeg2 and jpeg cases (thus requiring no vertical resampling).*/ +static void y4m_convert_42xmpeg2_42xjpeg(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ + int c_w; + int c_h; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=_y4m->pic_w*_y4m->pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h; + c_h=(_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + } + for(;x>7,255); + } + for(;x>7,255); + } + _dst+=c_w; + _aux+=c_w; + } + } +} + +/*This format is only used for interlaced content, but is included for + completeness. + + 420jpeg chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + 420paldv chroma samples are sited like: + YR------Y-------YR------Y------- + | | | | + | | | | + | | | | + YB------Y-------YB------Y------- + | | | | + | | | | + | | | | + YR------Y-------YR------Y------- + | | | | + | | | | + | | | | + YB------Y-------YB------Y------- + | | | | + | | | | + | | | | + + We use a resampling filter to shift the site locations one quarter pixel (at + the chroma plane's resolution) to the right. + Then we use another filter to move the C_r location down one quarter pixel, + and the C_b location up one quarter pixel.*/ +static void y4m_convert_42xpaldv_42xjpeg(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ + unsigned char *tmp; + int c_w; + int c_h; + int c_sz; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=_y4m->pic_w*_y4m->pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(_y4m->pic_w+1)/2; + c_h=(_y4m->pic_h+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h; + c_sz=c_w*c_h; + /*First do the horizontal re-sampling. + This is the same as the mpeg2 case, except that after the horizontal case, + we need to apply a second vertical filter.*/ + tmp=_aux+2*c_sz; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + } + for(;x>7,255); + } + for(;x>7,255); + } + tmp+=c_w; + _aux+=c_w; + } + switch(pli){ + case 1:{ + tmp-=c_sz; + /*Slide C_b up a quarter-pel. + This is the same filter used above, but in the other order.*/ + for(x=0;x>7,255); + } + for(;y>7,255); + } + for(;y>7,255); + } + _dst++; + tmp++; + } + _dst+=c_sz-c_w; + tmp-=c_w; + }break; + case 2:{ + tmp-=c_sz; + /*Slide C_r down a quarter-pel. + This is the same as the horizontal filter.*/ + for(x=0;x>7,255); + } + for(;y>7,255); + } + for(;y>7,255); + } + _dst++; + tmp++; + } + }break; + } + /*For actual interlaced material, this would have to be done separately on + each field, and the shift amounts would be different. + C_r moves down 1/8, C_b up 3/8 in the top field, and C_r moves down 3/8, + C_b up 1/8 in the bottom field. + The corresponding filters would be: + Down 1/8 (reverse order for up): [3 -11 125 15 -4 0]/128 + Down 3/8 (reverse order for up): [4 -19 98 56 -13 2]/128*/ + } +} + +/*422jpeg chroma samples are sited like: + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + + 411 chroma samples are sited like: + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + + We use a filter to resample at site locations one eighth pixel (at the source + chroma plane's horizontal resolution) and five eighths of a pixel to the + right.*/ +static void y4m_convert_411_422jpeg(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ + int c_w; + int dst_c_w; + int c_h; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=_y4m->pic_w*_y4m->pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(_y4m->pic_w+_y4m->src_c_dec_h-1)/_y4m->src_c_dec_h; + dst_c_w=(_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h; + c_h=(_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + _dst[x<<1|1]=(unsigned char)OC_CLAMPI(0,47*_aux[0]+ + 86*_aux[OC_MINI(1,c_w-1)]-5*_aux[OC_MINI(2,c_w-1)]+64>>7,255); + } + for(;x>7,255); + _dst[x<<1|1]=(unsigned char)OC_CLAMPI(0,-3*_aux[x-1]+50*_aux[x]+ + 86*_aux[x+1]-5*_aux[x+2]+64>>7,255); + } + for(;x>7,255); + if((x<<1|1)>7,255); + } + } + _dst+=dst_c_w; + _aux+=c_w; + } + } +} + +/*The image is padded with empty chroma components at 4:2:0. + This costs about 17 bits a frame to code.*/ +static void y4m_convert_mono_420jpeg(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ + int c_sz; + _dst+=_y4m->pic_w*_y4m->pic_h; + c_sz=((_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h)* + ((_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v); + memset(_dst,128,c_sz*2); +} + +#if 0 +/*Right now just 444 to 420. + Not too hard to generalize.*/ +static void y4m_convert_4xxjpeg_42xjpeg(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ + unsigned char *tmp; + int c_w; + int c_h; + int pic_sz; + int tmp_sz; + int c_sz; + int pli; + int y; + int x; + /*Compute the size of each chroma plane.*/ + c_w=(_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h; + c_h=(_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v; + pic_sz=_y4m->pic_w*_y4m->pic_h; + tmp_sz=c_w*_y4m->pic_h; + c_sz=c_w*c_h; + _dst+=pic_sz; + for(pli=1;pli<3;pli++){ + tmp=_aux+pic_sz; + /*In reality, the horizontal and vertical steps could be pipelined, for + less memory consumption and better cache performance, but we do them + separately for simplicity.*/ + /*First do horizontal filtering (convert to 4:2:2)*/ + /*Filter: [3 -17 78 78 -17 3]/128, derived from a 6-tap Lanczos window.*/ + for(y=0;y<_y4m->pic_h;y++){ + for(x=0;xpic_w,2);x+=2){ + tmp[x>>1]=OC_CLAMPI(0,64*_aux[0]+78*_aux[OC_MINI(1,_y4m->pic_w-1)] + -17*_aux[OC_MINI(2,_y4m->pic_w-1)] + +3*_aux[OC_MINI(3,_y4m->pic_w-1)]+64>>7,255); + } + for(;x<_y4m->pic_w-3;x+=2){ + tmp[x>>1]=OC_CLAMPI(0,3*(_aux[x-2]+_aux[x+3])-17*(_aux[x-1]+_aux[x+2])+ + 78*(_aux[x]+_aux[x+1])+64>>7,255); + } + for(;x<_y4m->pic_w;x+=2){ + tmp[x>>1]=OC_CLAMPI(0,3*(_aux[x-2]+_aux[_y4m->pic_w-1])- + 17*(_aux[x-1]+_aux[OC_MINI(x+2,_y4m->pic_w-1)])+ + 78*(_aux[x]+_aux[OC_MINI(x+1,_y4m->pic_w-1)])+64>>7,255); + } + tmp+=c_w; + _aux+=_y4m->pic_w; + } + _aux-=pic_sz; + tmp-=tmp_sz; + /*Now do the vertical filtering.*/ + for(x=0;xpic_h,2);y+=2){ + _dst[(y>>1)*c_w]=OC_CLAMPI(0,64*tmp[0] + +78*tmp[OC_MINI(1,_y4m->pic_h-1)*c_w] + -17*tmp[OC_MINI(2,_y4m->pic_h-1)*c_w] + +3*tmp[OC_MINI(3,_y4m->pic_h-1)*c_w]+64>>7,255); + } + for(;y<_y4m->pic_h-3;y+=2){ + _dst[(y>>1)*c_w]=OC_CLAMPI(0,3*(tmp[(y-2)*c_w]+tmp[(y+3)*c_w])- + 17*(tmp[(y-1)*c_w]+tmp[(y+2)*c_w])+78*(tmp[y*c_w]+tmp[(y+1)*c_w])+ + 64>>7,255); + } + for(;y<_y4m->pic_h;y+=2){ + _dst[(y>>1)*c_w]=OC_CLAMPI(0,3*(tmp[(y-2)*c_w] + +tmp[(_y4m->pic_h-1)*c_w])-17*(tmp[(y-1)*c_w] + +tmp[OC_MINI(y+2,_y4m->pic_h-1)*c_w]) + +78*(tmp[y*c_w]+tmp[OC_MINI(y+1,_y4m->pic_h-1)*c_w])+64>>7,255); + } + tmp++; + _dst++; + } + _dst-=c_w; + } +} +#endif + +/*No conversion function needed.*/ +static void y4m_convert_null(y4m_input *_y4m,unsigned char *_dst, + unsigned char *_aux){ +} + +static int y4m_input_open(y4m_input *_y4m,FILE *_fin,char *_skip,int _nskip){ + char buffer[80]; + int ret; + int i; + /*Read until newline, or 80 cols, whichever happens first.*/ + for(i=0;i<79;i++){ + if(_nskip>0){ + buffer[i]=*_skip++; + _nskip--; + } + else{ + ret=fread(buffer+i,1,1,_fin); + if(ret<1)return -1; + } + if(buffer[i]=='\n')break; + } + /*We skipped too much header data.*/ + if(_nskip>0)return -1; + if(i==79){ + fprintf(stderr,"Error parsing header; not a YUV2MPEG2 file?\n"); + return -1; + } + buffer[i]='\0'; + if(memcmp(buffer,"YUV4MPEG",8)){ + fprintf(stderr,"Incomplete magic for YUV4MPEG file.\n"); + return -1; + } + if(buffer[8]!='2'){ + fprintf(stderr,"Incorrect YUV input file version; YUV4MPEG2 required.\n"); + } + ret=y4m_parse_tags(_y4m,buffer+5); + if(ret<0){ + fprintf(stderr,"Error parsing YUV4MPEG2 header.\n"); + return ret; + } + if(_y4m->interlace!='p'){ + fprintf(stderr,"Input video is interlaced; " + "Theora only handles progressive scan.\n"); + return -1; + } + if(strcmp(_y4m->chroma_type,"420")==0|| + strcmp(_y4m->chroma_type,"420jpeg")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=_y4m->src_c_dec_v=_y4m->dst_c_dec_v=2; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h + +2*((_y4m->pic_w+1)/2)*((_y4m->pic_h+1)/2); + /*Natively supported: no conversion required.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=0; + _y4m->convert=y4m_convert_null; + } + else if(strcmp(_y4m->chroma_type,"420mpeg2")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=_y4m->src_c_dec_v=_y4m->dst_c_dec_v=2; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + /*Chroma filter required: read into the aux buf first.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz= + 2*((_y4m->pic_w+1)/2)*((_y4m->pic_h+1)/2); + _y4m->convert=y4m_convert_42xmpeg2_42xjpeg; + } + else if(strcmp(_y4m->chroma_type,"420paldv")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=_y4m->src_c_dec_v=_y4m->dst_c_dec_v=2; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + /*Chroma filter required: read into the aux buf first. + We need to make two filter passes, so we need some extra space in the + aux buffer.*/ + _y4m->aux_buf_sz=3*((_y4m->pic_w+1)/2)*((_y4m->pic_h+1)/2); + _y4m->aux_buf_read_sz=2*((_y4m->pic_w+1)/2)*((_y4m->pic_h+1)/2); + _y4m->convert=y4m_convert_42xpaldv_42xjpeg; + } + else if(strcmp(_y4m->chroma_type,"422")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=2; + _y4m->src_c_dec_v=_y4m->dst_c_dec_v=1; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + /*Chroma filter required: read into the aux buf first.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=2*((_y4m->pic_w+1)/2)*_y4m->pic_h; + _y4m->convert=y4m_convert_42xmpeg2_42xjpeg; + } + else if(strcmp(_y4m->chroma_type,"422jpeg")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=2; + _y4m->src_c_dec_v=_y4m->dst_c_dec_v=1; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h + +2*((_y4m->pic_w+1)/2)*_y4m->pic_h; + /*Natively supported: no conversion required.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=0; + _y4m->convert=y4m_convert_null; + } + else if(strcmp(_y4m->chroma_type,"411")==0){ + _y4m->src_c_dec_h=4; + /*We don't want to introduce any additional sub-sampling, so we + promote 4:1:1 material to 4:2:2, as the closest format Theora can + handle.*/ + _y4m->dst_c_dec_h=2; + _y4m->src_c_dec_v=_y4m->dst_c_dec_v=1; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + /*Chroma filter required: read into the aux buf first.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=2*((_y4m->pic_w+3)/4)*_y4m->pic_h; + _y4m->convert=y4m_convert_411_422jpeg; + } + else if(strcmp(_y4m->chroma_type,"444")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=_y4m->src_c_dec_v=_y4m->dst_c_dec_v=1; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h*3; + /*Natively supported: no conversion required.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=0; + _y4m->convert=y4m_convert_null; + } + else if(strcmp(_y4m->chroma_type,"444alpha")==0){ + _y4m->src_c_dec_h=_y4m->dst_c_dec_h=_y4m->src_c_dec_v=_y4m->dst_c_dec_v=1; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h*3; + /*Read the extra alpha plane into the aux buf. + It will be discarded.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + _y4m->convert=y4m_convert_null; + } + else if(strcmp(_y4m->chroma_type,"mono")==0){ + _y4m->src_c_dec_h=_y4m->src_c_dec_v=0; + _y4m->dst_c_dec_h=_y4m->dst_c_dec_v=2; + _y4m->dst_buf_read_sz=_y4m->pic_w*_y4m->pic_h; + /*No extra space required, but we need to clear the chroma planes.*/ + _y4m->aux_buf_sz=_y4m->aux_buf_read_sz=0; + _y4m->convert=y4m_convert_mono_420jpeg; + } + else{ + fprintf(stderr,"Unknown chroma sampling type: %s\n",_y4m->chroma_type); + return -1; + } + /*The size of the final frame buffers is always computed from the + destination chroma decimation type.*/ + _y4m->dst_buf_sz=_y4m->pic_w*_y4m->pic_h + +2*((_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h)* + ((_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v); + /*Scale the picture size up to a multiple of 16.*/ + _y4m->frame_w=_y4m->pic_w+15&~0xF; + _y4m->frame_h=_y4m->pic_h+15&~0xF; + /*Force the offsets to be even so that chroma samples line up like we + expect.*/ + _y4m->pic_x=_y4m->frame_w-_y4m->pic_w>>1&~1; + _y4m->pic_y=_y4m->frame_h-_y4m->pic_h>>1&~1; + _y4m->dst_buf=(unsigned char *)malloc(_y4m->dst_buf_sz); + _y4m->aux_buf=(unsigned char *)malloc(_y4m->aux_buf_sz); + return 0; +} + +static void y4m_input_get_info(y4m_input *_y4m,th_info *_ti){ + _ti->frame_width=_y4m->frame_w; + _ti->frame_height=_y4m->frame_h; + _ti->pic_width=_y4m->pic_w; + _ti->pic_height=_y4m->pic_h; + _ti->pic_x=_y4m->pic_x; + _ti->pic_y=_y4m->pic_y; + _ti->fps_numerator=_y4m->fps_n; + _ti->fps_denominator=_y4m->fps_d; + _ti->aspect_numerator=_y4m->par_n; + _ti->aspect_denominator=_y4m->par_d; + _ti->pixel_fmt=_y4m->dst_c_dec_h==2? + (_y4m->dst_c_dec_v==2?TH_PF_420:TH_PF_422):TH_PF_444; +} + +static int y4m_input_fetch_frame(y4m_input *_y4m,FILE *_fin, + th_ycbcr_buffer _ycbcr){ + char frame[6]; + int pic_sz; + int frame_c_w; + int frame_c_h; + int c_w; + int c_h; + int c_sz; + int ret; + pic_sz=_y4m->pic_w*_y4m->pic_h; + frame_c_w=_y4m->frame_w/_y4m->dst_c_dec_h; + frame_c_h=_y4m->frame_h/_y4m->dst_c_dec_v; + c_w=(_y4m->pic_w+_y4m->dst_c_dec_h-1)/_y4m->dst_c_dec_h; + c_h=(_y4m->pic_h+_y4m->dst_c_dec_v-1)/_y4m->dst_c_dec_v; + c_sz=c_w*c_h; + /*Read and skip the frame header.*/ + ret=fread(frame,1,6,_fin); + if(ret<6)return 0; + if(memcmp(frame,"FRAME",5)){ + fprintf(stderr,"Loss of framing in YUV input data\n"); + exit(1); + } + if(frame[5]!='\n'){ + char c; + int j; + for(j=0;j<79&&fread(&c,1,1,_fin)&&c!='\n';j++); + if(j==79){ + fprintf(stderr,"Error parsing YUV 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){ + fprintf(stderr,"Error reading YUV 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){ + fprintf(stderr,"Error reading YUV frame data.\n"); + return -1; + } + /*Now convert the just read frame.*/ + (*_y4m->convert)(_y4m,_y4m->dst_buf,_y4m->aux_buf); + /*Fill in the frame buffer pointers.*/ + _ycbcr[0].width=_y4m->frame_w; + _ycbcr[0].height=_y4m->frame_h; + _ycbcr[0].stride=_y4m->pic_w; + _ycbcr[0].data=_y4m->dst_buf-_y4m->pic_x-_y4m->pic_y*_y4m->pic_w; + _ycbcr[1].width=frame_c_w; + _ycbcr[1].height=frame_c_h; + _ycbcr[1].stride=c_w; + _ycbcr[1].data=_y4m->dst_buf+pic_sz-(_y4m->pic_x/_y4m->dst_c_dec_h)- + (_y4m->pic_y/_y4m->dst_c_dec_v)*c_w; + _ycbcr[2].width=frame_c_w; + _ycbcr[2].height=frame_c_h; + _ycbcr[2].stride=c_w; + _ycbcr[2].data=_ycbcr[1].data+c_sz; + return 1; +} + +static void y4m_input_close(y4m_input *_y4m){ + free(_y4m->dst_buf); + free(_y4m->aux_buf); +} + + + +typedef struct th_input th_input; + +struct th_input{ + ogg_sync_state oy; + int theora_p; + ogg_stream_state to; + th_info ti; + th_comment tc; + th_dec_ctx *td; +}; + + + +/*Grab some more compressed bitstream and sync it for page extraction.*/ +static int th_input_buffer_data(th_input *_th,FILE *_fin){ + char *buffer; + int bytes; + buffer=ogg_sync_buffer(&_th->oy,4096); + bytes=fread(buffer,1,4096,_fin); + ogg_sync_wrote(&_th->oy,bytes); + return bytes; +} + +/*Push a page into the appropriate steam. + This can be done blindly; a stream won't accept a page that doesn't belong to + it.*/ +static void th_input_queue_page(th_input *_th,ogg_page *_og){ + if(_th->theora_p)ogg_stream_pagein(&_th->to,_og); +} + +static int th_input_open_impl(th_input *_th,th_setup_info **_ts,FILE *_fin, + char *_sig,int _nsig){ + ogg_packet op; + ogg_page og; + int nheaders_left; + int done_headers; + ogg_sync_init(&_th->oy); + th_info_init(&_th->ti); + th_comment_init(&_th->tc); + *_ts=NULL; + /*Buffer any initial data read for file ID.*/ + if(_nsig>0){ + char *buffer; + buffer=ogg_sync_buffer(&_th->oy,_nsig); + memcpy(buffer,_sig,_nsig); + ogg_sync_wrote(&_th->oy,_nsig); + } + _th->theora_p=0; + nheaders_left=0; + for(done_headers=0;!done_headers;){ + if(th_input_buffer_data(_th,_fin)==0)break; + while(ogg_sync_pageout(&_th->oy,&og)>0){ + ogg_stream_state test; + /*Is this a mandated initial header? + If not, stop parsing.*/ + if(!ogg_page_bos(&og)){ + /*Don't leak the page; get it into the appropriate stream.*/ + th_input_queue_page(_th,&og); + done_headers=1; + break; + } + ogg_stream_init(&test,ogg_page_serialno(&og)); + ogg_stream_pagein(&test,&og); + ogg_stream_packetpeek(&test,&op); + /*Identify the codec: try Theora.*/ + if(!_th->theora_p){ + nheaders_left=th_decode_headerin(&_th->ti,&_th->tc,_ts,&op); + if(nheaders_left>=0){ + /*It is Theora.*/ + memcpy(&_th->to,&test,sizeof(test)); + _th->theora_p=1; + /*Advance past the successfully processed header.*/ + if(nheaders_left>0)ogg_stream_packetout(&_th->to,NULL); + continue; + } + } + /*Whatever it is, we don't care about it.*/ + ogg_stream_clear(&test); + } + } + /*We're expecting more header packets.*/ + while(_th->theora_p&&nheaders_left>0){ + int ret; + while(nheaders_left>0){ + ret=ogg_stream_packetpeek(&_th->to,&op); + if(ret==0)break; + if(ret<0)continue; + nheaders_left=th_decode_headerin(&_th->ti,&_th->tc,_ts,&op); + if(nheaders_left<0){ + fprintf(stderr,"Error parsing Theora stream headers; " + "corrupt stream?\n"); + return -1; + } + /*Advance past the successfully processed header.*/ + else if(nheaders_left>0)ogg_stream_packetout(&_th->to,NULL); + _th->theora_p++; + } + /*Stop now so we don't fail if there aren't enough pages in a short + stream.*/ + if(!(_th->theora_p&&nheaders_left>0))break; + /*The header pages/packets will arrive before anything else we care + about, or the stream is not obeying spec.*/ + if(ogg_sync_pageout(&_th->oy,&og)>0)th_input_queue_page(_th,&og); + /*We need more data.*/ + else if(th_input_buffer_data(_th,_fin)==0){ + fprintf(stderr,"End of file while searching for codec headers.\n"); + return -1; + } + } + /*And now we have it all. + Initialize the decoder.*/ + if(_th->theora_p){ + _th->td=th_decode_alloc(&_th->ti,*_ts); + if(_th->td!=NULL){ + fprintf(stderr,"Ogg logical stream %lx is Theora %ix%i %.02f fps video.\n" + "Encoded frame content is %ix%i with %ix%i offset.\n", + _th->to.serialno,_th->ti.frame_width,_th->ti.frame_height, + (double)_th->ti.fps_numerator/_th->ti.fps_denominator, + _th->ti.pic_width,_th->ti.pic_height,_th->ti.pic_x,_th->ti.pic_y); + return 1; + } + } + return -1; +} + +static void th_input_close(th_input *_th){ + if(_th->theora_p){ + ogg_stream_clear(&_th->to); + th_decode_free(_th->td); + } + th_comment_clear(&_th->tc); + th_info_clear(&_th->ti); + ogg_sync_clear(&_th->oy); +} + +static int th_input_open(th_input *_th,FILE *_fin,char *_sig,int _nsig){ + th_input th; + th_setup_info *ts; + int ret; + ret=th_input_open_impl(&th,&ts,_fin,_sig,_nsig); + th_setup_free(ts); + /*Clean up on failure.*/ + if(ret<0)th_input_close(&th); + else memcpy(_th,&th,sizeof(th)); + return ret; +} + +static void th_input_get_info(th_input *_th,th_info *_ti){ + memcpy(_ti,&_th->ti,sizeof(*_ti)); +} + +static int th_input_fetch_frame(th_input *_th,FILE *_fin, + th_ycbcr_buffer _ycbcr){ + for(;;){ + ogg_page og; + ogg_packet op; + if(ogg_stream_packetout(&_th->to,&op)>0){ + if(th_decode_packetin(_th->td,&op,NULL)>=0){ + th_decode_ycbcr_out(_th->td,_ycbcr); + if(!summary_only&&show_frame_type){ + printf("%c",th_packet_iskeyframe(&op)?'K':'D'); + if(op.bytes>0)printf("%02i ",op.packet[0]&0x3F); + else printf("-- "); + } + return 1; + } + else return -1; + } + while(ogg_sync_pageout(&_th->oy,&og)<=0){ + if(th_input_buffer_data(_th,_fin)==0)return feof(_fin)?0:-1; + } + th_input_queue_page(_th,&og); + } +} + + + +typedef struct video_input video_input; +typedef void (*video_input_get_info_func)(void *_ctx,th_info *_ti); +typedef int (*video_input_fetch_frame_func)(void *_ctx,FILE *_fin, + th_ycbcr_buffer _ycbcr); +typedef void (*video_input_close_func)(void *_ctx); + +struct video_input{ + FILE *fin; + video_input_get_info_func get_info; + video_input_fetch_frame_func fetch_frame; + video_input_close_func close; + union{ + y4m_input y4m; + th_input th; + }ctx; +}; + +static int video_input_open(video_input *_vid,FILE *_fin){ + char buffer[4]; + int ret; + /* look for magic */ + ret=fread(buffer,1,4,_fin); + if(ret<4)fprintf(stderr,"EOF determining file type of file.\n"); + else{ + if(!memcmp(buffer,"YUV4",4)){ + if(y4m_input_open(&_vid->ctx.y4m,_fin,buffer,4)>=0){ + /*fprintf(stderr,"Original %s is %dx%d %.02f fps %s video.\n", + f,_y4m->pic_w,_y4m->pic_h,(double)_y4m->fps_n/_y4m->fps_d,_y4m->chroma_type);*/ + _vid->fin=_fin; + _vid->get_info=(video_input_get_info_func)y4m_input_get_info; + _vid->fetch_frame=(video_input_fetch_frame_func)y4m_input_fetch_frame; + _vid->close=(video_input_close_func)y4m_input_close; + return 0; + } + } + else if(!memcmp(buffer,"OggS",4)){ + if(th_input_open(&_vid->ctx.th,_fin,buffer,4)>=0){ + _vid->fin=_fin; + _vid->get_info=(video_input_get_info_func)th_input_get_info; + _vid->fetch_frame=(video_input_fetch_frame_func)th_input_fetch_frame; + _vid->close=(video_input_close_func)th_input_close; + return 0; + } + } + else fprintf(stderr,"Unknown file type.\n"); + } + return -1; +} + +static void video_input_get_info(video_input *_vid,th_info *_ti){ + (*_vid->get_info)(&_vid->ctx,_ti); +} + +static int video_input_fetch_frame(video_input *_vid,th_ycbcr_buffer _ycbcr){ + return (*_vid->fetch_frame)(&_vid->ctx,_vid->fin,_ycbcr); +} + +static void video_input_close(video_input *_vid){ + (*_vid->close)(&_vid->ctx); + fclose(_vid->fin); +} + + + +static void usage(char *_argv[]){ + fprintf(stderr,"Usage: %s [options] \n" + " and may be either YUV4MPEG or Ogg Theora files.\n\n" + " Options:\n\n" + " -f --frame-type Show frame type and QI value for each Theora frame.\n" + " -s --summary Only output the summary line.\n" + " -y --luma-only Only output values for the luma channel.\n",_argv[0]); +} + +int main(int _argc,char *_argv[]){ + video_input vid1; + th_info ti1; + video_input vid2; + th_info ti2; + ogg_int64_t gsqerr; + ogg_int64_t gnpixels; + ogg_int64_t gplsqerr[3]; + ogg_int64_t gplnpixels[3]; + int frameno; + FILE *fin; + int long_option_index; + int c; +#ifdef _WIN32 + /*We need to set stdin/stdout to binary mode on windows. + Beware the evil ifdef. + We avoid these where we can, but this one we cannot. + Don't add any more, you'll probably go to hell if you do.*/ + _setmode(_fileno(stdin),_O_BINARY); +#endif + /*Process option arguments.*/ + while((c=getopt_long(_argc,_argv,optstring,options,&long_option_index))!=EOF){ + switch(c){ + case 'f':show_frame_type=1;break; + case 's':summary_only=1;break; + case 'y':luma_only=1;break; + default:usage(_argv);break; + } + } + if(optind+2!=_argc){ + usage(_argv); + exit(1); + } + fin=strcmp(_argv[optind],"-")==0?stdin:fopen(_argv[optind],"rb"); + if(fin==NULL){ + fprintf(stderr,"Unable to open '%s' for extraction.\n",_argv[optind]); + exit(1); + } + fprintf(stderr,"Opening %s...\n",_argv[optind]); + if(video_input_open(&vid1,fin)<0)exit(1); + video_input_get_info(&vid1,&ti1); + fin=strcmp(_argv[optind+1],"-")==0?stdin:fopen(_argv[optind+1],"rb"); + if(fin==NULL){ + fprintf(stderr,"Unable to open '%s' for extraction.\n",_argv[optind+1]); + exit(1); + } + fprintf(stderr,"Opening %s...\n",_argv[optind+1]); + if(video_input_open(&vid2,fin)<0)exit(1); + video_input_get_info(&vid2,&ti2); + /*Check to make sure these videos are compatible.*/ + if(ti1.pic_width!=ti2.pic_width||ti1.pic_height!=ti2.pic_height){ + fprintf(stderr,"Video resolution does not match.\n"); + exit(1); + } + if(ti1.pixel_fmt!=ti2.pixel_fmt){ + fprintf(stderr,"Pixel formats do not match.\n"); + exit(1); + } + if((ti1.pic_x&!(ti1.pixel_fmt&1))!=(ti2.pic_x&!(ti2.pixel_fmt&1))|| + (ti1.pic_y&!(ti1.pixel_fmt&2))!=(ti2.pic_y&!(ti2.pixel_fmt&2))){ + fprintf(stderr,"Chroma subsampling offsets do not match.\n"); + exit(1); + } + if(ti1.fps_numerator*(ogg_int64_t)ti2.fps_denominator!= + ti2.fps_numerator*(ogg_int64_t)ti1.fps_denominator){ + fprintf(stderr,"Warning: framerates do not match.\n"); + } + if(ti1.aspect_numerator*(ogg_int64_t)ti2.aspect_denominator!= + ti2.aspect_numerator*(ogg_int64_t)ti1.aspect_denominator){ + fprintf(stderr,"Warning: aspect ratios do not match.\n"); + } + gsqerr=gplsqerr[0]=gplsqerr[1]=gplsqerr[2]=0; + gnpixels=gplnpixels[0]=gplnpixels[1]=gplnpixels[2]=0; + for(frameno=0;;frameno++){ + th_ycbcr_buffer f1; + th_ycbcr_buffer f2; + ogg_int64_t plsqerr[3]; + long plnpixels[3]; + ogg_int64_t sqerr; + long npixels; + int ret1; + int ret2; + int pli; + ret1=video_input_fetch_frame(&vid1,f1); + ret2=video_input_fetch_frame(&vid2,f2); + if(ret1==0&&ret2==0)break; + else if(ret1<0||ret2<0)break; + else if(ret1==0){ + fprintf(stderr,"%s ended before %s.\n", + _argv[optind],_argv[optind+1]); + break; + } + else if(ret2==0){ + fprintf(stderr,"%s ended before %s.\n", + _argv[optind+1],_argv[optind]); + break; + } + /*Okay, we got one frame from each.*/ + sqerr=0; + npixels=0; + for(pli=0;pli<3;pli++){ + int xdec; + int ydec; + int y1; + int y2; + xdec=pli&&!(ti1.pixel_fmt&1); + ydec=pli&&!(ti1.pixel_fmt&2); + plsqerr[pli]=0; + plnpixels[pli]=0; + for(y1=ti1.pic_y>>ydec,y2=ti2.pic_y>>ydec; + y1>ydec;y1++,y2++){ + int x1; + int x2; + for(x1=ti1.pic_x>>xdec,x2=ti2.pic_x>>xdec; + x1>xdec;x1++,x2++){ + int d; + d=*(f1[pli].data+y1*f1[pli].stride+x1)- + *(f2[pli].data+y2*f2[pli].stride+x2); + plsqerr[pli]+=d*d; + plnpixels[pli]++; + } + } + sqerr+=plsqerr[pli]; + gplsqerr[pli]+=plsqerr[pli]; + npixels+=plnpixels[pli]; + gplnpixels[pli]+=plnpixels[pli]; + } + if(!summary_only){ + if(!luma_only){ + printf("%08i: %-7lG (Y': %-7lG Cb: %-7lG Cr: %-7lG)\n",frameno, + 10*(log10(255*255)+log10(npixels)-log10(sqerr)), + 10*(log10(255*255)+log10(plnpixels[0])-log10(plsqerr[0])), + 10*(log10(255*255)+log10(plnpixels[1])-log10(plsqerr[1])), + 10*(log10(255*255)+log10(plnpixels[2])-log10(plsqerr[2]))); + } + else{ + printf("%08i: %-7lG\n",frameno, + 10*(log10(255*255)+log10(plnpixels[0])-log10(plsqerr[0]))); + } + } + gsqerr+=sqerr; + gnpixels+=npixels; + } + if(!luma_only){ + printf("Total: %-7lG (Y': %-7lG Cb: %-7lG Cr: %-7lG)\n", + 10*(log10(255*255)+log10(gnpixels)-log10(gsqerr)), + 10*(log10(255*255)+log10(gplnpixels[0])-log10(gplsqerr[0])), + 10*(log10(255*255)+log10(gplnpixels[1])-log10(gplsqerr[1])), + 10*(log10(255*255)+log10(gplnpixels[2])-log10(gplsqerr[2]))); + } + else{ + printf("Total: %-7lG\n", + 10*(log10(255*255)+log10(gplnpixels[0])-log10(gplsqerr[0]))); + } + video_input_close(&vid1); + video_input_close(&vid2); + return 0; +} diff --git a/libs/libtheora-1.1/examples/dump_video.c b/libs/libtheora-1.1/examples/dump_video.c new file mode 100644 index 00000000..1449ec48 --- /dev/null +++ b/libs/libtheora-1.1/examples/dump_video.c @@ -0,0 +1,496 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: example dumpvid application; dumps Theora streams + last mod: $Id: dump_video.c,v 1.2 2004/03/24 19:12:42 derf Exp $ + + ********************************************************************/ + +/* By Mauricio Piacentini (mauricio at xiph.org) */ +/* simply dump decoded YUV data, for verification of theora bitstream */ + +#if !defined(_REENTRANT) +#define _REENTRANT +#endif +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE +#endif +#if !defined(_LARGEFILE_SOURCE) +#define _LARGEFILE_SOURCE +#endif +#if !defined(_LARGEFILE64_SOURCE) +#define _LARGEFILE64_SOURCE +#endif +#if !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + +#include +#include +#include +#include +#include +#include +/*Yes, yes, we're going to hell.*/ +#if defined(_WIN32) +#include +#endif +#include +#include +#include +#include +#include "getopt.h" +#include "theora/theoradec.h" + +const char *optstring = "o:rf"; +struct option options [] = { + {"output",required_argument,NULL,'o'}, + {"raw",no_argument, NULL,'r'}, /*Disable YUV4MPEG2 headers:*/ + {"fps-only",no_argument, NULL, 'f'}, /* Only interested in fps of decode loop */ + {NULL,0,NULL,0} +}; + +/* Helper; just grab some more compressed bitstream and sync it for + page extraction */ +int buffer_data(FILE *in,ogg_sync_state *oy){ + char *buffer=ogg_sync_buffer(oy,4096); + int bytes=fread(buffer,1,4096,in); + ogg_sync_wrote(oy,bytes); + return(bytes); +} + +/* never forget that globals are a one-way ticket to Hell */ +/* Ogg and codec state for demux/decode */ +ogg_sync_state oy; +ogg_page og; +ogg_stream_state vo; +ogg_stream_state to; +th_info ti; +th_comment tc; +th_setup_info *ts; +th_dec_ctx *td; + +int theora_p=0; +int theora_processing_headers; +int stateflag=0; + +/* single frame video buffering */ +int videobuf_ready=0; +ogg_int64_t videobuf_granulepos=-1; +double videobuf_time=0; +int raw=0; + +FILE* outfile = NULL; + +int got_sigint=0; +static void sigint_handler (int signal) { + got_sigint = 1; +} + +static th_ycbcr_buffer ycbcr; + +static void stripe_decoded(th_ycbcr_buffer _dst,th_ycbcr_buffer _src, + int _fragy0,int _fragy_end){ + int pli; + for(pli=0;pli<3;pli++){ + int yshift; + int y_end; + int y; + yshift=pli!=0&&!(ti.pixel_fmt&2); + y_end=_fragy_end<<3-yshift; + /*An implemention intending to display this data would need to check the + crop rectangle before proceeding.*/ + for(y=_fragy0<<3-yshift;y>xshift)*(ti.frame_height>>yshift)*sizeof(char)); + ycbcr[pli].stride=ti.frame_width>>xshift; + ycbcr[pli].width=ti.frame_width>>xshift; + ycbcr[pli].height=ti.frame_height>>yshift; + } + /*Similarly, since ycbcr is a global, there's no real reason to pass it as + the context. + In a more object-oriented decoder, we could pass the "this" pointer + instead (though in C++, platform-dependent calling convention differences + prevent us from using a real member function pointer).*/ + cb.ctx=ycbcr; + cb.stripe_decoded=(th_stripe_decoded_func)stripe_decoded; + th_decode_ctl(td,TH_DECCTL_SET_STRIPE_CB,&cb,sizeof(cb)); +} + +/*Write out the planar YUV frame, uncropped.*/ +static void video_write(void){ + int pli; + int i; + /*Uncomment the following to do normal, non-striped decoding. + th_ycbcr_buffer ycbcr; + th_decode_ycbcr_out(td,ycbcr);*/ + if(outfile){ + if(!raw)fprintf(outfile, "FRAME\n"); + for(pli=0;pli<3;pli++){ + for(i=0;ivendor); + if(_tc->comments){ + fprintf(out,"theora comment header:\n"); + for(i=0;i<_tc->comments;i++){ + if(_tc->user_comments[i]){ + len=_tc->comment_lengths[i]comment_lengths[i]:INT_MAX; + fprintf(out,"\t%.*s\n",len,_tc->user_comments[i]); + } + } + } + return 0; +} + +/* helper: push a page into the appropriate steam */ +/* this can be done blindly; a stream won't accept a page + that doesn't belong to it */ +static int queue_page(ogg_page *page){ + if(theora_p)ogg_stream_pagein(&to,page); + return 0; +} + +static void usage(void){ + fprintf(stderr, + "Usage: dumpvid > outfile\n" + "input is read from stdin if no file is passed on the command line\n" + "\n" + ); +} + +int main(int argc,char *argv[]){ + + ogg_packet op; + + int long_option_index; + int c; + + struct timeb start; + struct timeb after; + struct timeb last; + int fps_only=0; + int frames = 0; + + FILE *infile = stdin; + outfile = stdout; + +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode on windows. */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + + /* Process option arguments. */ + while((c=getopt_long(argc,argv,optstring,options,&long_option_index))!=EOF){ + switch(c){ + case 'o': + if(strcmp(optarg,"-")!=0){ + outfile=fopen(optarg,"wb"); + if(outfile==NULL){ + fprintf(stderr,"Unable to open output file '%s'\n", optarg); + exit(1); + } + }else{ + outfile=stdout; + } + break; + + case 'r': + raw=1; + break; + + case 'f': + fps_only = 1; + outfile = NULL; + break; + + default: + usage(); + } + } + if(optind0){ + int got_packet; + ogg_stream_state test; + + /* is this a mandated initial header? If not, stop parsing */ + if(!ogg_page_bos(&og)){ + /* don't leak the page; get it into the appropriate stream */ + queue_page(&og); + stateflag=1; + break; + } + + ogg_stream_init(&test,ogg_page_serialno(&og)); + ogg_stream_pagein(&test,&og); + got_packet = ogg_stream_packetpeek(&test,&op); + + /* identify the codec: try theora */ + if((got_packet==1) && !theora_p && (theora_processing_headers= + th_decode_headerin(&ti,&tc,&ts,&op))>=0){ + /* it is theora -- save this stream state */ + memcpy(&to,&test,sizeof(test)); + theora_p=1; + /*Advance past the successfully processed header.*/ + if(theora_processing_headers)ogg_stream_packetout(&to,NULL); + }else{ + /* whatever it is, we don't care about it */ + ogg_stream_clear(&test); + } + } + /* fall through to non-bos page parsing */ + } + + /* we're expecting more header packets. */ + while(theora_p && theora_processing_headers){ + int ret; + + /* look for further theora headers */ + while(theora_processing_headers&&(ret=ogg_stream_packetpeek(&to,&op))){ + if(ret<0)continue; + theora_processing_headers=th_decode_headerin(&ti,&tc,&ts,&op); + if(theora_processing_headers<0){ + fprintf(stderr,"Error parsing Theora stream headers; " + "corrupt stream?\n"); + exit(1); + } + else if(theora_processing_headers>0){ + /*Advance past the successfully processed header.*/ + ogg_stream_packetout(&to,NULL); + } + theora_p++; + } + + /*Stop now so we don't fail if there aren't enough pages in a short + stream.*/ + if(!(theora_p && theora_processing_headers))break; + + /* The header pages/packets will arrive before anything else we + care about, or the stream is not obeying spec */ + + if(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); /* demux into the appropriate stream */ + }else{ + int ret=buffer_data(infile,&oy); /* someone needs more data */ + if(ret==0){ + fprintf(stderr,"End of file while searching for codec headers.\n"); + exit(1); + } + } + } + + /* and now we have it all. initialize decoders */ + if(theora_p){ + dump_comments(&tc); + td=th_decode_alloc(&ti,ts); + fprintf(stderr,"Ogg logical stream %lx is Theora %dx%d %.02f fps video\n" + "Encoded frame content is %dx%d with %dx%d offset\n", + to.serialno,ti.frame_width,ti.frame_height, + (double)ti.fps_numerator/ti.fps_denominator, + ti.pic_width,ti.pic_height,ti.pic_x,ti.pic_y); + }else{ + /* tear down the partial theora setup */ + th_info_clear(&ti); + th_comment_clear(&tc); + } + /*Either way, we're done with the codec setup data.*/ + th_setup_free(ts); + + /* open video */ + if(theora_p)open_video(); + + if(!raw && outfile){ + static const char *CHROMA_TYPES[4]={"420jpeg",NULL,"422jpeg","444"}; + if(ti.pixel_fmt>=4||ti.pixel_fmt==TH_PF_RSVD){ + fprintf(stderr,"Unknown pixel format: %i\n",ti.pixel_fmt); + exit(1); + } + fprintf(outfile,"YUV4MPEG2 C%s W%d H%d F%d:%d I%c A%d:%d\n", + CHROMA_TYPES[ti.pixel_fmt],ti.frame_width,ti.frame_height, + ti.fps_numerator,ti.fps_denominator,'p', + ti.aspect_numerator,ti.aspect_denominator); + } + + /* install signal handler */ + signal (SIGINT, sigint_handler); + + /*Finally the main decode loop. + + It's one Theora packet per frame, so this is pretty straightforward if + we're not trying to maintain sync with other multiplexed streams. + + The videobuf_ready flag is used to maintain the input buffer in the libogg + stream state. + If there's no output frame available at the end of the decode step, we must + need more input data. + We could simplify this by just using the return code on + ogg_page_packetout(), but the flag system extends easily to the case where + you care about more than one multiplexed stream (like with audio + playback). + In that case, just maintain a flag for each decoder you care about, and + pull data when any one of them stalls. + + videobuf_time holds the presentation time of the currently buffered video + frame. + We ignore this value.*/ + + stateflag=0; /* playback has not begun */ + /* queue any remaining pages from data we buffered but that did not + contain headers */ + while(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); + } + + if(fps_only){ + ftime(&start); + ftime(&last); + } + + while(!got_sigint){ + + while(theora_p && !videobuf_ready){ + /* theora is one in, one out... */ + if(ogg_stream_packetout(&to,&op)>0){ + + if(th_decode_packetin(td,&op,&videobuf_granulepos)>=0){ + videobuf_time=th_granule_time(td,videobuf_granulepos); + videobuf_ready=1; + frames++; + if(fps_only) + ftime(&after); + } + + }else + break; + } + + if(fps_only && (videobuf_ready || fps_only==2)){ + long ms = + after.time*1000.+after.millitm- + (last.time*1000.+last.millitm); + + if(ms>500 || fps_only==1 || + (feof(infile) && !videobuf_ready)){ + float file_fps = (float)ti.fps_numerator/ti.fps_denominator; + fps_only=2; + + ms = after.time*1000.+after.millitm- + (start.time*1000.+start.millitm); + + fprintf(stderr,"\rframe:%d rate:%.2fx ", + frames, + frames*1000./(ms*file_fps)); + memcpy(&last,&after,sizeof(last)); + } + } + + if(!videobuf_ready && feof(infile))break; + + if(!videobuf_ready){ + /* no data yet for somebody. Grab another page */ + buffer_data(infile,&oy); + while(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); + } + } + /* dumpvideo frame, and get new one */ + else if(outfile)video_write(); + + videobuf_ready=0; + } + + /* end of decoder loop -- close everything */ + + if(theora_p){ + ogg_stream_clear(&to); + th_decode_free(td); + th_comment_clear(&tc); + th_info_clear(&ti); + } + ogg_sync_clear(&oy); + + if(infile && infile!=stdin)fclose(infile); + if(outfile && outfile!=stdout)fclose(outfile); + + fprintf(stderr, "\n\n%d frames\n", frames); + fprintf(stderr, "\nDone.\n"); + + return(0); + +} diff --git a/libs/libtheora-1.1/examples/encoder_example.c b/libs/libtheora-1.1/examples/encoder_example.c new file mode 100644 index 00000000..1ff39da1 --- /dev/null +++ b/libs/libtheora-1.1/examples/encoder_example.c @@ -0,0 +1,1830 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: example encoder application; makes an Ogg Theora/Vorbis + file from YUV4MPEG2 and WAV input + last mod: $Id: encoder_example.c 16764 2009-12-28 14:27:33Z tterribe $ + + ********************************************************************/ + +#if !defined(_REENTRANT) +#define _REENTRANT +#endif +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE +#endif +#if !defined(_LARGEFILE_SOURCE) +#define _LARGEFILE_SOURCE +#endif +#if !defined(_LARGEFILE64_SOURCE) +#define _LARGEFILE64_SOURCE +#endif +#if !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + +#include +#if !defined(_WIN32) +#include +#include +#else +#include "getopt.h" +#endif +#include +#include +#include +#include +#include "theora/theoraenc.h" +#include "vorbis/codec.h" +#include "vorbis/vorbisenc.h" + +#ifdef _WIN32 +/*supply missing headers and functions to Win32. going to hell, I know*/ +#include +#include + +static double rint(double x) +{ + if (x < 0.0) + return (double)(int)(x - 0.5); + else + return (double)(int)(x + 0.5); +} +#endif + +const char *optstring = "b:e:o:a:A:v:V:s:S:f:F:ck:d:z:\1\2\3\4"; +struct option options [] = { + {"begin-time",required_argument,NULL,'b'}, + {"end-time",required_argument,NULL,'e'}, + {"output",required_argument,NULL,'o'}, + {"audio-rate-target",required_argument,NULL,'A'}, + {"video-rate-target",required_argument,NULL,'V'}, + {"audio-quality",required_argument,NULL,'a'}, + {"video-quality",required_argument,NULL,'v'}, + {"aspect-numerator",required_argument,NULL,'s'}, + {"aspect-denominator",required_argument,NULL,'S'}, + {"framerate-numerator",required_argument,NULL,'f'}, + {"framerate-denominator",required_argument,NULL,'F'}, + {"vp3-compatible",no_argument,NULL,'c'}, + {"speed",required_argument,NULL,'z'}, + {"soft-target",no_argument,NULL,'\1'}, + {"keyframe-freq",required_argument,NULL,'k'}, + {"buf-delay",required_argument,NULL,'d'}, + {"two-pass",no_argument,NULL,'\2'}, + {"first-pass",required_argument,NULL,'\3'}, + {"second-pass",required_argument,NULL,'\4'}, + {NULL,0,NULL,0} +}; + +/* You'll go to Hell for using globals. */ + +FILE *audio=NULL; +FILE *video=NULL; + +int audio_ch=0; +int audio_hz=0; + +float audio_q=.1f; +int audio_r=-1; +int vp3_compatible=0; + +int frame_w=0; +int frame_h=0; +int pic_w=0; +int pic_h=0; +int pic_x=0; +int pic_y=0; +int video_fps_n=-1; +int video_fps_d=-1; +int video_par_n=-1; +int video_par_d=-1; +char interlace; +int src_c_dec_h=2; +int src_c_dec_v=2; +int dst_c_dec_h=2; +int dst_c_dec_v=2; +char chroma_type[16]; + +/*The size of each converted frame buffer.*/ +size_t y4m_dst_buf_sz; +/*The amount to read directly into the converted frame buffer.*/ +size_t y4m_dst_buf_read_sz; +/*The size of the auxilliary buffer.*/ +size_t y4m_aux_buf_sz; +/*The amount to read into the auxilliary buffer.*/ +size_t y4m_aux_buf_read_sz; + +/*The function used to perform chroma conversion.*/ +typedef void (*y4m_convert_func)(unsigned char *_dst,unsigned char *_aux); + +y4m_convert_func y4m_convert=NULL; + +int video_r=-1; +int video_q=-1; +ogg_uint32_t keyframe_frequency=0; +int buf_delay=-1; + +long begin_sec=-1; +long begin_usec=0; +long end_sec=-1; +long end_usec=0; + +static void usage(void){ + fprintf(stderr, + "Usage: encoder_example [options] [audio_file] video_file\n\n" + "Options: \n\n" + " -o --output file name for encoded output;\n" + " If this option is not given, the\n" + " compressed data is sent to stdout.\n\n" + " -A --audio-rate-target bitrate target for Vorbis audio;\n" + " use -a and not -A if at all possible,\n" + " as -a gives higher quality for a given\n" + " bitrate.\n\n" + " -V --video-rate-target bitrate target for Theora video\n\n" + " --soft-target Use a large reservoir and treat the rate\n" + " as a soft target; rate control is less\n" + " strict but resulting quality is usually\n" + " higher/smoother overall. Soft target also\n" + " allows an optional -v setting to specify\n" + " a minimum allowed quality.\n\n" + " --two-pass Compress input using two-pass rate control\n" + " This option requires that the input to the\n" + " to the encoder is seekable and performs\n" + " both passes automatically.\n\n" + " --first-pass Perform first-pass of a two-pass rate\n" + " controlled encoding, saving pass data to\n" + " for a later second pass\n\n" + " --second-pass Perform second-pass of a two-pass rate\n" + " controlled encoding, reading first-pass\n" + " data from . The first pass\n" + " data must come from a first encoding pass\n" + " using identical input video to work\n" + " properly.\n\n" + " -a --audio-quality Vorbis quality selector from -1 to 10\n" + " (-1 yields smallest files but lowest\n" + " fidelity; 10 yields highest fidelity\n" + " but large files. '2' is a reasonable\n" + " default).\n\n" + " -v --video-quality Theora quality selector from 0 to 10\n" + " (0 yields smallest files but lowest\n" + " video quality. 10 yields highest\n" + " fidelity but large files).\n\n" + " -s --aspect-numerator Aspect ratio numerator, default is 0\n" + " or extracted from YUV input file\n" + " -S --aspect-denominator Aspect ratio denominator, default is 0\n" + " or extracted from YUV input file\n" + " -f --framerate-numerator Frame rate numerator, can be extracted\n" + " from YUV input file. ex: 30000000\n" + " -F --framerate-denominator Frame rate denominator, can be extracted\n" + " from YUV input file. ex: 1000000\n" + " The frame rate nominator divided by this\n" + " determinates the frame rate in units per tick\n" + " -k --keyframe-freq Keyframe frequency\n" + " -z --speed Sets the encoder speed level. Higher speed\n" + " levels favor quicker encoding over better\n" + " quality per bit. Depending on the encoding\n" + " mode, and the internal algorithms used,\n" + " quality may actually improve with higher\n" + " speeds, but in this case bitrate will also\n" + " likely increase. The maximum value, and the\n" + " meaning of each value, are implementation-\n" + " specific and may change depending on the\n" + " current encoding mode (rate constrained,\n" + " two-pass, etc.).\n" + " -d --buf-delay Buffer delay (in frames). Longer delays\n" + " allow smoother rate adaptation and provide\n" + " better overall quality, but require more\n" + " client side buffering and add latency. The\n" + " default value is the keyframe interval for\n" + " one-pass encoding (or somewhat larger if\n" + " --soft-target is used) and infinite for\n" + " two-pass encoding.\n" + " -b --begin-time Begin encoding at offset into input\n" + " -e --end-time End encoding at offset into input\n" + "encoder_example accepts only uncompressed RIFF WAV format audio and\n" + "YUV4MPEG2 uncompressed video.\n\n"); + exit(1); +} + +static int y4m_parse_tags(char *_tags){ + int got_w; + int got_h; + int got_fps; + int got_interlace; + int got_par; + int got_chroma; + int tmp_video_fps_n; + int tmp_video_fps_d; + int tmp_video_par_n; + int tmp_video_par_d; + char *p; + char *q; + got_w=got_h=got_fps=got_interlace=got_par=got_chroma=0; + for(p=_tags;;p=q){ + /*Skip any leading spaces.*/ + while(*p==' ')p++; + /*If that's all we have, stop.*/ + if(p[0]=='\0')break; + /*Find the end of this tag.*/ + for(q=p+1;*q!='\0'&&*q!=' ';q++); + /*Process the tag.*/ + switch(p[0]){ + case 'W':{ + if(sscanf(p+1,"%d",&pic_w)!=1)return -1; + got_w=1; + }break; + case 'H':{ + if(sscanf(p+1,"%d",&pic_h)!=1)return -1; + got_h=1; + }break; + case 'F':{ + if(sscanf(p+1,"%d:%d",&tmp_video_fps_n,&tmp_video_fps_d)!=2)return -1; + got_fps=1; + }break; + case 'I':{ + interlace=p[1]; + got_interlace=1; + }break; + case 'A':{ + if(sscanf(p+1,"%d:%d",&tmp_video_par_n,&tmp_video_par_d)!=2)return -1; + got_par=1; + }break; + case 'C':{ + if(q-p>16)return -1; + memcpy(chroma_type,p+1,q-p-1); + chroma_type[q-p-1]='\0'; + got_chroma=1; + }break; + /*Ignore unknown tags.*/ + } + } + if(!got_w||!got_h||!got_fps||!got_interlace||!got_par)return -1; + /*Chroma-type is not specified in older files, e.g., those generated by + mplayer.*/ + if(!got_chroma)strcpy(chroma_type,"420"); + /*Update fps and aspect ratio globals if not specified in the command line.*/ + if(video_fps_n==-1)video_fps_n=tmp_video_fps_n; + if(video_fps_d==-1)video_fps_d=tmp_video_fps_d; + if(video_par_n==-1)video_par_n=tmp_video_par_n; + if(video_par_d==-1)video_par_d=tmp_video_par_d; + return 0; +} + +/*All anti-aliasing filters in the following conversion functions are based on + one of two window functions: + The 6-tap Lanczos window (for down-sampling and shifts): + sinc(\pi*t)*sinc(\pi*t/3), |t|<3 (sinc(t)==sin(t)/t) + 0, |t|>=3 + The 4-tap Mitchell window (for up-sampling): + 7|t|^3-12|t|^2+16/3, |t|<1 + -(7/3)|x|^3+12|x|^2-20|x|+32/3, |t|<2 + 0, |t|>=2 + The number of taps is intentionally kept small to reduce computational + overhead and limit ringing. + + The taps from these filters are scaled so that their sum is 1, and the result + is scaled by 128 and rounded to integers to create a filter whose + intermediate values fit inside 16 bits. + Coefficients are rounded in such a way as to ensure their sum is still 128, + which is usually equivalent to normal rounding.*/ + +#define OC_MINI(_a,_b) ((_a)>(_b)?(_b):(_a)) +#define OC_MAXI(_a,_b) ((_a)<(_b)?(_b):(_a)) +#define OC_CLAMPI(_a,_b,_c) (OC_MAXI(_a,OC_MINI(_b,_c))) + +/*420jpeg chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + 420mpeg2 chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + BR | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + BR | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + We use a resampling filter to shift the site locations one quarter pixel (at + the chroma plane's resolution) to the right. + The 4:2:2 modes look exactly the same, except there are twice as many chroma + lines, and they are vertically co-sited with the luma samples in both the + mpeg2 and jpeg cases (thus requiring no vertical resampling).*/ +static void y4m_convert_42xmpeg2_42xjpeg(unsigned char *_dst, + unsigned char *_aux){ + int c_w; + int c_h; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=pic_w*pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(pic_w+dst_c_dec_h-1)/dst_c_dec_h; + c_h=(pic_h+dst_c_dec_v-1)/dst_c_dec_v; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + } + for(;x>7,255); + } + for(;x>7,255); + } + _dst+=c_w; + _aux+=c_w; + } + } +} + +/*This format is only used for interlaced content, but is included for + completeness. + + 420jpeg chroma samples are sited like: + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | BR | | BR | + | | | | + Y-------Y-------Y-------Y------- + | | | | + | | | | + | | | | + + 420paldv chroma samples are sited like: + YR------Y-------YR------Y------- + | | | | + | | | | + | | | | + YB------Y-------YB------Y------- + | | | | + | | | | + | | | | + YR------Y-------YR------Y------- + | | | | + | | | | + | | | | + YB------Y-------YB------Y------- + | | | | + | | | | + | | | | + + We use a resampling filter to shift the site locations one quarter pixel (at + the chroma plane's resolution) to the right. + Then we use another filter to move the C_r location down one quarter pixel, + and the C_b location up one quarter pixel.*/ +static void y4m_convert_42xpaldv_42xjpeg(unsigned char *_dst, + unsigned char *_aux){ + unsigned char *tmp; + int c_w; + int c_h; + int c_sz; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=pic_w*pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(pic_w+1)/2; + c_h=(pic_h+dst_c_dec_h-1)/dst_c_dec_h; + c_sz=c_w*c_h; + /*First do the horizontal re-sampling. + This is the same as the mpeg2 case, except that after the horizontal case, + we need to apply a second vertical filter.*/ + tmp=_aux+2*c_sz; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + } + for(;x>7,255); + } + for(;x>7,255); + } + tmp+=c_w; + _aux+=c_w; + } + switch(pli){ + case 1:{ + tmp-=c_sz; + /*Slide C_b up a quarter-pel. + This is the same filter used above, but in the other order.*/ + for(x=0;x>7,255); + } + for(;y>7,255); + } + for(;y>7,255); + } + _dst++; + tmp++; + } + _dst+=c_sz-c_w; + tmp-=c_w; + }break; + case 2:{ + tmp-=c_sz; + /*Slide C_r down a quarter-pel. + This is the same as the horizontal filter.*/ + for(x=0;x>7,255); + } + for(;y>7,255); + } + for(;y>7,255); + } + _dst++; + tmp++; + } + }break; + } + /*For actual interlaced material, this would have to be done separately on + each field, and the shift amounts would be different. + C_r moves down 1/8, C_b up 3/8 in the top field, and C_r moves down 3/8, + C_b up 1/8 in the bottom field. + The corresponding filters would be: + Down 1/8 (reverse order for up): [3 -11 125 15 -4 0]/128 + Down 3/8 (reverse order for up): [4 -19 98 56 -13 2]/128*/ + } +} + +/*422jpeg chroma samples are sited like: + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + Y---BR--Y-------Y---BR--Y------- + | | | | + | | | | + | | | | + + 411 chroma samples are sited like: + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + YBR-----Y-------Y-------Y------- + | | | | + | | | | + | | | | + + We use a filter to resample at site locations one eighth pixel (at the source + chroma plane's horizontal resolution) and five eighths of a pixel to the + right.*/ +static void y4m_convert_411_422jpeg(unsigned char *_dst, + unsigned char *_aux){ + int c_w; + int dst_c_w; + int c_h; + int pli; + int y; + int x; + /*Skip past the luma data.*/ + _dst+=pic_w*pic_h; + /*Compute the size of each chroma plane.*/ + c_w=(pic_w+src_c_dec_h-1)/src_c_dec_h; + dst_c_w=(pic_w+dst_c_dec_h-1)/dst_c_dec_h; + c_h=(pic_h+dst_c_dec_v-1)/dst_c_dec_v; + for(pli=1;pli<3;pli++){ + for(y=0;y>7,255); + _dst[x<<1|1]=(unsigned char)OC_CLAMPI(0,47*_aux[0]+ + 86*_aux[OC_MINI(1,c_w-1)]-5*_aux[OC_MINI(2,c_w-1)]+64>>7,255); + } + for(;x>7,255); + _dst[x<<1|1]=(unsigned char)OC_CLAMPI(0,-3*_aux[x-1]+50*_aux[x]+ + 86*_aux[x+1]-5*_aux[x+2]+64>>7,255); + } + for(;x>7,255); + if((x<<1|1)>7,255); + } + } + _dst+=dst_c_w; + _aux+=c_w; + } + } +} + +/*The image is padded with empty chroma components at 4:2:0. + This costs about 17 bits a frame to code.*/ +static void y4m_convert_mono_420jpeg(unsigned char *_dst, + unsigned char *_aux){ + int c_sz; + _dst+=pic_w*pic_h; + c_sz=((pic_w+dst_c_dec_h-1)/dst_c_dec_h)*((pic_h+dst_c_dec_v-1)/dst_c_dec_v); + memset(_dst,128,c_sz*2); +} + +#if 0 +/*Right now just 444 to 420. + Not too hard to generalize.*/ +static void y4m_convert_4xxjpeg_42xjpeg(unsigned char *_dst, + unsigned char *_aux){ + unsigned char *tmp; + int c_w; + int c_h; + int pic_sz; + int tmp_sz; + int c_sz; + int pli; + int y; + int x; + /*Compute the size of each chroma plane.*/ + c_w=(pic_w+dst_c_dec_h-1)/dst_c_dec_h; + c_h=(pic_h+dst_c_dec_v-1)/dst_c_dec_v; + pic_sz=pic_w*pic_h; + tmp_sz=c_w*pic_h; + c_sz=c_w*c_h; + _dst+=pic_sz; + for(pli=1;pli<3;pli++){ + tmp=_aux+pic_sz; + /*In reality, the horizontal and vertical steps could be pipelined, for + less memory consumption and better cache performance, but we do them + separately for simplicity.*/ + /*First do horizontal filtering (convert to 4:2:2)*/ + /*Filter: [3 -17 78 78 -17 3]/128, derived from a 6-tap Lanczos window.*/ + for(y=0;y>1]=OC_CLAMPI(0,64*_aux[0]+78*_aux[OC_MINI(1,pic_w-1)]- + 17*_aux[OC_MINI(2,pic_w-1)]+3*_aux[OC_MINI(3,pic_w-1)]+64>>7,255); + } + for(;x>1]=OC_CLAMPI(0,3*(_aux[x-2]+_aux[x+3])-17*(_aux[x-1]+_aux[x+2])+ + 78*(_aux[x]+_aux[x+1])+64>>7,255); + } + for(;x>1]=OC_CLAMPI(0,3*(_aux[x-2]+_aux[pic_w-1])- + 17*(_aux[x-1]+_aux[OC_MINI(x+2,pic_w-1)])+ + 78*(_aux[x]+_aux[OC_MINI(x+1,pic_w-1)])+64>>7,255); + } + tmp+=c_w; + _aux+=pic_w; + } + _aux-=pic_sz; + tmp-=tmp_sz; + /*Now do the vertical filtering.*/ + for(x=0;x>1)*c_w]=OC_CLAMPI(0,64*tmp[0]+78*tmp[OC_MINI(1,pic_h-1)*c_w]- + 17*tmp[OC_MINI(2,pic_h-1)*c_w]+3*tmp[OC_MINI(3,pic_h-1)*c_w]+ + 64>>7,255); + } + for(;y>1)*c_w]=OC_CLAMPI(0,3*(tmp[(y-2)*c_w]+tmp[(y+3)*c_w])- + 17*(tmp[(y-1)*c_w]+tmp[(y+2)*c_w])+78*(tmp[y*c_w]+tmp[(y+1)*c_w])+ + 64>>7,255); + } + for(;y>1)*c_w]=OC_CLAMPI(0,3*(tmp[(y-2)*c_w]+tmp[(pic_h-1)*c_w])- + 17*(tmp[(y-1)*c_w]+tmp[OC_MINI(y+2,pic_h-1)*c_w])+ + 78*(tmp[y*c_w]+tmp[OC_MINI(y+1,pic_h-1)*c_w])+64>>7,255); + } + tmp++; + _dst++; + } + _dst-=c_w; + } +} +#endif + + +/*No conversion function needed.*/ +static void y4m_convert_null(unsigned char *_dst, + unsigned char *_aux){ +} + +static void id_file(char *f){ + FILE *test; + unsigned char buffer[80]; + int ret; + + /* open it, look for magic */ + + if(!strcmp(f,"-")){ + /* stdin */ + test=stdin; + }else{ + test=fopen(f,"rb"); + if(!test){ + fprintf(stderr,"Unable to open file %s.\n",f); + exit(1); + } + } + + ret=fread(buffer,1,4,test); + if(ret<4){ + fprintf(stderr,"EOF determining file type of file %s.\n",f); + exit(1); + } + + if(!memcmp(buffer,"RIFF",4)){ + /* possible WAV file */ + + if(audio){ + /* umm, we already have one */ + fprintf(stderr,"Multiple RIFF WAVE files specified on command line.\n"); + exit(1); + } + + /* Parse the rest of the header */ + + ret=fread(buffer,1,8,test); + if(ret<8)goto riff_err; + if(!memcmp(buffer+4,"WAVE",4)){ + + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("fmt",buffer,3)){ + + /* OK, this is our audio specs chunk. Slurp it up. */ + + ret=fread(buffer,1,20,test); + if(ret<20)goto riff_err; + + if(memcmp(buffer+4,"\001\000",2)){ + fprintf(stderr,"The WAV file %s is in a compressed format; " + "can't read it.\n",f); + exit(1); + } + + audio=test; + audio_ch=buffer[6]+(buffer[7]<<8); + audio_hz=buffer[8]+(buffer[9]<<8)+ + (buffer[10]<<16)+(buffer[11]<<24); + + if(buffer[18]+(buffer[19]<<8)!=16){ + fprintf(stderr,"Can only read 16 bit WAV files for now.\n"); + exit(1); + } + + /* Now, align things to the beginning of the data */ + /* Look for 'dataxxxx' */ + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("data",buffer,4)){ + /* We're there. Ignore the declared size for now. */ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + + fprintf(stderr,"File %s is 16 bit %d channel %d Hz RIFF WAV audio.\n", + f,audio_ch,audio_hz); + + return; + } + } + } + } + } + + fprintf(stderr,"Couldn't find WAVE data in RIFF file %s.\n",f); + exit(1); + + } + if(!memcmp(buffer,"YUV4",4)){ + /* possible YUV2MPEG2 format file */ + /* read until newline, or 80 cols, whichever happens first */ + int i; + for(i=0;i<79;i++){ + ret=fread(buffer+i,1,1,test); + if(ret<1)goto yuv_err; + if(buffer[i]=='\n')break; + } + if(i==79){ + fprintf(stderr,"Error parsing %s header; not a YUV2MPEG2 file?\n",f); + } + buffer[i]='\0'; + + if(!memcmp(buffer,"MPEG",4)){ + + if(video){ + /* umm, we already have one */ + fprintf(stderr,"Multiple video files specified on command line.\n"); + exit(1); + } + + if(buffer[4]!='2'){ + fprintf(stderr,"Incorrect YUV input file version; YUV4MPEG2 required.\n"); + } + + ret=y4m_parse_tags((char *)buffer+5); + if(ret<0){ + fprintf(stderr,"Error parsing YUV4MPEG2 header in file %s.\n",f); + exit(1); + } + + if(interlace!='p'){ + fprintf(stderr,"Input video is interlaced; Theora handles only progressive scan\n"); + exit(1); + } + + if(strcmp(chroma_type,"420")==0||strcmp(chroma_type,"420jpeg")==0){ + src_c_dec_h=dst_c_dec_h=src_c_dec_v=dst_c_dec_v=2; + y4m_dst_buf_read_sz=pic_w*pic_h+2*((pic_w+1)/2)*((pic_h+1)/2); + /*Natively supported: no conversion required.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=0; + y4m_convert=y4m_convert_null; + } + else if(strcmp(chroma_type,"420mpeg2")==0){ + src_c_dec_h=dst_c_dec_h=src_c_dec_v=dst_c_dec_v=2; + y4m_dst_buf_read_sz=pic_w*pic_h; + /*Chroma filter required: read into the aux buf first.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=2*((pic_w+1)/2)*((pic_h+1)/2); + y4m_convert=y4m_convert_42xmpeg2_42xjpeg; + } + else if(strcmp(chroma_type,"420paldv")==0){ + src_c_dec_h=dst_c_dec_h=src_c_dec_v=dst_c_dec_v=2; + y4m_dst_buf_read_sz=pic_w*pic_h; + /*Chroma filter required: read into the aux buf first. + We need to make two filter passes, so we need some extra space in the + aux buffer.*/ + y4m_aux_buf_sz=3*((pic_w+1)/2)*((pic_h+1)/2); + y4m_aux_buf_read_sz=2*((pic_w+1)/2)*((pic_h+1)/2); + y4m_convert=y4m_convert_42xpaldv_42xjpeg; + } + else if(strcmp(chroma_type,"422")==0){ + src_c_dec_h=dst_c_dec_h=2; + src_c_dec_v=dst_c_dec_v=1; + y4m_dst_buf_read_sz=pic_w*pic_h; + /*Chroma filter required: read into the aux buf first.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=2*((pic_w+1)/2)*pic_h; + y4m_convert=y4m_convert_42xmpeg2_42xjpeg; + } + else if(strcmp(chroma_type,"422jpeg")==0){ + src_c_dec_h=dst_c_dec_h=2; + src_c_dec_v=dst_c_dec_v=1; + y4m_dst_buf_read_sz=pic_w*pic_h+2*((pic_w+1)/2)*pic_h; + /*Natively supported: no conversion required.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=0; + y4m_convert=y4m_convert_null; + } + else if(strcmp(chroma_type,"411")==0){ + src_c_dec_h=4; + /*We don't want to introduce any additional sub-sampling, so we + promote 4:1:1 material to 4:2:2, as the closest format Theora can + handle.*/ + dst_c_dec_h=2; + src_c_dec_v=dst_c_dec_v=1; + y4m_dst_buf_read_sz=pic_w*pic_h; + /*Chroma filter required: read into the aux buf first.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=2*((pic_w+3)/4)*pic_h; + y4m_convert=y4m_convert_411_422jpeg; + } + else if(strcmp(chroma_type,"444")==0){ + src_c_dec_h=dst_c_dec_h=src_c_dec_v=dst_c_dec_v=1; + y4m_dst_buf_read_sz=pic_w*pic_h*3; + y4m_aux_buf_sz=y4m_aux_buf_read_sz=0; + y4m_convert=y4m_convert_null; + } + else if(strcmp(chroma_type,"444alpha")==0){ + src_c_dec_h=dst_c_dec_h=src_c_dec_v=dst_c_dec_v=1; + y4m_dst_buf_read_sz=pic_w*pic_h*3; + /*Read the extra alpha plane into the aux buf. + It will be discarded.*/ + y4m_aux_buf_sz=y4m_aux_buf_read_sz=pic_w*pic_h; + y4m_convert=y4m_convert_null; + } + else if(strcmp(chroma_type,"mono")==0){ + src_c_dec_h=src_c_dec_v=0; + dst_c_dec_h=dst_c_dec_v=2; + y4m_dst_buf_read_sz=pic_w*pic_h; + y4m_aux_buf_sz=y4m_aux_buf_read_sz=0; + y4m_convert=y4m_convert_mono_420jpeg; + } + else{ + fprintf(stderr,"Unknown chroma sampling type: %s\n",chroma_type); + exit(1); + } + /*The size of the final frame buffers is always computed from the + destination chroma decimation type.*/ + y4m_dst_buf_sz=pic_w*pic_h+2*((pic_w+dst_c_dec_h-1)/dst_c_dec_h)* + ((pic_h+dst_c_dec_v-1)/dst_c_dec_v); + + video=test; + + fprintf(stderr,"File %s is %dx%d %.02f fps %s video.\n", + f,pic_w,pic_h,(double)video_fps_n/video_fps_d,chroma_type); + + return; + } + } + fprintf(stderr,"Input file %s is neither a WAV nor YUV4MPEG2 file.\n",f); + exit(1); + + riff_err: + fprintf(stderr,"EOF parsing RIFF file %s.\n",f); + exit(1); + yuv_err: + fprintf(stderr,"EOF parsing YUV4MPEG2 file %s.\n",f); + exit(1); + +} + +int spinner=0; +char *spinascii="|/-\\"; +void spinnit(void){ + spinner++; + if(spinner==4)spinner=0; + fprintf(stderr,"\r%c",spinascii[spinner]); +} + +int fetch_and_process_audio(FILE *audio,ogg_page *audiopage, + ogg_stream_state *vo, + vorbis_dsp_state *vd, + vorbis_block *vb, + int audioflag){ + static ogg_int64_t samples_sofar=0; + ogg_packet op; + int i,j; + ogg_int64_t beginsample = audio_hz*begin_sec + audio_hz*begin_usec*.000001; + ogg_int64_t endsample = audio_hz*end_sec + audio_hz*end_usec*.000001; + + while(audio && !audioflag){ + /* process any audio already buffered */ + spinnit(); + if(ogg_stream_pageout(vo,audiopage)>0) return 1; + if(ogg_stream_eos(vo))return 0; + + { + /* read and process more audio */ + signed char readbuffer[4096]; + signed char *readptr=readbuffer; + int toread=4096/2/audio_ch; + int bytesread=fread(readbuffer,1,toread*2*audio_ch,audio); + int sampread=bytesread/2/audio_ch; + float **vorbis_buffer; + int count=0; + + if(bytesread<=0 || + (samples_sofar>=endsample && endsample>0)){ + /* end of file. this can be done implicitly, but it's + easier to see here in non-clever fashion. Tell the + library we're at end of stream so that it can handle the + last frame and mark end of stream in the output properly */ + vorbis_analysis_wrote(vd,0); + }else{ + if(samples_sofar < beginsample){ + if(samples_sofar+sampread > beginsample){ + readptr += (beginsample-samples_sofar)*2*audio_ch; + sampread += samples_sofar-beginsample; + samples_sofar = sampread+beginsample; + }else{ + samples_sofar += sampread; + sampread = 0; + } + }else{ + samples_sofar += sampread; + } + + if(samples_sofar > endsample && endsample > 0) + sampread-= (samples_sofar - endsample); + + if(sampread>0){ + + vorbis_buffer=vorbis_analysis_buffer(vd,sampread); + /* uninterleave samples */ + for(i=0;i=beginframe) + frame_state++; + } + /* check to see if there are dupes to flush */ + if(th_encode_packetout(td,frame_state<1,op)>0)return 1; + if(frame_state<1){ + /* can't get here unless YUV4MPEG stream has no video */ + fprintf(stderr,"Video input contains no frames.\n"); + exit(1); + } + /* Theora is a one-frame-in,one-frame-out system; submit a frame + for compression and pull out the packet */ + /* in two-pass mode's second pass, we need to submit first-pass data */ + if(passno==2){ + for(;;){ + static unsigned char buffer[80]; + static int buf_pos; + int bytes; + /*Ask the encoder how many bytes it would like.*/ + bytes=th_encode_ctl(td,TH_ENCCTL_2PASS_IN,NULL,0); + if(bytes<0){ + fprintf(stderr,"Error submitting pass data in second pass.\n"); + exit(1); + } + /*If it's got enough, stop.*/ + if(bytes==0)break; + /*Read in some more bytes, if necessary.*/ + if(bytes>80-buf_pos)bytes=80-buf_pos; + if(bytes>0&&fread(buffer+buf_pos,1,bytes,twopass_file)=bytes)buf_pos=0; + /*Otherwise remember how much it used.*/ + else buf_pos+=ret; + } + } + /*We submit the buffer using the size of the picture region. + libtheora will pad the picture region out to the full frame size for us, + whether we pass in a full frame or not.*/ + ycbcr[0].width=pic_w; + ycbcr[0].height=pic_h; + ycbcr[0].stride=pic_w; + ycbcr[0].data=yuvframe[0]; + ycbcr[1].width=c_w; + ycbcr[1].height=c_h; + ycbcr[1].stride=c_w; + ycbcr[1].data=yuvframe[0]+pic_sz; + ycbcr[2].width=c_w; + ycbcr[2].height=c_h; + ycbcr[2].stride=c_w; + ycbcr[2].data=yuvframe[0]+pic_sz+c_sz; + th_encode_ycbcr_in(td,ycbcr); + { + unsigned char *temp=yuvframe[0]; + yuvframe[0]=yuvframe[1]; + yuvframe[1]=temp; + frame_state--; + } + /* in two-pass mode's first pass we need to extract and save the pass data */ + if(passno==1){ + unsigned char *buffer; + int bytes = th_encode_ctl(td, TH_ENCCTL_2PASS_OUT, &buffer, sizeof(buffer)); + if(bytes<0){ + fprintf(stderr,"Could not read two-pass data from encoder.\n"); + exit(1); + } + if(fwrite(buffer,1,bytes,twopass_file)0) return 1; + if(ogg_stream_eos(to)) return 0; + ret=fetch_and_process_video_packet(video,twopass_file,passno,td,&op); + if(ret<=0)return 0; + ogg_stream_packetin(to,&op); + } + return videoflag; +} + +static int ilog(unsigned _v){ + int ret; + for(ret=0;_v;ret++)_v>>=1; + return ret; +} + +int main(int argc,char *argv[]){ + int c,long_option_index,ret; + + ogg_stream_state to; /* take physical pages, weld into a logical + stream of packets */ + ogg_stream_state vo; /* take physical pages, weld into a logical + stream of packets */ + ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ + ogg_packet op; /* one raw packet of data for decode */ + + th_enc_ctx *td; + th_info ti; + th_comment tc; + + vorbis_info vi; /* struct that stores all the static vorbis bitstream + settings */ + vorbis_comment vc; /* struct that stores all the user comments */ + + vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ + vorbis_block vb; /* local working space for packet->PCM decode */ + + int speed=-1; + int audioflag=0; + int videoflag=0; + int akbps=0; + int vkbps=0; + int soft_target=0; + + ogg_int64_t audio_bytesout=0; + ogg_int64_t video_bytesout=0; + double timebase; + + FILE *outfile = stdout; + + FILE *twopass_file = NULL; + fpos_t video_rewind_pos; + int twopass=0; + int passno; + +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ + /* if we were reading/writing a file, it would also need to in + binary mode, eg, fopen("file.wav","wb"); */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + + while((c=getopt_long(argc,argv,optstring,options,&long_option_index))!=EOF){ + switch(c){ + case 'o': + outfile=fopen(optarg,"wb"); + if(outfile==NULL){ + fprintf(stderr,"Unable to open output file '%s'\n", optarg); + exit(1); + } + break;; + + case 'a': + audio_q=(float)(atof(optarg)*.099); + if(audio_q<-.1 || audio_q>1){ + fprintf(stderr,"Illegal audio quality (choose -1 through 10)\n"); + exit(1); + } + audio_r=-1; + break; + + case 'v': + video_q=(int)rint(6.3*atof(optarg)); + if(video_q<0 || video_q>63){ + fprintf(stderr,"Illegal video quality (choose 0 through 10)\n"); + exit(1); + } + break; + + case 'A': + audio_r=(int)(atof(optarg)*1000); + if(audio_q<0){ + fprintf(stderr,"Illegal audio quality (choose > 0 please)\n"); + exit(1); + } + audio_q=-99; + break; + + case 'V': + video_r=(int)rint(atof(optarg)*1000); + if(video_r<1){ + fprintf(stderr,"Illegal video bitrate (choose > 0 please)\n"); + exit(1); + } + break; + + case '\1': + soft_target=1; + break; + + case 's': + video_par_n=(int)rint(atof(optarg)); + break; + + case 'S': + video_par_d=(int)rint(atof(optarg)); + break; + + case 'f': + video_fps_n=(int)rint(atof(optarg)); + break; + + case 'F': + video_fps_d=(int)rint(atof(optarg)); + break; + + case 'c': + vp3_compatible=1; + break; + + case 'k': + keyframe_frequency=rint(atof(optarg)); + if(keyframe_frequency<1 || keyframe_frequency>2147483647){ + fprintf(stderr,"Illegal keyframe frequency\n"); + exit(1); + } + break; + + case 'd': + buf_delay=atoi(optarg); + if(buf_delay<=0){ + fprintf(stderr,"Illegal buffer delay\n"); + exit(1); + } + break; + + case 'z': + speed=atoi(optarg); + if(speed<0){ + fprintf(stderr,"Illegal speed level\n"); + exit(1); + } + break; + + case 'b': + { + char *pos=strchr(optarg,':'); + begin_sec=atol(optarg); + if(pos){ + char *pos2=strchr(++pos,':'); + begin_sec*=60; + begin_sec+=atol(pos); + if(pos2){ + pos2++; + begin_sec*=60; + begin_sec+=atol(pos2); + pos=pos2; + } + }else + pos=optarg; + pos=strchr(pos,'.'); + if(pos){ + int digits = strlen(++pos); + begin_usec=atol(pos); + while(digits++ < 6) + begin_usec*=10; + } + } + break; + case 'e': + { + char *pos=strchr(optarg,':'); + end_sec=atol(optarg); + if(pos){ + char *pos2=strchr(++pos,':'); + end_sec*=60; + end_sec+=atol(pos); + if(pos2){ + pos2++; + end_sec*=60; + end_sec+=atol(pos2); + pos=pos2; + } + }else + pos=optarg; + pos=strchr(pos,'.'); + if(pos){ + int digits = strlen(++pos); + end_usec=atol(pos); + while(digits++ < 6) + end_usec*=10; + } + } + break; + case '\2': + twopass=3; /* perform both passes */ + twopass_file=tmpfile(); + if(!twopass_file){ + fprintf(stderr,"Unable to open temporary file for twopass data\n"); + exit(1); + } + break; + case '\3': + twopass=1; /* perform first pass */ + twopass_file=fopen(optarg,"wb"); + if(!twopass_file){ + fprintf(stderr,"Unable to open \'%s\' for twopass data\n",optarg); + exit(1); + } + break; + case '\4': + twopass=2; /* perform second pass */ + twopass_file=fopen(optarg,"rb"); + if(!twopass_file){ + fprintf(stderr,"Unable to open twopass data file \'%s\'",optarg); + exit(1); + } + break; + + default: + usage(); + } + } + + if(soft_target){ + if(video_r<=0){ + fprintf(stderr,"Soft rate target (--soft-target) requested without a bitrate (-V).\n"); + exit(1); + } + if(video_q==-1) + video_q=0; + }else{ + if(video_q==-1){ + if(video_r>0) + video_q=0; + else + video_q=48; + } + } + + if(keyframe_frequency<=0){ + /*Use a default keyframe frequency of 64 for 1-pass (streaming) mode, and + 256 for two-pass mode.*/ + keyframe_frequency=twopass?256:64; + } + + while(optind-99) + ret = vorbis_encode_init_vbr(&vi,audio_ch,audio_hz,audio_q); + else + ret = vorbis_encode_init(&vi,audio_ch,audio_hz,-1, + (int)(64870*(ogg_int64_t)audio_r>>16),-1); + if(ret){ + fprintf(stderr,"The Vorbis encoder could not set up a mode according to\n" + "the requested quality or bitrate.\n\n"); + exit(1); + } + + vorbis_comment_init(&vc); + vorbis_analysis_init(&vd,&vi); + vorbis_block_init(&vd,&vb); + } + + for(passno=(twopass==3?1:twopass);passno<=(twopass==3?2:twopass);passno++){ + /* Set up Theora encoder */ + if(!video){ + fprintf(stderr,"No video files submitted for compression?\n"); + exit(1); + } + /* Theora has a divisible-by-sixteen restriction for the encoded frame size */ + /* scale the picture size up to the nearest /16 and calculate offsets */ + frame_w=pic_w+15&~0xF; + frame_h=pic_h+15&~0xF; + /*Force the offsets to be even so that chroma samples line up like we + expect.*/ + pic_x=frame_w-pic_w>>1&~1; + pic_y=frame_h-pic_h>>1&~1; + th_info_init(&ti); + ti.frame_width=frame_w; + ti.frame_height=frame_h; + ti.pic_width=pic_w; + ti.pic_height=pic_h; + ti.pic_x=pic_x; + ti.pic_y=pic_y; + ti.fps_numerator=video_fps_n; + ti.fps_denominator=video_fps_d; + ti.aspect_numerator=video_par_n; + ti.aspect_denominator=video_par_d; + ti.colorspace=TH_CS_UNSPECIFIED; + /*Account for the Ogg page overhead. + This is 1 byte per 255 for lacing values, plus 26 bytes per 4096 bytes for + the page header, plus approximately 1/2 byte per packet (not accounted for + here).*/ + ti.target_bitrate=(int)(64870*(ogg_int64_t)video_r>>16); + ti.quality=video_q; + ti.keyframe_granule_shift=ilog(keyframe_frequency-1); + if(dst_c_dec_h==2){ + if(dst_c_dec_v==2)ti.pixel_fmt=TH_PF_420; + else ti.pixel_fmt=TH_PF_422; + } + else ti.pixel_fmt=TH_PF_444; + td=th_encode_alloc(&ti); + th_info_clear(&ti); + /* setting just the granule shift only allows power-of-two keyframe + spacing. Set the actual requested spacing. */ + ret=th_encode_ctl(td,TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, + &keyframe_frequency,sizeof(keyframe_frequency-1)); + if(ret<0){ + fprintf(stderr,"Could not set keyframe interval to %d.\n",(int)keyframe_frequency); + } + if(vp3_compatible){ + ret=th_encode_ctl(td,TH_ENCCTL_SET_VP3_COMPATIBLE,&vp3_compatible, + sizeof(vp3_compatible)); + if(ret<0||!vp3_compatible){ + fprintf(stderr,"Could not enable strict VP3 compatibility.\n"); + if(ret>=0){ + fprintf(stderr,"Ensure your source format is supported by VP3.\n"); + fprintf(stderr, + "(4:2:0 pixel format, width and height multiples of 16).\n"); + } + } + } + if(soft_target){ + /* reverse the rate control flags to favor a 'long time' strategy */ + int arg = TH_RATECTL_CAP_UNDERFLOW; + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_FLAGS,&arg,sizeof(arg)); + if(ret<0) + fprintf(stderr,"Could not set encoder flags for --soft-target\n"); + /* Default buffer control is overridden on two-pass */ + if(!twopass&&buf_delay<0){ + if((keyframe_frequency*7>>1) > 5*video_fps_n/video_fps_d) + arg=keyframe_frequency*7>>1; + else + arg=5*video_fps_n/video_fps_d; + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_BUFFER,&arg,sizeof(arg)); + if(ret<0) + fprintf(stderr,"Could not set rate control buffer for --soft-target\n"); + } + } + /* set up two-pass if needed */ + if(passno==1){ + unsigned char *buffer; + int bytes; + bytes=th_encode_ctl(td,TH_ENCCTL_2PASS_OUT,&buffer,sizeof(buffer)); + if(bytes<0){ + fprintf(stderr,"Could not set up the first pass of two-pass mode.\n"); + fprintf(stderr,"Did you remember to specify an estimated bitrate?\n"); + exit(1); + } + /*Perform a seek test to ensure we can overwrite this placeholder data at + the end; this is better than letting the user sit through a whole + encode only to find out their pass 1 file is useless at the end.*/ + if(fseek(twopass_file,0,SEEK_SET)<0){ + fprintf(stderr,"Unable to seek in two-pass data file.\n"); + exit(1); + } + if(fwrite(buffer,1,bytes,twopass_file)=0){ + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_BUFFER, + &buf_delay,sizeof(buf_delay)); + if(ret<0){ + fprintf(stderr,"Warning: could not set desired buffer delay.\n"); + } + } + /*Speed should also be set after the current encoder mode is established, + since the available speed levels may change depending.*/ + if(speed>=0){ + int speed_max; + int ret; + ret=th_encode_ctl(td,TH_ENCCTL_GET_SPLEVEL_MAX, + &speed_max,sizeof(speed_max)); + if(ret<0){ + fprintf(stderr,"Warning: could not determine maximum speed level.\n"); + speed_max=0; + } + ret=th_encode_ctl(td,TH_ENCCTL_SET_SPLEVEL,&speed,sizeof(speed)); + if(ret<0){ + fprintf(stderr,"Warning: could not set speed level to %i of %i\n", + speed,speed_max); + if(speed>speed_max){ + fprintf(stderr,"Setting it to %i instead\n",speed_max); + } + ret=th_encode_ctl(td,TH_ENCCTL_SET_SPLEVEL, + &speed_max,sizeof(speed_max)); + if(ret<0){ + fprintf(stderr,"Warning: could not set speed level to %i of %i\n", + speed_max,speed_max); + } + } + } + /* write the bitstream header packets with proper page interleave */ + th_comment_init(&tc); + /* first packet will get its own page automatically */ + if(th_encode_flushheader(td,&tc,&op)<=0){ + fprintf(stderr,"Internal Theora library error.\n"); + exit(1); + } + if(passno!=1){ + ogg_stream_packetin(&to,&op); + if(ogg_stream_pageout(&to,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + /* create the remaining theora headers */ + for(;;){ + ret=th_encode_flushheader(td,&tc,&op); + if(ret<0){ + fprintf(stderr,"Internal Theora library error.\n"); + exit(1); + } + else if(!ret)break; + if(passno!=1)ogg_stream_packetin(&to,&op); + } + if(audio && passno!=1){ + ogg_packet header; + ogg_packet header_comm; + ogg_packet header_code; + vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); + ogg_stream_packetin(&vo,&header); /* automatically placed in its own + page */ + if(ogg_stream_pageout(&vo,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + /* remaining vorbis header packets */ + ogg_stream_packetin(&vo,&header_comm); + ogg_stream_packetin(&vo,&header_code); + } + /* Flush the rest of our headers. This ensures + the actual data in each stream will start + on a new page, as per spec. */ + if(passno!=1){ + for(;;){ + int result = ogg_stream_flush(&to,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + } + if(audio && passno!=1){ + for(;;){ + int result=ogg_stream_flush(&vo,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + } + /* setup complete. Raw processing loop */ + switch(passno){ + case 0: case 2: + fprintf(stderr,"\rCompressing.... \n"); + break; + case 1: + fprintf(stderr,"\rScanning first pass.... \n"); + break; + } + for(;;){ + int audio_or_video=-1; + if(passno==1){ + ogg_packet op; + int ret=fetch_and_process_video_packet(video,twopass_file,passno,td,&op); + if(ret<0)break; + if(op.e_o_s)break; /* end of stream */ + timebase=th_granule_time(td,op.granulepos); + audio_or_video=1; + }else{ + double audiotime; + double videotime; + ogg_page audiopage; + ogg_page videopage; + /* is there an audio page flushed? If not, fetch one if possible */ + audioflag=fetch_and_process_audio(audio,&audiopage,&vo,&vd,&vb,audioflag); + /* is there a video page flushed? If not, fetch one if possible */ + videoflag=fetch_and_process_video(video,&videopage,&to,td,twopass_file,passno,videoflag); + /* no pages of either? Must be end of stream. */ + if(!audioflag && !videoflag)break; + /* which is earlier; the end of the audio page or the end of the + video page? Flush the earlier to stream */ + audiotime= + audioflag?vorbis_granule_time(&vd,ogg_page_granulepos(&audiopage)):-1; + videotime= + videoflag?th_granule_time(td,ogg_page_granulepos(&videopage)):-1; + if(!audioflag){ + audio_or_video=1; + } else if(!videoflag) { + audio_or_video=0; + } else { + if(audiotime 0){ + int hundredths=(int)(timebase*100-(long)timebase*100); + int seconds=(long)timebase%60; + int minutes=((long)timebase/60)%60; + int hours=(long)timebase/3600; + if(audio_or_video)vkbps=(int)rint(video_bytesout*8./timebase*.001); + else akbps=(int)rint(audio_bytesout*8./timebase*.001); + fprintf(stderr, + "\r %d:%02d:%02d.%02d audio: %dkbps video: %dkbps ", + hours,minutes,seconds,hundredths,akbps,vkbps); + } + } + if(video)th_encode_free(td); + } + + /* clear out state */ + if(audio && twopass!=1){ + ogg_stream_clear(&vo); + vorbis_block_clear(&vb); + vorbis_dsp_clear(&vd); + vorbis_comment_clear(&vc); + vorbis_info_clear(&vi); + if(audio!=stdin)fclose(audio); + } + if(video){ + ogg_stream_clear(&to); + th_comment_clear(&tc); + if(video!=stdin)fclose(video); + } + + if(outfile && outfile!=stdout)fclose(outfile); + if(twopass_file)fclose(twopass_file); + + fprintf(stderr,"\r \ndone.\n\n"); + + return(0); + +} diff --git a/libs/libtheora-1.1/examples/getopt.c b/libs/libtheora-1.1/examples/getopt.c new file mode 100644 index 00000000..b75e3c62 --- /dev/null +++ b/libs/libtheora-1.1/examples/getopt.c @@ -0,0 +1,1055 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. */ +# if defined HAVE_LIBINTL_H || defined _LIBC +# include +# ifndef _ +# define _(msgid) gettext (msgid) +# endif +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +# if HAVE_STRING_H +# include +# else +# include +# endif + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +extern char *getenv (); +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (posixly_correct == NULL + && argc == __libc_argc && argv == __libc_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int print_errors = opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (print_errors) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/libs/libtheora-1.1/examples/getopt.h b/libs/libtheora-1.1/examples/getopt.h new file mode 100644 index 00000000..74d0d2b6 --- /dev/null +++ b/libs/libtheora-1.1/examples/getopt.h @@ -0,0 +1,180 @@ +/* Declarations for getopt. + Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if (defined __STDC__ && __STDC__) || defined __cplusplus + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if (defined __STDC__ && __STDC__) || defined __cplusplus +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/libs/libtheora-1.1/examples/getopt1.c b/libs/libtheora-1.1/examples/getopt1.c new file mode 100644 index 00000000..15448919 --- /dev/null +++ b/libs/libtheora-1.1/examples/getopt1.c @@ -0,0 +1,188 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "getopt.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/libs/libtheora-1.1/examples/player_example.c b/libs/libtheora-1.1/examples/player_example.c new file mode 100644 index 00000000..60a81435 --- /dev/null +++ b/libs/libtheora-1.1/examples/player_example.c @@ -0,0 +1,887 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: example SDL player application; plays Ogg Theora files (with + optional Vorbis audio second stream) + last mod: $Id: player_example.c 17974 2011-05-07 22:31:49Z giles $ + + ********************************************************************/ + +/* far more complex than most Ogg 'example' programs. The complexity + of maintaining A/V sync is pretty much unavoidable. It's necessary + to actually have audio/video playback to make the hard audio clock + sync actually work. If there's audio playback, there might as well + be simple video playback as well... + + A simple 'demux and write back streams' would have been easier, + it's true. */ + +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE +#endif +#if !defined(_LARGEFILE_SOURCE) +#define _LARGEFILE_SOURCE +#endif +#if !defined(_LARGEFILE64_SOURCE) +#define _LARGEFILE64_SOURCE +#endif +#if !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifndef _REENTRANT +# define _REENTRANT +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "theora/theoradec.h" +#include "vorbis/codec.h" +#include + +/* yes, this makes us OSS-specific for now. None of SDL, libao, libao2 + give us any way to determine hardware timing, and since the + hard/kernel buffer is going to be most of or > a second, that's + just a little bit important */ +#if defined(__FreeBSD__) +#include +#define AUDIO_DEVICE "/dev/audio" +#elif defined(__NetBSD__) || defined(__OpenBSD__) +#include +#define AUDIO_DEVICE "/dev/audio" +#else +#include +#define AUDIO_DEVICE "/dev/dsp" +#endif +#include + +/* Helper; just grab some more compressed bitstream and sync it for + page extraction */ +int buffer_data(FILE *in,ogg_sync_state *oy){ + char *buffer=ogg_sync_buffer(oy,4096); + int bytes=fread(buffer,1,4096,in); + ogg_sync_wrote(oy,bytes); + return(bytes); +} + +/* never forget that globals are a one-way ticket to Hell */ +/* Ogg and codec state for demux/decode */ +ogg_sync_state oy; +ogg_page og; +ogg_stream_state vo; +ogg_stream_state to; +th_info ti; +th_comment tc; +th_dec_ctx *td; +th_setup_info *ts; +vorbis_info vi; +vorbis_dsp_state vd; +vorbis_block vb; +vorbis_comment vc; +th_pixel_fmt px_fmt; + +int theora_p=0; +int vorbis_p=0; +int stateflag=0; + +/* SDL Video playback structures */ +SDL_Surface *screen; +SDL_Overlay *yuv_overlay; +SDL_Rect rect; +unsigned char *RGBbuffer; + +#define OC_CLAMP255(_x) ((unsigned char)((((_x)<0)-1)&((_x)|-((_x)>255)))) + +/* single frame video buffering */ +int videobuf_ready=0; +ogg_int64_t videobuf_granulepos=-1; +double videobuf_time=0; + +/* single audio fragment audio buffering */ +int audiobuf_fill=0; +int audiobuf_ready=0; +ogg_int16_t *audiobuf; +ogg_int64_t audiobuf_granulepos=0; /* time position of last sample */ + +/* audio / video synchronization tracking: + +Since this will make it to Google at some point and lots of people +search for how to do this, a quick rundown of a practical A/V sync +strategy under Linux [the UNIX where Everything Is Hard]. Naturally, +this works on other platforms using OSS for sound as well. + +In OSS, we don't have reliable access to any precise information on +the exact current playback position (that, of course would have been +too easy; the kernel folks like to keep us app people working hard +doing simple things that should have been solved once and abstracted +long ago). Hopefully ALSA solves this a little better; we'll probably +use that once ALSA is the standard in the stable kernel. + +We can't use the system clock for a/v sync because audio is hard +synced to its own clock, and both the system and audio clocks suffer +from wobble, drift, and a lack of accuracy that can be guaranteed to +add a reliable percent or so of error. After ten seconds, that's +100ms. We can't drift by half a second every minute. + +Although OSS can't generally tell us where the audio playback pointer +is, we do know that if we work in complete audio fragments and keep +the kernel buffer full, a blocking select on the audio buffer will +give us a writable fragment immediately after playback finishes with +it. We assume at that point that we know the exact number of bytes in +the kernel buffer that have not been played (total fragments minus +one) and calculate clock drift between audio and system then (and only +then). Damp the sync correction fraction, apply, and walla: A +reliable A/V clock that even works if it's interrupted. */ + +long audiofd_totalsize=-1; +int audiofd_fragsize; /* read and write only complete fragments + so that SNDCTL_DSP_GETOSPACE is + accurate immediately after a bank + switch */ +int audiofd=-1; +ogg_int64_t audiofd_timer_calibrate=-1; + + +static void open_audio(){ + audio_buf_info info; + int format=AFMT_S16_NE; /* host endian */ + int channels=vi.channels; + int rate=vi.rate; + int ret; + + audiofd=open(AUDIO_DEVICE,O_RDWR); + if(audiofd<0){ + fprintf(stderr,"Could not open audio device " AUDIO_DEVICE ".\n"); + exit(1); + } + + ret=ioctl(audiofd,SNDCTL_DSP_SETFMT,&format); + if(ret){ + fprintf(stderr,"Could not set 16 bit host-endian playback\n"); + exit(1); + } + + ret=ioctl(audiofd,SNDCTL_DSP_CHANNELS,&channels); + if(ret){ + fprintf(stderr,"Could not set %d channel playback\n",channels); + exit(1); + } + + ret=ioctl(audiofd,SNDCTL_DSP_SPEED,&rate); + if(ret){ + fprintf(stderr,"Could not set %d Hz playback\n",rate); + exit(1); + } + + ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&info); + audiofd_fragsize=info.fragsize; + audiofd_totalsize=info.fragstotal*info.fragsize; + + audiobuf=malloc(audiofd_fragsize); +} + +static void audio_close(void){ + if(audiofd>-1){ + ioctl(audiofd,SNDCTL_DSP_RESET,NULL); + close(audiofd); + free(audiobuf); + } +} + +/* call this only immediately after unblocking from a full kernel + having a newly empty fragment or at the point of DMA restart */ +void audio_calibrate_timer(int restart){ + struct timeval tv; + ogg_int64_t current_sample; + ogg_int64_t new_time; + + gettimeofday(&tv,0); + new_time=tv.tv_sec*1000+tv.tv_usec/1000; + + if(restart){ + current_sample=audiobuf_granulepos-audiobuf_fill/2/vi.channels; + }else + current_sample=audiobuf_granulepos- + (audiobuf_fill+audiofd_totalsize-audiofd_fragsize)/2/vi.channels; + + new_time-=1000*current_sample/vi.rate; + + audiofd_timer_calibrate=new_time; +} + +/* get relative time since beginning playback, compensating for A/V + drift */ +double get_time(){ + static ogg_int64_t last=0; + static ogg_int64_t up=0; + ogg_int64_t now; + struct timeval tv; + + gettimeofday(&tv,0); + now=tv.tv_sec*1000+tv.tv_usec/1000; + + if(audiofd_timer_calibrate==-1)audiofd_timer_calibrate=last=now; + + if(audiofd<0){ + /* no audio timer to worry about, we can just use the system clock */ + /* only one complication: If the process is suspended, we should + reset timing to account for the gap in play time. Do it the + easy/hack way */ + if(now-last>1000)audiofd_timer_calibrate+=(now-last); + last=now; + } + + if(now-up>200){ + double timebase=(now-audiofd_timer_calibrate)*.001; + int hundredths=timebase*100-(long)timebase*100; + int seconds=(long)timebase%60; + int minutes=((long)timebase/60)%60; + int hours=(long)timebase/3600; + + fprintf(stderr," Playing: %d:%02d:%02d.%02d \r", + hours,minutes,seconds,hundredths); + up=now; + } + + return (now-audiofd_timer_calibrate)*.001; + +} + +/* write a fragment to the OSS kernel audio API, but only if we can + stuff in a whole fragment without blocking */ +void audio_write_nonblocking(void){ + + if(audiobuf_ready){ + audio_buf_info info; + long bytes; + + ioctl(audiofd,SNDCTL_DSP_GETOSPACE,&info); + bytes=info.bytes; + if(bytes>=audiofd_fragsize){ + if(bytes==audiofd_totalsize)audio_calibrate_timer(1); + + while(1){ + bytes=write(audiofd,audiobuf+(audiofd_fragsize-audiobuf_fill), + audiofd_fragsize); + + if(bytes>0){ + + if(bytes!=audiobuf_fill){ + /* shouldn't actually be possible... but eh */ + audiobuf_fill-=bytes; + }else + break; + } + } + + audiobuf_fill=0; + audiobuf_ready=0; + + } + } +} + +/* clean quit on Ctrl-C for SDL and thread shutdown as per SDL example + (we don't use any threads, but libSDL does) */ +int got_sigint=0; +static void sigint_handler (int signal) { + got_sigint = 1; +} + +static void open_video(void){ + int w; + int h; + w=(ti.pic_x+ti.pic_width+1&~1)-(ti.pic_x&~1); + h=(ti.pic_y+ti.pic_height+1&~1)-(ti.pic_y&~1); + if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { + fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); + exit(1); + } + + screen = SDL_SetVideoMode(w, h, 0, SDL_SWSURFACE); + if ( screen == NULL ) { + fprintf(stderr, "Unable to set %dx%d video: %s\n", + w,h,SDL_GetError()); + exit(1); + } + + if (px_fmt==TH_PF_422) + yuv_overlay = SDL_CreateYUVOverlay(w, h, + SDL_YUY2_OVERLAY, + screen); + else if (px_fmt==TH_PF_444) { + RGBbuffer = calloc(sizeof(char),w*h*4); + fprintf(stderr,"warning: SDL does not support YUV 4:4:4, using slow software conversion.\n"); + } else + yuv_overlay = SDL_CreateYUVOverlay(w, h, + SDL_YV12_OVERLAY, + screen); + + if ( (yuv_overlay == NULL && px_fmt!=TH_PF_444) || (screen == NULL && px_fmt==TH_PF_444) ) { + fprintf(stderr, "SDL: xCouldn't create SDL_yuv_overlay: %s\n", + SDL_GetError()); + exit(1); + } + rect.x = 0; + rect.y = 0; + rect.w = w; + rect.h = h; + + if (px_fmt!=TH_PF_444) + SDL_DisplayYUVOverlay(yuv_overlay, &rect); +} + +static void video_write(void){ + int i; + th_ycbcr_buffer yuv; + int y_offset, uv_offset; + th_decode_ycbcr_out(td,yuv); + /* Lock SDL_yuv_overlay */ + if ( SDL_MUSTLOCK(screen) ) { + if ( SDL_LockSurface(screen) < 0 ) return; + } + if (px_fmt!=TH_PF_444 && SDL_LockYUVOverlay(yuv_overlay) < 0) return; + + /* let's draw the data on a SDL screen (*screen) */ + /* deal with border stride */ + /* reverse u and v for SDL */ + /* and crop input properly, respecting the encoded frame rect */ + /* problems may exist for odd frame rect for some encodings */ + + y_offset=(ti.pic_x&~1)+yuv[0].stride*(ti.pic_y&~1); + + if (px_fmt==TH_PF_422) { + uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y); + /* SDL doesn't have a planar 4:2:2 */ + for(i=0;ih;i++) { + int j; + char *in_y = (char *)yuv[0].data+y_offset+yuv[0].stride*i; + char *out = (char *)(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i); + for (j=0;jw;j++) + out[j*2] = in_y[j]; + char *in_u = (char *)yuv[1].data+uv_offset+yuv[1].stride*i; + char *in_v = (char *)yuv[2].data+uv_offset+yuv[2].stride*i; + for (j=0;jw>>1;j++) { + out[j*4+1] = in_u[j]; + out[j*4+3] = in_v[j]; + } + } + } else if (px_fmt==TH_PF_444){ + SDL_Surface *output; + for(i=0;ih;i++) { + int j; + unsigned char *in_y = (unsigned char *)yuv[0].data+y_offset+yuv[0].stride*i; + unsigned char *in_u = (unsigned char *)yuv[1].data+y_offset+yuv[1].stride*i; + unsigned char *in_v = (unsigned char *)yuv[2].data+y_offset+yuv[2].stride*i; + unsigned char *out = RGBbuffer+(screen->w*i*4); + for (j=0;jw;j++) { + int r, g, b; + r=(1904000*in_y[j]+2609823*in_v[j]-363703744)/1635200; + g=(3827562*in_y[j]-1287801*in_u[j] + -2672387*in_v[j]+447306710)/3287200; + b=(952000*in_y[j]+1649289*in_u[j]-225932192)/817600; + out[4*j+0]=OC_CLAMP255(b); + out[4*j+1]=OC_CLAMP255(g); + out[4*j+2]=OC_CLAMP255(r); + } + output=SDL_CreateRGBSurfaceFrom(RGBbuffer,screen->w,screen->h,32,4*screen->w,0,0,0,0); + SDL_BlitSurface(output,NULL,screen,NULL); + } + } else { + uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2); + for(i=0;ih;i++) + memcpy(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i, + yuv[0].data+y_offset+yuv[0].stride*i, + yuv_overlay->w); + for(i=0;ih/2;i++){ + memcpy(yuv_overlay->pixels[1]+yuv_overlay->pitches[1]*i, + yuv[2].data+uv_offset+yuv[2].stride*i, + yuv_overlay->w/2); + memcpy(yuv_overlay->pixels[2]+yuv_overlay->pitches[2]*i, + yuv[1].data+uv_offset+yuv[1].stride*i, + yuv_overlay->w/2); + } + } + + /* Unlock SDL_yuv_overlay */ + if ( SDL_MUSTLOCK(screen) ) { + SDL_UnlockSurface(screen); + } + if (px_fmt!=TH_PF_444) { + SDL_UnlockYUVOverlay(yuv_overlay); + /* Show, baby, show! */ + SDL_DisplayYUVOverlay(yuv_overlay, &rect); + } else { + SDL_Flip(screen); + } +} +/* dump the theora (or vorbis) comment header */ +static int dump_comments(th_comment *tc){ + int i, len; + char *value; + FILE *out=stdout; + + fprintf(out,"Encoded by %s\n",tc->vendor); + if(tc->comments){ + fprintf(out, "theora comment header:\n"); + for(i=0;icomments;i++){ + if(tc->user_comments[i]){ + len=tc->comment_lengths[i]; + value=malloc(len+1); + memcpy(value,tc->user_comments[i],len); + value[len]='\0'; + fprintf(out, "\t%s\n", value); + free(value); + } + } + } + return(0); +} + +/* Report the encoder-specified colorspace for the video, if any. + We don't actually make use of the information in this example; + a real player should attempt to perform color correction for + whatever display device it supports. */ +static void report_colorspace(th_info *ti) +{ + switch(ti->colorspace){ + case TH_CS_UNSPECIFIED: + /* nothing to report */ + break;; + case TH_CS_ITU_REC_470M: + fprintf(stderr," encoder specified ITU Rec 470M (NTSC) color.\n"); + break;; + case TH_CS_ITU_REC_470BG: + fprintf(stderr," encoder specified ITU Rec 470BG (PAL) color.\n"); + break;; + default: + fprintf(stderr,"warning: encoder specified unknown colorspace (%d).\n", + ti->colorspace); + break;; + } +} + +/* helper: push a page into the appropriate steam */ +/* this can be done blindly; a stream won't accept a page + that doesn't belong to it */ +static int queue_page(ogg_page *page){ + if(theora_p)ogg_stream_pagein(&to,page); + if(vorbis_p)ogg_stream_pagein(&vo,page); + return 0; +} + +static void usage(void){ + fprintf(stderr, + "Usage: player_example \n" + "input is read from stdin if no file is passed on the command line\n" + "\n" + ); +} + +int main(int argc,char *const *argv){ + + int pp_level_max; + int pp_level; + int pp_inc; + int i,j; + ogg_packet op; + + FILE *infile = stdin; + + int frames = 0; + int dropped = 0; + +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); +#endif + + /* open the input file if any */ + if(argc==2){ + infile=fopen(argv[1],"rb"); + if(infile==NULL){ + fprintf(stderr,"Unable to open '%s' for playback.\n", argv[1]); + exit(1); + } + } + if(argc>2){ + usage(); + exit(1); + } + + /* start up Ogg stream synchronization layer */ + ogg_sync_init(&oy); + + /* init supporting Vorbis structures needed in header parsing */ + vorbis_info_init(&vi); + vorbis_comment_init(&vc); + + /* init supporting Theora structures needed in header parsing */ + th_comment_init(&tc); + th_info_init(&ti); + + /* Ogg file open; parse the headers */ + /* Only interested in Vorbis/Theora streams */ + while(!stateflag){ + int ret=buffer_data(infile,&oy); + if(ret==0)break; + while(ogg_sync_pageout(&oy,&og)>0){ + ogg_stream_state test; + + /* is this a mandated initial header? If not, stop parsing */ + if(!ogg_page_bos(&og)){ + /* don't leak the page; get it into the appropriate stream */ + queue_page(&og); + stateflag=1; + break; + } + + ogg_stream_init(&test,ogg_page_serialno(&og)); + ogg_stream_pagein(&test,&og); + ogg_stream_packetout(&test,&op); + + + /* identify the codec: try theora */ + if(!theora_p && th_decode_headerin(&ti,&tc,&ts,&op)>=0){ + /* it is theora */ + memcpy(&to,&test,sizeof(test)); + theora_p=1; + }else if(!vorbis_p && vorbis_synthesis_headerin(&vi,&vc,&op)>=0){ + /* it is vorbis */ + memcpy(&vo,&test,sizeof(test)); + vorbis_p=1; + }else{ + /* whatever it is, we don't care about it */ + ogg_stream_clear(&test); + } + } + /* fall through to non-bos page parsing */ + } + + /* we're expecting more header packets. */ + while((theora_p && theora_p<3) || (vorbis_p && vorbis_p<3)){ + int ret; + + /* look for further theora headers */ + while(theora_p && (theora_p<3) && (ret=ogg_stream_packetout(&to,&op))){ + if(ret<0){ + fprintf(stderr,"Error parsing Theora stream headers; " + "corrupt stream?\n"); + exit(1); + } + if(!th_decode_headerin(&ti,&tc,&ts,&op)){ + fprintf(stderr,"Error parsing Theora stream headers; " + "corrupt stream?\n"); + exit(1); + } + theora_p++; + } + + /* look for more vorbis header packets */ + while(vorbis_p && (vorbis_p<3) && (ret=ogg_stream_packetout(&vo,&op))){ + if(ret<0){ + fprintf(stderr,"Error parsing Vorbis stream headers; corrupt stream?\n"); + exit(1); + } + if(vorbis_synthesis_headerin(&vi,&vc,&op)){ + fprintf(stderr,"Error parsing Vorbis stream headers; corrupt stream?\n"); + exit(1); + } + vorbis_p++; + if(vorbis_p==3)break; + } + + /* The header pages/packets will arrive before anything else we + care about, or the stream is not obeying spec */ + + if(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); /* demux into the appropriate stream */ + }else{ + int ret=buffer_data(infile,&oy); /* someone needs more data */ + if(ret==0){ + fprintf(stderr,"End of file while searching for codec headers.\n"); + exit(1); + } + } + } + + /* and now we have it all. initialize decoders */ + if(theora_p){ + td=th_decode_alloc(&ti,ts); + printf("Ogg logical stream %lx is Theora %dx%d %.02f fps", + to.serialno,ti.pic_width,ti.pic_height, + (double)ti.fps_numerator/ti.fps_denominator); + px_fmt=ti.pixel_fmt; + switch(ti.pixel_fmt){ + case TH_PF_420: printf(" 4:2:0 video\n"); break; + case TH_PF_422: printf(" 4:2:2 video\n"); break; + case TH_PF_444: printf(" 4:4:4 video\n"); break; + case TH_PF_RSVD: + default: + printf(" video\n (UNKNOWN Chroma sampling!)\n"); + break; + } + if(ti.pic_width!=ti.frame_width || ti.pic_height!=ti.frame_height) + printf(" Frame content is %dx%d with offset (%d,%d).\n", + ti.frame_width, ti.frame_height, ti.pic_x, ti.pic_y); + report_colorspace(&ti); + dump_comments(&tc); + th_decode_ctl(td,TH_DECCTL_GET_PPLEVEL_MAX,&pp_level_max, + sizeof(pp_level_max)); + pp_level=pp_level_max; + th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level,sizeof(pp_level)); + pp_inc=0; + + /*{ + int arg = 0xffff; + th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_MBMODE,&arg,sizeof(arg)); + th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_MV,&arg,sizeof(arg)); + th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_QI,&arg,sizeof(arg)); + arg=10; + th_decode_ctl(td,TH_DECCTL_SET_TELEMETRY_BITS,&arg,sizeof(arg)); + }*/ + }else{ + /* tear down the partial theora setup */ + th_info_clear(&ti); + th_comment_clear(&tc); + } + + th_setup_free(ts); + + if(vorbis_p){ + vorbis_synthesis_init(&vd,&vi); + vorbis_block_init(&vd,&vb); + fprintf(stderr,"Ogg logical stream %lx is Vorbis %d channel %ld Hz audio.\n", + vo.serialno,vi.channels,vi.rate); + }else{ + /* tear down the partial vorbis setup */ + vorbis_info_clear(&vi); + vorbis_comment_clear(&vc); + } + + /* open audio */ + if(vorbis_p)open_audio(); + + /* open video */ + if(theora_p)open_video(); + + /* install signal handler as SDL clobbered the default */ + signal (SIGINT, sigint_handler); + + /* on to the main decode loop. We assume in this example that audio + and video start roughly together, and don't begin playback until + we have a start frame for both. This is not necessarily a valid + assumption in Ogg A/V streams! It will always be true of the + example_encoder (and most streams) though. */ + + stateflag=0; /* playback has not begun */ + while(!got_sigint){ + + /* we want a video and audio frame ready to go at all times. If + we have to buffer incoming, buffer the compressed data (ie, let + ogg do the buffering) */ + while(vorbis_p && !audiobuf_ready){ + int ret; + float **pcm; + + /* if there's pending, decoded audio, grab it */ + if((ret=vorbis_synthesis_pcmout(&vd,&pcm))>0){ + int count=audiobuf_fill/2; + int maxsamples=(audiofd_fragsize-audiobuf_fill)/2/vi.channels; + for(i=0;i32767)val=32767; + if(val<-32768)val=-32768; + audiobuf[count++]=val; + } + vorbis_synthesis_read(&vd,i); + audiobuf_fill+=i*vi.channels*2; + if(audiobuf_fill==audiofd_fragsize)audiobuf_ready=1; + if(vd.granulepos>=0) + audiobuf_granulepos=vd.granulepos-ret+i; + else + audiobuf_granulepos+=i; + + }else{ + + /* no pending audio; is there a pending packet to decode? */ + if(ogg_stream_packetout(&vo,&op)>0){ + if(vorbis_synthesis(&vb,&op)==0) /* test for success! */ + vorbis_synthesis_blockin(&vd,&vb); + }else /* we need more data; break out to suck in another page */ + break; + } + } + + while(theora_p && !videobuf_ready){ + /* theora is one in, one out... */ + if(ogg_stream_packetout(&to,&op)>0){ + + if(pp_inc){ + pp_level+=pp_inc; + th_decode_ctl(td,TH_DECCTL_SET_PPLEVEL,&pp_level, + sizeof(pp_level)); + pp_inc=0; + } + /*HACK: This should be set after a seek or a gap, but we might not have + a granulepos for the first packet (we only have them for the last + packet on a page), so we just set it as often as we get it. + To do this right, we should back-track from the last packet on the + page and compute the correct granulepos for the first packet after + a seek or a gap.*/ + if(op.granulepos>=0){ + th_decode_ctl(td,TH_DECCTL_SET_GRANPOS,&op.granulepos, + sizeof(op.granulepos)); + } + if(th_decode_packetin(td,&op,&videobuf_granulepos)==0){ + videobuf_time=th_granule_time(td,videobuf_granulepos); + frames++; + + /* is it already too old to be useful? This is only actually + useful cosmetically after a SIGSTOP. Note that we have to + decode the frame even if we don't show it (for now) due to + keyframing. Soon enough libtheora will be able to deal + with non-keyframe seeks. */ + + if(videobuf_time>=get_time()) + videobuf_ready=1; + else{ + /*If we are too slow, reduce the pp level.*/ + pp_inc=pp_level>0?-1:0; + dropped++; + } + } + + }else + break; + } + + if(!videobuf_ready && !audiobuf_ready && feof(infile))break; + + if(!videobuf_ready || !audiobuf_ready){ + /* no data yet for somebody. Grab another page */ + buffer_data(infile,&oy); + while(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); + } + } + + /* If playback has begun, top audio buffer off immediately. */ + if(stateflag) audio_write_nonblocking(); + + /* are we at or past time for this video frame? */ + if(stateflag && videobuf_ready && videobuf_time<=get_time()){ + video_write(); + videobuf_ready=0; + } + + if(stateflag && + (audiobuf_ready || !vorbis_p) && + (videobuf_ready || !theora_p) && + !got_sigint){ + /* we have an audio frame ready (which means the audio buffer is + full), it's not time to play video, so wait until one of the + audio buffer is ready or it's near time to play video */ + + /* set up select wait on the audiobuffer and a timeout for video */ + struct timeval timeout; + fd_set writefs; + fd_set empty; + int n=0; + + FD_ZERO(&writefs); + FD_ZERO(&empty); + if(audiofd>=0){ + FD_SET(audiofd,&writefs); + n=audiofd+1; + } + + if(theora_p){ + double tdiff; + long milliseconds; + tdiff=videobuf_time-get_time(); + /*If we have lots of extra time, increase the post-processing level.*/ + if(tdiff>ti.fps_denominator*0.25/ti.fps_numerator){ + pp_inc=pp_level0?-1:0; + } + milliseconds=tdiff*1000-5; + if(milliseconds>500)milliseconds=500; + if(milliseconds>0){ + timeout.tv_sec=milliseconds/1000; + timeout.tv_usec=(milliseconds%1000)*1000; + + n=select(n,&empty,&writefs,&empty,&timeout); + if(n)audio_calibrate_timer(0); + } + }else{ + select(n,&empty,&writefs,&empty,NULL); + } + } + + /* if our buffers either don't exist or are ready to go, + we can begin playback */ + if((!theora_p || videobuf_ready) && + (!vorbis_p || audiobuf_ready))stateflag=1; + /* same if we've run out of input */ + if(feof(infile))stateflag=1; + + } + + /* tear it all down */ + + audio_close(); + SDL_Quit(); + + if(vorbis_p){ + ogg_stream_clear(&vo); + vorbis_block_clear(&vb); + vorbis_dsp_clear(&vd); + vorbis_comment_clear(&vc); + vorbis_info_clear(&vi); + } + if(theora_p){ + ogg_stream_clear(&to); + th_decode_free(td); + th_comment_clear(&tc); + th_info_clear(&ti); + } + ogg_sync_clear(&oy); + + if(infile && infile!=stdin)fclose(infile); + + fprintf(stderr, + "\r \r"); + fprintf(stderr, "%d frames", frames); + if (dropped) fprintf(stderr, " (%d dropped)", dropped); + fprintf(stderr, "\n"); + fprintf(stderr, "\nDone.\n"); + + return(0); + +} diff --git a/libs/libtheora-1.1/examples/png2theora.c b/libs/libtheora-1.1/examples/png2theora.c new file mode 100644 index 00000000..54728c9d --- /dev/null +++ b/libs/libtheora-1.1/examples/png2theora.c @@ -0,0 +1,942 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009,2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: example encoder application; makes an Ogg Theora + file from a sequence of png images + last mod: $Id: png2theora.c 17975 2011-05-07 22:35:30Z giles $ + based on code from Vegard Nossum + + ********************************************************************/ + +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "theora/theoraenc.h" + +#define PROGRAM_NAME "png2theora" +#define PROGRAM_VERSION "1.1" + +static const char *option_output = NULL; +static int video_fps_numerator = 24; +static int video_fps_denominator = 1; +static int video_aspect_numerator = 0; +static int video_aspect_denominator = 0; +static int video_rate = -1; +static int video_quality = -1; +ogg_uint32_t keyframe_frequency=0; +int buf_delay=-1; +int vp3_compatible=0; +static int chroma_format = TH_PF_420; + +static FILE *twopass_file = NULL; +static int twopass=0; +static int passno; + +static FILE *ogg_fp = NULL; +static ogg_stream_state ogg_os; +static ogg_packet op; +static ogg_page og; + +static th_enc_ctx *td; +static th_info ti; + +static char *input_filter; + +const char *optstring = "o:hv:\4:\2:V:s:S:f:F:ck:d:\1\2\3\4\5\6"; +struct option options [] = { + {"output",required_argument,NULL,'o'}, + {"help",no_argument,NULL,'h'}, + {"chroma-444",no_argument,NULL,'\5'}, + {"chroma-422",no_argument,NULL,'\6'}, + {"video-rate-target",required_argument,NULL,'V'}, + {"video-quality",required_argument,NULL,'v'}, + {"aspect-numerator",required_argument,NULL,'s'}, + {"aspect-denominator",required_argument,NULL,'S'}, + {"framerate-numerator",required_argument,NULL,'f'}, + {"framerate-denominator",required_argument,NULL,'F'}, + {"vp3-compatible",no_argument,NULL,'c'}, + {"soft-target",no_argument,NULL,'\1'}, + {"keyframe-freq",required_argument,NULL,'k'}, + {"buf-delay",required_argument,NULL,'d'}, + {"two-pass",no_argument,NULL,'\2'}, + {"first-pass",required_argument,NULL,'\3'}, + {"second-pass",required_argument,NULL,'\4'}, + {NULL,0,NULL,0} +}; + +static void usage(void){ + fprintf(stderr, + "%s %s\n" + "Usage: %s [options] \n\n" + "The input argument uses C printf format to represent a list of files,\n" + " i.e. file-%%06d.png to look for files file000001.png to file9999999.png \n\n" + "Options: \n\n" + " -o --output file name for encoded output (required);\n" + " -v --video-quality Theora quality selector fro 0 to 10\n" + " (0 yields smallest files but lowest\n" + " video quality. 10 yields highest\n" + " fidelity but large files)\n\n" + " -V --video-rate-target bitrate target for Theora video\n\n" + " --soft-target Use a large reservoir and treat the rate\n" + " as a soft target; rate control is less\n" + " strict but resulting quality is usually\n" + " higher/smoother overall. Soft target also\n" + " allows an optional -v setting to specify\n" + " a minimum allowed quality.\n\n" + " --two-pass Compress input using two-pass rate control\n" + " This option performs both passes automatically.\n\n" + " --first-pass Perform first-pass of a two-pass rate\n" + " controlled encoding, saving pass data to\n" + " for a later second pass\n\n" + " --second-pass Perform second-pass of a two-pass rate\n" + " controlled encoding, reading first-pass\n" + " data from . The first pass\n" + " data must come from a first encoding pass\n" + " using identical input video to work\n" + " properly.\n\n" + " -k --keyframe-freq Keyframe frequency\n" + " -d --buf-delay Buffer delay (in frames). Longer delays\n" + " allow smoother rate adaptation and provide\n" + " better overall quality, but require more\n" + " client side buffering and add latency. The\n" + " default value is the keyframe interval for\n" + " one-pass encoding (or somewhat larger if\n" + " --soft-target is used) and infinite for\n" + " two-pass encoding.\n" + " --chroma-444 Use 4:4:4 chroma subsampling\n" + " --chroma-422 Use 4:2:2 chroma subsampling\n" + " (4:2:0 is default)\n\n" + " -s --aspect-numerator Aspect ratio numerator, default is 0\n" + " -S --aspect-denominator Aspect ratio denominator, default is 0\n" + " -f --framerate-numerator Frame rate numerator\n" + " -F --framerate-denominator Frame rate denominator\n" + " The frame rate nominator divided by this\n" + " determines the frame rate in units per tick\n" + ,PROGRAM_NAME, PROGRAM_VERSION, PROGRAM_NAME + ); + exit(0); +} + +#ifdef WIN32 +int +alphasort (const void *a, const void *b) +{ + return strcoll ((*(const struct dirent **) a)->d_name, + (*(const struct dirent **) b)->d_name); +} + +int +scandir (const char *dir, struct dirent ***namelist, + int (*select)(const struct dirent *), int (*compar)(const void *, const void *)) +{ + DIR *d; + struct dirent *entry; + register int i=0; + size_t entrysize; + + if ((d=opendir(dir)) == NULL) + return(-1); + + *namelist=NULL; + while ((entry=readdir(d)) != NULL) + { + if (select == NULL || (select != NULL && (*select)(entry))) + { + *namelist=(struct dirent **)realloc((void *)(*namelist), + (size_t)((i+1)*sizeof(struct dirent *))); + if (*namelist == NULL) return(-1); + entrysize=sizeof(struct dirent)-sizeof(entry->d_name)+strlen(entry->d_name)+1; + (*namelist)[i]=(struct dirent *)malloc(entrysize); + if ((*namelist)[i] == NULL) return(-1); + memcpy((*namelist)[i], entry, entrysize); + i++; + } + } + if (closedir(d)) return(-1); + if (i == 0) return(-1); + if (compar != NULL) + qsort((void *)(*namelist), (size_t)i, sizeof(struct dirent *), compar); + + return(i); +} +#endif + +static int +theora_write_frame(th_ycbcr_buffer ycbcr, int last) +{ + ogg_packet op; + ogg_page og; + + /* Theora is a one-frame-in,one-frame-out system; submit a frame + for compression and pull out the packet */ + /* in two-pass mode's second pass, we need to submit first-pass data */ + if(passno==2){ + int ret; + for(;;){ + static unsigned char buffer[80]; + static int buf_pos; + int bytes; + /*Ask the encoder how many bytes it would like.*/ + bytes=th_encode_ctl(td,TH_ENCCTL_2PASS_IN,NULL,0); + if(bytes<0){ + fprintf(stderr,"Error submitting pass data in second pass.\n"); + exit(1); + } + /*If it's got enough, stop.*/ + if(bytes==0)break; + /*Read in some more bytes, if necessary.*/ + if(bytes>80-buf_pos)bytes=80-buf_pos; + if(bytes>0&&fread(buffer+buf_pos,1,bytes,twopass_file)=bytes)buf_pos=0; + /*Otherwise remember how much it used.*/ + else buf_pos+=ret; + } + } + + if(th_encode_ycbcr_in(td, ycbcr)) { + fprintf(stderr, "%s: error: could not encode frame\n", + option_output); + return 1; + } + + /* in two-pass mode's first pass we need to extract and save the pass data */ + if(passno==1){ + unsigned char *buffer; + int bytes = th_encode_ctl(td, TH_ENCCTL_2PASS_OUT, &buffer, sizeof(buffer)); + if(bytes<0){ + fprintf(stderr,"Could not read two-pass data from encoder.\n"); + exit(1); + } + if(fwrite(buffer,1,bytes,twopass_file) 255) + return 255; + + return d; +} + +static void +rgb_to_yuv(png_bytep *png, + th_ycbcr_buffer ycbcr, + unsigned int w, unsigned int h) +{ + unsigned int x; + unsigned int y; + + unsigned int x1; + unsigned int y1; + + unsigned long yuv_w; + + unsigned char *yuv_y; + unsigned char *yuv_u; + unsigned char *yuv_v; + + yuv_w = ycbcr[0].width; + + yuv_y = ycbcr[0].data; + yuv_u = ycbcr[1].data; + yuv_v = ycbcr[2].data; + + /*This ignores gamma and RGB primary/whitepoint differences. + It also isn't terribly fast (though a decent compiler will + strength-reduce the division to a multiplication).*/ + + if (chroma_format == TH_PF_420) { + for(y = 0; y < h; y += 2) { + y1=y+(y+1> 1) + (y >> 1) * ycbcr[1].stride] = + clamp( ((-33488*r0-65744*g0+99232*b0+29032005)/4 + + (-33488*r0-65744*g0+99232*b0+29032005)/4 + + (-33488*r2-65744*g2+99232*b2+29032005)/4 + + (-33488*r3-65744*g3+99232*b3+29032005)/4)/225930); + yuv_v[(x >> 1) + (y >> 1) * ycbcr[2].stride] = + clamp( ((157024*r0-131488*g0-25536*b0+45940035)/4 + + (157024*r1-131488*g1-25536*b1+45940035)/4 + + (157024*r2-131488*g2-25536*b2+45940035)/4 + + (157024*r3-131488*g3-25536*b3+45940035)/4)/357510); + } + } + } else if (chroma_format == TH_PF_444) { + for(y = 0; y < h; y++) { + for(x = 0; x < w; x++) { + png_byte r = png[y][3 * x + 0]; + png_byte g = png[y][3 * x + 1]; + png_byte b = png[y][3 * x + 2]; + + yuv_y[x + y * yuv_w] = clamp((65481*r+128553*g+24966*b+4207500)/255000); + yuv_u[x + y * yuv_w] = clamp((-33488*r-65744*g+99232*b+29032005)/225930); + yuv_v[x + y * yuv_w] = clamp((157024*r-131488*g-25536*b+45940035)/357510); + } + } + } else { /* TH_PF_422 */ + for(y = 0; y < h; y += 1) { + for(x = 0; x < w; x += 2) { + x1=x+(x+1> 1) + y * ycbcr[1].stride] = + clamp( ((-33488*r0-65744*g0+99232*b0+29032005)/2 + + (-33488*r1-65744*g1+99232*b1+29032005)/2)/225930); + yuv_v[(x >> 1) + y * ycbcr[2].stride] = + clamp( ((157024*r0-131488*g0-25536*b0+45940035)/2 + + (157024*r1-131488*g1-25536*b1+45940035)/2)/357510); + } + } + } + +} + +static int +png_read(const char *pathname, unsigned int *w, unsigned int *h, th_ycbcr_buffer ycbcr) +{ + FILE *fp; + unsigned char header[8]; + png_structp png_ptr; + png_infop info_ptr; + png_infop end_ptr; + png_bytep row_data; + png_bytep *row_pointers; + png_color_16p bkgd; + png_uint_32 width; + png_uint_32 height; + unsigned long yuv_w; + unsigned long yuv_h; + int bit_depth; + int color_type; + int interlace_type; + int compression_type; + int filter_method; + png_uint_32 y; + + fp = fopen(pathname, "rb"); + if(!fp) { + fprintf(stderr, "%s: error: %s\n", + pathname, strerror(errno)); + return 1; + } + + fread(header, 1, 8, fp); + if(png_sig_cmp(header, 0, 8)) { + fprintf(stderr, "%s: error: %s\n", + pathname, "not a PNG"); + fclose(fp); + return 1; + } + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL, NULL, NULL); + if(!png_ptr) { + fprintf(stderr, "%s: error: %s\n", + pathname, "couldn't create png read structure"); + fclose(fp); + return 1; + } + + info_ptr = png_create_info_struct(png_ptr); + if(!info_ptr) { + fprintf(stderr, "%s: error: %s\n", + pathname, "couldn't create png info structure"); + png_destroy_read_struct(&png_ptr, NULL, NULL); + fclose(fp); + return 1; + } + + end_ptr = png_create_info_struct(png_ptr); + if(!end_ptr) { + fprintf(stderr, "%s: error: %s\n", + pathname, "couldn't create png info structure"); + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + fclose(fp); + return 1; + } + + png_init_io(png_ptr, fp); + png_set_sig_bytes(png_ptr, 8); + png_read_info(png_ptr, info_ptr); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + &interlace_type, &compression_type, &filter_method); + png_set_expand(png_ptr); + if(bit_depth<8)png_set_packing(png_ptr); + if(bit_depth==16)png_set_strip_16(png_ptr); + if(!(color_type&PNG_COLOR_MASK_COLOR))png_set_gray_to_rgb(png_ptr); + if(png_get_bKGD(png_ptr, info_ptr, &bkgd)){ + png_set_background(png_ptr, bkgd, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); + } + /*Note that color_type 2 and 3 can also have alpha, despite not setting the + PNG_COLOR_MASK_ALPHA bit. + We always strip it to prevent libpng from overrunning our buffer.*/ + png_set_strip_alpha(png_ptr); + + row_data = (png_bytep)png_malloc(png_ptr, + 3*height*width*png_sizeof(*row_data)); + row_pointers = (png_bytep *)png_malloc(png_ptr, + height*png_sizeof(*row_pointers)); + for(y = 0; y < height; y++) { + row_pointers[y] = row_data + y*(3*width); + } + png_read_image(png_ptr, row_pointers); + png_read_end(png_ptr, end_ptr); + + *w = width; + *h = height; + /* Must hold: yuv_w >= w */ + yuv_w = (*w + 15) & ~15; + /* Must hold: yuv_h >= h */ + yuv_h = (*h + 15) & ~15; + + /* Do we need to allocate a buffer */ + if (!ycbcr[0].data){ + ycbcr[0].width = yuv_w; + ycbcr[0].height = yuv_h; + ycbcr[0].stride = yuv_w; + ycbcr[1].width = (chroma_format == TH_PF_444) ? yuv_w : (yuv_w >> 1); + ycbcr[1].stride = ycbcr[1].width; + ycbcr[1].height = (chroma_format == TH_PF_420) ? (yuv_h >> 1) : yuv_h; + ycbcr[2].width = ycbcr[1].width; + ycbcr[2].stride = ycbcr[1].stride; + ycbcr[2].height = ycbcr[1].height; + + ycbcr[0].data = malloc(ycbcr[0].stride * ycbcr[0].height); + ycbcr[1].data = malloc(ycbcr[1].stride * ycbcr[1].height); + ycbcr[2].data = malloc(ycbcr[2].stride * ycbcr[2].height); + } else { + if ((ycbcr[0].width != yuv_w) || (ycbcr[0].height != yuv_h)){ + fprintf(stderr, "Input size %lux%lu does not match %dx%d\n", yuv_w,yuv_h,ycbcr[0].width,ycbcr[0].height); + exit(1); + } + } + + rgb_to_yuv(row_pointers, ycbcr, *w, *h); + + png_free(png_ptr, row_pointers); + png_free(png_ptr, row_data); + png_destroy_read_struct(&png_ptr, &info_ptr, &end_ptr); + + fclose(fp); + return 0; +} + +static int include_files (const struct dirent *de) +{ + char name[1024]; + int number = -1; + sscanf(de->d_name, input_filter, &number); + sprintf(name, input_filter, number); + return !strcmp(name, de->d_name); +} + +static int ilog(unsigned _v){ + int ret; + for(ret=0;_v;ret++)_v>>=1; + return ret; +} + +int +main(int argc, char *argv[]) +{ + int c,long_option_index; + int i, n; + char *input_mask; + char *input_directory; + char *scratch; + th_comment tc; + struct dirent **png_files; + int soft_target=0; + int ret; + + while(1) { + + c=getopt_long(argc,argv,optstring,options,&long_option_index); + if(c == EOF) + break; + + switch(c) { + case 'h': + usage(); + break; + case 'o': + option_output = optarg; + break;; + case 'v': + video_quality=rint(atof(optarg)*6.3); + if(video_quality<0 || video_quality>63){ + fprintf(stderr,"Illegal video quality (choose 0 through 10)\n"); + exit(1); + } + video_rate=0; + break; + case 'V': + video_rate=rint(atof(optarg)*1000); + if(video_rate<1){ + fprintf(stderr,"Illegal video bitrate (choose > 0 please)\n"); + exit(1); + } + video_quality=0; + break; + case '\1': + soft_target=1; + break; + case 'c': + vp3_compatible=1; + break; + case 'k': + keyframe_frequency=rint(atof(optarg)); + if(keyframe_frequency<1 || keyframe_frequency>2147483647){ + fprintf(stderr,"Illegal keyframe frequency\n"); + exit(1); + } + break; + + case 'd': + buf_delay=atoi(optarg); + if(buf_delay<=0){ + fprintf(stderr,"Illegal buffer delay\n"); + exit(1); + } + break; + case 's': + video_aspect_numerator=rint(atof(optarg)); + break; + case 'S': + video_aspect_denominator=rint(atof(optarg)); + break; + case 'f': + video_fps_numerator=rint(atof(optarg)); + break; + case 'F': + video_fps_denominator=rint(atof(optarg)); + break; + case '\5': + chroma_format=TH_PF_444; + break; + case '\6': + chroma_format=TH_PF_422; + break; + case '\2': + twopass=3; /* perform both passes */ + twopass_file=tmpfile(); + if(!twopass_file){ + fprintf(stderr,"Unable to open temporary file for twopass data\n"); + exit(1); + } + break; + case '\3': + twopass=1; /* perform first pass */ + twopass_file=fopen(optarg,"wb"); + if(!twopass_file){ + fprintf(stderr,"Unable to open \'%s\' for twopass data\n",optarg); + exit(1); + } + break; + case '\4': + twopass=2; /* perform second pass */ + twopass_file=fopen(optarg,"rb"); + if(!twopass_file){ + fprintf(stderr,"Unable to open twopass data file \'%s\'",optarg); + exit(1); + } + break; + default: + usage(); + break; + } + } + + if(argc < 3) { + usage(); + } + + if(soft_target){ + if(video_rate<=0){ + fprintf(stderr,"Soft rate target (--soft-target) requested without a bitrate (-V).\n"); + exit(1); + } + if(video_quality==-1) + video_quality=0; + }else{ + if(video_rate>0) + video_quality=0; + if(video_quality==-1) + video_quality=48; + } + + if(keyframe_frequency<=0){ + /*Use a default keyframe frequency of 64 for 1-pass (streaming) mode, and + 256 for two-pass mode.*/ + keyframe_frequency=twopass?256:64; + } + + input_mask = argv[optind]; + if (!input_mask) { + fprintf(stderr, "no input files specified; run with -h for help.\n"); + exit(1); + } + /* dirname and basename must operate on scratch strings */ + scratch = strdup(input_mask); + input_directory = strdup(dirname(scratch)); + free(scratch); + scratch = strdup(input_mask); + input_filter = strdup(basename(scratch)); + free(scratch); + +#ifdef DEBUG + fprintf(stderr, "scanning %s with filter '%s'\n", + input_directory, input_filter); +#endif + n = scandir (input_directory, &png_files, include_files, alphasort); + + if (!n) { + fprintf(stderr, "no input files found; run with -h for help.\n"); + exit(1); + } + + ogg_fp = fopen(option_output, "wb"); + if(!ogg_fp) { + fprintf(stderr, "%s: error: %s\n", + option_output, "couldn't open output file"); + return 1; + } + + srand(time(NULL)); + if(ogg_stream_init(&ogg_os, rand())) { + fprintf(stderr, "%s: error: %s\n", + option_output, "couldn't create ogg stream state"); + return 1; + } + + for(passno=(twopass==3?1:twopass);passno<=(twopass==3?2:twopass);passno++){ + unsigned int w; + unsigned int h; + char input_png[1024]; + th_ycbcr_buffer ycbcr; + + ycbcr[0].data = 0; + int last = 0; + + snprintf(input_png, 1023,"%s/%s", input_directory, png_files[0]->d_name); + if(png_read(input_png, &w, &h, ycbcr)) { + fprintf(stderr, "could not read %s\n", input_png); + exit(1); + } + + if (passno!=2) fprintf(stderr,"%d frames, %dx%d\n",n,w,h); + + /* setup complete. Raw processing loop */ + switch(passno){ + case 0: case 2: + fprintf(stderr,"\rCompressing.... \n"); + break; + case 1: + fprintf(stderr,"\rScanning first pass.... \n"); + break; + } + + fprintf(stderr, "%s\n", input_png); + + th_info_init(&ti); + ti.frame_width = ((w + 15) >>4)<<4; + ti.frame_height = ((h + 15)>>4)<<4; + ti.pic_width = w; + ti.pic_height = h; + ti.pic_x = 0; + ti.pic_y = 0; + ti.fps_numerator = video_fps_numerator; + ti.fps_denominator = video_fps_denominator; + ti.aspect_numerator = video_aspect_numerator; + ti.aspect_denominator = video_aspect_denominator; + ti.colorspace = TH_CS_UNSPECIFIED; + ti.pixel_fmt = chroma_format; + ti.target_bitrate = video_rate; + ti.quality = video_quality; + ti.keyframe_granule_shift=ilog(keyframe_frequency-1); + + td=th_encode_alloc(&ti); + th_info_clear(&ti); + /* setting just the granule shift only allows power-of-two keyframe + spacing. Set the actual requested spacing. */ + ret=th_encode_ctl(td,TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, + &keyframe_frequency,sizeof(keyframe_frequency-1)); + if(ret<0){ + fprintf(stderr,"Could not set keyframe interval to %d.\n",(int)keyframe_frequency); + } + if(vp3_compatible){ + ret=th_encode_ctl(td,TH_ENCCTL_SET_VP3_COMPATIBLE,&vp3_compatible, + sizeof(vp3_compatible)); + if(ret<0||!vp3_compatible){ + fprintf(stderr,"Could not enable strict VP3 compatibility.\n"); + if(ret>=0){ + fprintf(stderr,"Ensure your source format is supported by VP3.\n"); + fprintf(stderr, + "(4:2:0 pixel format, width and height multiples of 16).\n"); + } + } + } + if(soft_target){ + /* reverse the rate control flags to favor a 'long time' strategy */ + int arg = TH_RATECTL_CAP_UNDERFLOW; + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_FLAGS,&arg,sizeof(arg)); + if(ret<0) + fprintf(stderr,"Could not set encoder flags for --soft-target\n"); + /* Default buffer control is overridden on two-pass */ + if(!twopass&&buf_delay<0){ + if((keyframe_frequency*7>>1) > 5*video_fps_numerator/video_fps_denominator) + arg=keyframe_frequency*7>>1; + else + arg=5*video_fps_numerator/video_fps_denominator; + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_BUFFER,&arg,sizeof(arg)); + if(ret<0) + fprintf(stderr,"Could not set rate control buffer for --soft-target\n"); + } + } + /* set up two-pass if needed */ + if(passno==1){ + unsigned char *buffer; + int bytes; + bytes=th_encode_ctl(td,TH_ENCCTL_2PASS_OUT,&buffer,sizeof(buffer)); + if(bytes<0){ + fprintf(stderr,"Could not set up the first pass of two-pass mode.\n"); + fprintf(stderr,"Did you remember to specify an estimated bitrate?\n"); + exit(1); + } + /*Perform a seek test to ensure we can overwrite this placeholder data at + the end; this is better than letting the user sit through a whole + encode only to find out their pass 1 file is useless at the end.*/ + if(fseek(twopass_file,0,SEEK_SET)<0){ + fprintf(stderr,"Unable to seek in two-pass data file.\n"); + exit(1); + } + if(fwrite(buffer,1,bytes,twopass_file)=0){ + ret=th_encode_ctl(td,TH_ENCCTL_SET_RATE_BUFFER, + &buf_delay,sizeof(buf_delay)); + if(ret<0){ + fprintf(stderr,"Warning: could not set desired buffer delay.\n"); + } + } + /* write the bitstream header packets with proper page interleave */ + th_comment_init(&tc); + /* first packet will get its own page automatically */ + if(th_encode_flushheader(td,&tc,&op)<=0){ + fprintf(stderr,"Internal Theora library error.\n"); + exit(1); + } + th_comment_clear(&tc); + if(passno!=1){ + ogg_stream_packetin(&ogg_os,&op); + if(ogg_stream_pageout(&ogg_os,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,ogg_fp); + fwrite(og.body,1,og.body_len,ogg_fp); + } + /* create the remaining theora headers */ + for(;;){ + ret=th_encode_flushheader(td,&tc,&op); + if(ret<0){ + fprintf(stderr,"Internal Theora library error.\n"); + exit(1); + } + else if(!ret)break; + if(passno!=1)ogg_stream_packetin(&ogg_os,&op); + } + /* Flush the rest of our headers. This ensures + the actual data in each stream will start + on a new page, as per spec. */ + if(passno!=1){ + for(;;){ + int result = ogg_stream_flush(&ogg_os,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,ogg_fp); + fwrite(og.body,1,og.body_len,ogg_fp); + } + } + + i=0; last=0; + do { + if(i >= n-1) last = 1; + if(theora_write_frame(ycbcr, last)) { + fprintf(stderr,"Encoding error.\n"); + exit(1); + } + + i++; + if (!last) { + snprintf(input_png, 1023,"%s/%s", input_directory, png_files[i]->d_name); + if(png_read(input_png, &w, &h, ycbcr)) { + fprintf(stderr, "could not read %s\n", input_png); + exit(1); + } + fprintf(stderr, "%s\n", input_png); + } + } while (!last); + + if(passno==1){ + /* need to read the final (summary) packet */ + unsigned char *buffer; + int bytes = th_encode_ctl(td, TH_ENCCTL_2PASS_OUT, &buffer, sizeof(buffer)); + if(bytes<0){ + fprintf(stderr,"Could not read two-pass summary data from encoder.\n"); + exit(1); + } + if(fseek(twopass_file,0,SEEK_SET)<0){ + fprintf(stderr,"Unable to seek in two-pass data file.\n"); + exit(1); + } + if(fwrite(buffer,1,bytes,twopass_file) +#endif + +#include +#include +#include +#include +#include +#include +#include "theora/theora.h" +#include "vorbis/codec.h" + +#ifdef WIN32 +#include +#include +#endif + +#include +#include + +/* for portaudio */ +#define FRAMES_PER_BUFFER (256) + +/*start of portaudio helper functions, extracted from pablio directory*/ + +/* Pa_streamio routines modified by mauricio at xiph.org + * Modified version of Portable Audio Blocking read/write utility. + * from the original PABLIO files + * Modified to support only playback buffers, direct access + * to the underlying stream time and remove blocking operations*/ + +/* PortAudio copyright notice follows */ + +/* + * Author: Phil Burk, http://www.softsynth.com + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.audiomulch.com/portaudio/ + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + */ + +typedef struct +{ + long bufferSize; /* Number of bytes in FIFO. Power of 2. Set by RingBuffer_Init. */ +/* These are declared volatile because they are written by a different thread than the reader. */ + volatile long writeIndex; /* Index of next writable byte. Set by RingBuffer_AdvanceWriteIndex. */ + volatile long readIndex; /* Index of next readable byte. Set by RingBuffer_AdvanceReadIndex. */ + long bigMask; /* Used for wrapping indices with extra bit to distinguish full/empty. */ + long smallMask; /* Used for fitting indices to buffer. */ + char *buffer; +} +RingBuffer; + +typedef struct +{ + RingBuffer outFIFO; + PortAudioStream *stream; + int bytesPerFrame; + int samplesPerFrame; +} +PASTREAMIO_Stream; + +/* Values for flags for OpenAudioStream(). */ +/* Keep PABLIO ones*/ + +#define PASTREAMIO_READ (1<<0) +#define PASTREAMIO_WRITE (1<<1) +#define PASTREAMIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE) +#define PASTREAMIO_MONO (1<<2) +#define PASTREAMIO_STEREO (1<<3) + +/*************************************************************************** +** Helper function added to report stream time. */ + +PaTimestamp GetAudioStreamTime( PASTREAMIO_Stream *aStream ){ + return Pa_StreamTime( aStream->stream ) ; +} + + /*************************************************************************** +** Clear buffer. Should only be called when buffer is NOT being read. */ +void RingBuffer_Flush( RingBuffer *rbuf ) +{ + rbuf->writeIndex = rbuf->readIndex = 0; +} + +/*************************************************************************** + * Initialize FIFO. + * numBytes must be power of 2, returns -1 if not. + */ +long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr ) +{ + if( ((numBytes-1) & numBytes) != 0) return -1; /* Not Power of two. */ + rbuf->bufferSize = numBytes; + rbuf->buffer = (char *)dataPtr; + RingBuffer_Flush( rbuf ); + rbuf->bigMask = (numBytes*2)-1; + rbuf->smallMask = (numBytes)-1; + return 0; +} +/*************************************************************************** +** Return number of bytes available for reading. */ +long RingBuffer_GetReadAvailable( RingBuffer *rbuf ) +{ + return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); +} +/*************************************************************************** +** Return number of bytes available for writing. */ +long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ) +{ + return ( rbuf->bufferSize - RingBuffer_GetReadAvailable(rbuf)); +} + + +/*************************************************************************** +** Get address of region(s) to which we can write data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetWriteAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if write is not contiguous. */ + index = rbuf->writeIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} + + +/*************************************************************************** +*/ +long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ) +{ + return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; +} + +/*************************************************************************** +** Get address of region(s) from which we can read data. +** If the region is contiguous, size2 will be zero. +** If non-contiguous, size2 will be the size of second region. +** Returns room available to be written or numBytes, whichever is smaller. +*/ +long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes, + void **dataPtr1, long *sizePtr1, + void **dataPtr2, long *sizePtr2 ) +{ + long index; + long available = RingBuffer_GetReadAvailable( rbuf ); + if( numBytes > available ) numBytes = available; + /* Check to see if read is not contiguous. */ + index = rbuf->readIndex & rbuf->smallMask; + if( (index + numBytes) > rbuf->bufferSize ) + { + /* Write data in two blocks that wrap the buffer. */ + long firstHalf = rbuf->bufferSize - index; + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = firstHalf; + *dataPtr2 = &rbuf->buffer[0]; + *sizePtr2 = numBytes - firstHalf; + } + else + { + *dataPtr1 = &rbuf->buffer[index]; + *sizePtr1 = numBytes; + *dataPtr2 = NULL; + *sizePtr2 = 0; + } + return numBytes; +} +/*************************************************************************** +*/ +long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ) +{ + return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; +} + +/*************************************************************************** +** Return bytes written. */ +long RingBuffer_Write( RingBuffer *rbuf, void *data, long numBytes ) +{ + long size1, size2, numWritten; + void *data1, *data2; + numWritten = RingBuffer_GetWriteRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + + memcpy( data1, data, size1 ); + data = ((char *)data) + size1; + memcpy( data2, data, size2 ); + } + else + { + memcpy( data1, data, size1 ); + } + RingBuffer_AdvanceWriteIndex( rbuf, numWritten ); + return numWritten; +} + +/*************************************************************************** +** Return bytes read. */ +long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ) +{ + long size1, size2, numRead; + void *data1, *data2; + numRead = RingBuffer_GetReadRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 ); + if( size2 > 0 ) + { + memcpy( data, data1, size1 ); + data = ((char *)data) + size1; + memcpy( data, data2, size2 ); + } + else + { + memcpy( data, data1, size1 ); + } + RingBuffer_AdvanceReadIndex( rbuf, numRead ); + return numRead; +} + + +/************************************************************************/ +/******** Functions *****************************************************/ +/************************************************************************/ + +/* Called from PortAudio. + * Read and write data only if there is room in FIFOs. + */ +static int audioIOCallback( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + PaTimestamp outTime, void *userData ) +{ + PASTREAMIO_Stream *data = (PASTREAMIO_Stream*)userData; + long numBytes = data->bytesPerFrame * framesPerBuffer; + (void) outTime; + (void) inputBuffer; + + if( outputBuffer != NULL ) + { + int i; + int numRead = RingBuffer_Read( &data->outFIFO, outputBuffer, numBytes ); + /* Zero out remainder of buffer if we run out of data. */ + for( i=numRead; ibuffer ) free( rbuf->buffer ); + rbuf->buffer = NULL; + return paNoError; +} + +/************************************************************ + * Write data to ring buffer. + * Will not return until all the data has been written. + */ +long WriteAudioStream( PASTREAMIO_Stream *aStream, void *data, long numFrames ) +{ + long bytesWritten; + char *p = (char *) data; + long numBytes = aStream->bytesPerFrame * numFrames; + while( numBytes > 0) + { + bytesWritten = RingBuffer_Write( &aStream->outFIFO, p, numBytes ); + numBytes -= bytesWritten; + p += bytesWritten; + if( numBytes > 0) Pa_Sleep(10); + } + return numFrames; +} + + +/************************************************************ + * Return the number of frames that could be written to the stream without + * having to wait. + */ +long GetAudioStreamWriteable( PASTREAMIO_Stream *aStream ) +{ + int bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + return bytesEmpty / aStream->bytesPerFrame; +} + + + +/************************************************************/ +unsigned long RoundUpToNextPowerOf2( unsigned long n ) +{ + long numBits = 0; + if( ((n-1) & n) == 0) return n; /* Already Power of two. */ + while( n > 0 ) + { + n= n>>1; + numBits++; + } + return (1<samplesPerFrame = ((flags&PASTREAMIO_MONO) != 0) ? 1 : 2; + aStream->bytesPerFrame = bytesPerSample * aStream->samplesPerFrame; + + /* Initialize PortAudio */ + err = Pa_Initialize(); + if( err != paNoError ) goto error; + + /* Warning: numFrames must be larger than amount of data processed per interrupt + * inside PA to prevent glitches. Just to be safe, adjust size upwards. + */ + minNumBuffers = 2 * Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, sampleRate ); + numFrames = minNumBuffers * FRAMES_PER_BUFFER; + numFrames = RoundUpToNextPowerOf2( numFrames ); + + /* Initialize Ring Buffer */ + doWrite = ((flags & PASTREAMIO_WRITE) != 0); + + if(doWrite) + { + err = PASTREAMIO_InitFIFO( &aStream->outFIFO, numFrames, aStream->bytesPerFrame ); + if( err != paNoError ) goto error; + /* Make Write FIFO appear full initially. + numBytes = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + RingBuffer_AdvanceWriteIndex( &aStream->outFIFO, numBytes );*/ + } + + /* Open a PortAudio stream that we will use to communicate with the underlying + * audio drivers. */ + err = Pa_OpenStream( + &aStream->stream, + paNoDevice, + 0 , + format, + NULL, + Pa_GetDefaultOutputDeviceID() , + aStream->samplesPerFrame , + format, + NULL, + sampleRate, + FRAMES_PER_BUFFER, + minNumBuffers, + paClipOff, /* we won't output out of range samples so don't bother clipping them */ + audioIOCallback, + aStream ); + if( err != paNoError ) goto error; + + *rwblPtr = aStream; + return paNoError; + +error: + CloseAudioStream( aStream ); + *rwblPtr = NULL; + return err; +} + +PaError StartAudioStream( PASTREAMIO_Stream *aStream) +{ + PaError err; + err = Pa_StartStream( aStream->stream ); + if( err != paNoError ) goto error; + + return paNoError; +error: + CloseAudioStream( aStream ); + return err; +} + + +/************************************************************/ +PaError CloseAudioStream( PASTREAMIO_Stream *aStream ) +{ + PaError err; + int bytesEmpty; + int byteSize = aStream->outFIFO.bufferSize; + + /* If we are writing data, make sure we play everything written. */ + if( byteSize > 0 ) + { + bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + while( bytesEmpty < byteSize ) + { + Pa_Sleep( 10 ); + bytesEmpty = RingBuffer_GetWriteAvailable( &aStream->outFIFO ); + } + } + + err = Pa_StopStream( aStream->stream ); + if( err != paNoError ) goto error; + err = Pa_CloseStream( aStream->stream ); + if( err != paNoError ) goto error; + Pa_Terminate(); + +error: + PASTREAMIO_TermFIFO( &aStream->outFIFO ); + free( aStream ); + return err; +} + +/* -- end of portaudio specific routines --*/ + +/* portaudio related global types */ +#define PA_SAMPLE_TYPE paInt16 +typedef short SAMPLE; +#define SAMPLE_SILENCE (0) + +PASTREAMIO_Stream *aOutStream; /* our modified stream buffer*/ +SAMPLE *samples; /*local buffer for samples*/ +double latency_sec = 0; + +/* ticks information to be used if the audio stream is not present */ +int currentTicks = -1; + +/* initial state of the audio stream */ +int isPlaying = 0; +PaError err; + +/* Ogg and codec state for demux/decode */ +ogg_sync_state oy; +ogg_page og; +ogg_stream_state vo; +ogg_stream_state to; +theora_info ti; +theora_comment tc; +theora_state td; +vorbis_info vi; +vorbis_dsp_state vd; +vorbis_block vb; +vorbis_comment vc; + +int theora_p=0; +int vorbis_p=0; +int stateflag=0; + +FILE * infile = NULL; + +/* SDL Video playback structures */ +SDL_Surface *screen; +SDL_Overlay *yuv_overlay; +SDL_Rect rect; + +/* single frame video buffering */ +int videobuf_ready=0; +ogg_int64_t videobuf_granulepos=-1; +double videobuf_time=0; + +int audiobuf_ready=0; +ogg_int64_t audiobuf_granulepos=0; /* time position of last sample */ + +static int open_audio(){ + /* this will open one circular audio stream */ + /* build on top of portaudio routines */ + /* implementation based on file pastreamio.c */ + + int numSamples; + int numBytes; + + int minNumBuffers; + int numFrames; + + minNumBuffers = 2 * Pa_GetMinNumBuffers( FRAMES_PER_BUFFER, vi.rate ); + numFrames = minNumBuffers * FRAMES_PER_BUFFER; + numFrames = RoundUpToNextPowerOf2( numFrames ); + + numSamples = numFrames * vi.channels; + numBytes = numSamples * sizeof(SAMPLE); + + samples = (SAMPLE *) malloc( numBytes ); + + /* store our latency calculation here */ + latency_sec = (double) numFrames / vi.rate / vi.channels; + printf( "Latency: %.04f\n", latency_sec ); + + err = OpenAudioStream( &aOutStream, vi.rate, PA_SAMPLE_TYPE, + (PASTREAMIO_WRITE | PASTREAMIO_STEREO) ); + if( err != paNoError ) goto error; + return err; +error: + CloseAudioStream( aOutStream ); + printf( "An error occured while opening the portaudio stream\n" ); + printf( "Error number: %d\n", err ); + printf( "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; + +} + +static int start_audio(){ + err = StartAudioStream(aOutStream); + if( err != paNoError ) goto error; + + return err; +error: + CloseAudioStream( aOutStream ); + printf( "An error occured while opening the portaudio stream\n" ); + printf( "Error number: %d\n", err ); + printf( "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} + +static int audio_close(void){ + err = CloseAudioStream( aOutStream ); + if( err != paNoError ) goto error; + + free(samples); + return err; +error: + Pa_Terminate(); + printf( "An error occured while closing the portaudio stream\n" ); + printf( "Error number: %d\n", err ); + printf( "Error message: %s\n", Pa_GetErrorText( err ) ); + return err; +} + + +double get_time() { + static Uint32 startticks = 0; + double curtime; + if (vorbis_p) { + /* not entirely accurate with the WAVE OUT device, but good enough + at this stage. Needs to be reworked to account for blank audio + data written to the stream... */ + curtime = (double) (GetAudioStreamTime( aOutStream ) / vi.rate) - latency_sec; + if (curtime<0.0) curtime = 0.0; + } else { + /* initialize timer variable if not set yet */ + if (startticks==0) + startticks = SDL_GetTicks(); + curtime = 1.0e-3 * (double)(SDL_GetTicks() - startticks); + } + return curtime; +} + + +static void open_video(void){ + /* taken from player_sample.c test file for theora alpha */ + + if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { + printf("Unable to initialize SDL: %s\n", SDL_GetError()); + exit(1); + } + + screen = SDL_SetVideoMode(ti.frame_width, ti.frame_height, 0, SDL_SWSURFACE); + if ( screen == NULL ) { + printf("Unable to set %dx%d video mode: %s\n", + ti.frame_width,ti.frame_height,SDL_GetError()); + exit(1); + } + + yuv_overlay = SDL_CreateYUVOverlay(ti.frame_width, ti.frame_height, + SDL_YV12_OVERLAY, + screen); + if ( yuv_overlay == NULL ) { + printf("SDL: Couldn't create SDL_yuv_overlay: %s\n", + SDL_GetError()); + exit(1); + } + rect.x = 0; + rect.y = 0; + rect.w = ti.frame_width; + rect.h = ti.frame_height; + + SDL_DisplayYUVOverlay(yuv_overlay, &rect); +} + +static void video_write(void){ + /* taken from player_sample.c test file for theora alpha */ + int i; + yuv_buffer yuv; + int crop_offset; + theora_decode_YUVout(&td,&yuv); + + /* Lock SDL_yuv_overlay */ + if ( SDL_MUSTLOCK(screen) ) { + if ( SDL_LockSurface(screen) < 0 ) return; + } + if (SDL_LockYUVOverlay(yuv_overlay) < 0) return; + + /* let's draw the data (*yuv[3]) on a SDL screen (*screen) */ + /* deal with border stride */ + /* reverse u and v for SDL */ + /* and crop input properly, respecting the encoded frame rect */ + crop_offset=ti.offset_x+yuv.y_stride*ti.offset_y; + for(i=0;ih;i++) + memcpy(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i, + yuv.y+crop_offset+yuv.y_stride*i, + yuv_overlay->w); + crop_offset=(ti.offset_x/2)+(yuv.uv_stride)*(ti.offset_y/2); + for(i=0;ih/2;i++){ + memcpy(yuv_overlay->pixels[1]+yuv_overlay->pitches[1]*i, + yuv.v+crop_offset+yuv.uv_stride*i, + yuv_overlay->w/2); + memcpy(yuv_overlay->pixels[2]+yuv_overlay->pitches[2]*i, + yuv.u+crop_offset+yuv.uv_stride*i, + yuv_overlay->w/2); + } + + /* Unlock SDL_yuv_overlay */ + SDL_UnlockYUVOverlay(yuv_overlay); + if ( SDL_MUSTLOCK(screen) ) { + SDL_UnlockSurface(screen); + } + + /* Show, baby, show! */ + SDL_DisplayYUVOverlay(yuv_overlay, &rect); +} + +static void usage(void){ + printf("Usage: splayer \n" +#ifdef WIN32 + "\n" + "or drag and drop an ogg file over the .exe\n\n" +#endif + ); +} + +/* dump the theora (or vorbis) comment header */ +static int dump_comments(theora_comment *tc){ + int i, len; + char *value; + + printf("Encoded by %s\n",tc->vendor); + if(tc->comments){ + printf("theora comment header:\n"); + for(i=0;icomments;i++){ + if(tc->user_comments[i]){ + len=tc->comment_lengths[i]; + value=malloc(len+1); + memcpy(value,tc->user_comments[i],len); + value[len]='\0'; + printf("\t%s\n", value); + free(value); + } + } + } + return(0); +} + +/* Report the encoder-specified colorspace for the video, if any. + We don't actually make use of the information in this example; + a real player should attempt to perform color correction for + whatever display device it supports. */ +static void report_colorspace(theora_info *ti) +{ + switch(ti->colorspace){ + case OC_CS_UNSPECIFIED: + /* nothing to report */ + break;; + case OC_CS_ITU_REC_470M: + fprintf(stderr," encoder specified ITU Rec 470M color.\n"); + break;; + case OC_CS_ITU_REC_470BG: + fprintf(stderr," encoder specified ITU Rec 470BG color.\n"); + break;; + default: + fprintf(stderr,"warning: encoder specified unknown colorspace (%d).\n", + ti->colorspace); + break;; + } +} + +/* Helper; just grab some more compressed bitstream and sync it for + page extraction */ +int buffer_data(ogg_sync_state *oy){ + char *buffer=ogg_sync_buffer(oy,4096); + int bytes=fread(buffer,1,4096,infile); + ogg_sync_wrote(oy,bytes); + return(bytes); +} + +/* helper: push a page into the appropriate stream */ +/* this can be done blindly; a stream won't accept a page + that doesn't belong to it */ +static int queue_page(ogg_page *page){ + if(theora_p)ogg_stream_pagein(&to,page); + if(vorbis_p)ogg_stream_pagein(&vo,page); + return 0; +} + +void parseHeaders(){ + /* extracted from player_sample.c test file for theora alpha */ + ogg_packet op; + /* Parse the headers */ + /* Only interested in Vorbis/Theora streams */ + while(!stateflag){ + int ret=buffer_data(&oy); + if(ret==0)break; + while(ogg_sync_pageout(&oy,&og)>0){ + ogg_stream_state test; + + /* is this a mandated initial header? If not, stop parsing */ + if(!ogg_page_bos(&og)){ + /* don't leak the page; get it into the appropriate stream */ + queue_page(&og); + stateflag=1; + break; + } + + ogg_stream_init(&test,ogg_page_serialno(&og)); + ogg_stream_pagein(&test,&og); + ogg_stream_packetout(&test,&op); + + /* identify the codec: try theora */ + if(!theora_p && theora_decode_header(&ti,&tc,&op)>=0){ + /* it is theora */ + memcpy(&to,&test,sizeof(test)); + theora_p=1; + }else if(!vorbis_p && vorbis_synthesis_headerin(&vi,&vc,&op)>=0){ + /* it is vorbis */ + memcpy(&vo,&test,sizeof(test)); + vorbis_p=1; + }else{ + /* whatever it is, we don't care about it */ + ogg_stream_clear(&test); + } + } + } + + /* we've now identified all the bitstreams. parse the secondary header packets. */ + while((theora_p && theora_p<3) || (vorbis_p && vorbis_p<3)){ + int ret; + + /* look for further theora headers */ + while(theora_p && (theora_p<3) && (ret=ogg_stream_packetout(&to,&op))){ + if(ret<0){ + printf("Error parsing Theora stream headers; corrupt stream?\n"); + exit(1); + } + if(theora_decode_header(&ti,&tc,&op)){ + printf("Error parsing Theora stream headers; corrupt stream?\n"); + exit(1); + } + theora_p++; + if(theora_p==3)break; + } + + /* look for more vorbis header packets */ + while(vorbis_p && (vorbis_p<3) && (ret=ogg_stream_packetout(&vo,&op))){ + if(ret<0){ + printf("Error parsing Vorbis stream headers; corrupt stream?\n"); + exit(1); + } + if(vorbis_synthesis_headerin(&vi,&vc,&op)){ + printf("Error parsing Vorbis stream headers; corrupt stream?\n"); + exit(1); + } + vorbis_p++; + if(vorbis_p==3)break; + } + + /* The header pages/packets will arrive before anything else we + care about, or the stream is not obeying spec */ + + if(ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); /* demux into the appropriate stream */ + }else{ + int ret=buffer_data(&oy); + if(ret==0){ + fprintf(stderr,"End of file while searching for codec headers.\n"); + exit(1); + } + } + } +} + +int main( int argc, char* argv[] ){ + + int i,j; + ogg_packet op; + SDL_Event event; + int hasdatatobuffer = 1; + int playbackdone = 0; + double now, delay, last_frame_time = 0; + + int frameNum=0; + int skipNum=0; + + /* takes first argument as file to play */ + /* this works better on Windows and is more convenient + for drag and drop ogg files over the .exe */ + + if( argc != 2 ) + { + usage(); + exit(0); + } + + infile = fopen( argv[1], "rb" ); + + /* start up Ogg stream synchronization layer */ + ogg_sync_init(&oy); + + /* init supporting Vorbis structures needed in header parsing */ + vorbis_info_init(&vi); + vorbis_comment_init(&vc); + + /* init supporting Theora structures needed in header parsing */ + theora_comment_init(&tc); + theora_info_init(&ti); + + parseHeaders(); + + /* force audio off */ + /* vorbis_p = 0; */ + + /* initialize decoders */ + if(theora_p){ + theora_decode_init(&td,&ti); + printf("Ogg logical stream %x is Theora %dx%d %.02f fps video\n" + " Frame content is %dx%d with offset (%d,%d).\n", + to.serialno,ti.width,ti.height, (double)ti.fps_numerator/ti.fps_denominator, + ti.frame_width, ti.frame_height, ti.offset_x, ti.offset_y); + report_colorspace(&ti); + dump_comments(&tc); + }else{ + /* tear down the partial theora setup */ + theora_info_clear(&ti); + theora_comment_clear(&tc); + } + if(vorbis_p){ + vorbis_synthesis_init(&vd,&vi); + vorbis_block_init(&vd,&vb); + printf("Ogg logical stream %x is Vorbis %d channel %d Hz audio.\n", + vo.serialno,vi.channels,vi.rate); + }else{ + /* tear down the partial vorbis setup */ + vorbis_info_clear(&vi); + vorbis_comment_clear(&vc); + } + /* open audio */ + if(vorbis_p)open_audio(); + /* open video */ + if(theora_p)open_video(); + + /* our main loop */ + while(!playbackdone){ + + /* break out on SDL quit event */ + if ( SDL_PollEvent ( &event ) ) + { + if ( event.type == SDL_QUIT ) break ; + } + + /* get some audio data */ + while(vorbis_p && !audiobuf_ready){ + int ret; + float **pcm; + int count = 0; + int maxBytesToWrite; + + /* is there pending audio? does it fit our circular buffer without blocking? */ + ret=vorbis_synthesis_pcmout(&vd,&pcm); + maxBytesToWrite = GetAudioStreamWriteable(aOutStream); + + if (maxBytesToWrite<=FRAMES_PER_BUFFER){ + /* break out until there is a significant amount of + data to avoid a series of small write operations. */ + break; + } + /* if there's pending, decoded audio, grab it */ + if((ret>0)&&(maxBytesToWrite>0)){ + + for(i=0;i32767)val=32767; + if(val<-32768)val=-32768; + samples[count]=val; + count++; + } + if(WriteAudioStream( aOutStream, samples, i )) { + if(count==maxBytesToWrite){ + audiobuf_ready=1; + } + } + vorbis_synthesis_read(&vd,i); + + if(vd.granulepos>=0) + audiobuf_granulepos=vd.granulepos-ret+i; + else + audiobuf_granulepos+=i; + + }else{ + + /* no pending audio; is there a pending packet to decode? */ + if(ogg_stream_packetout(&vo,&op)>0){ + if(vorbis_synthesis(&vb,&op)==0) /* test for success! */ + vorbis_synthesis_blockin(&vd,&vb); + }else /* we need more data; break out to suck in another page */ + break; + } + } /* end audio cycle */ + + while(theora_p && !videobuf_ready){ + /* get one video packet... */ + if(ogg_stream_packetout(&to,&op)>0){ + + theora_decode_packetin(&td,&op); + + videobuf_granulepos=td.granulepos; + videobuf_time=theora_granule_time(&td,videobuf_granulepos); + /* update the frame counter */ + frameNum++; + + /* check if this frame time has not passed yet. + If the frame is late we need to decode additonal + ones and keep looping, since theora at this stage + needs to decode all frames */ + now=get_time(); + delay=videobuf_time-now; + if(delay>=0.0){ + /* got a good frame, not late, ready to break out */ + videobuf_ready=1; + }else if(now-last_frame_time>=1.0){ + /* display at least one frame per second, regardless */ + videobuf_ready=1; + }else{ + fprintf(stderr, "dropping frame %d (%.3fs behind)\n", + frameNum, -delay); + } + }else{ + /* need more data */ + break; + } + } + + if(!hasdatatobuffer && !videobuf_ready && !audiobuf_ready){ + isPlaying = 0; + playbackdone = 1; + } + + /* if we're set for the next frame, sleep */ + if((!theora_p || videobuf_ready) && + (!vorbis_p || audiobuf_ready)){ + int ticks = 1.0e3*(videobuf_time-get_time()); + if(ticks>0) + SDL_Delay(ticks); + } + + if(videobuf_ready){ + /* time to write our cached frame */ + video_write(); + videobuf_ready=0; + last_frame_time=get_time(); + + /* if audio has not started (first frame) then start it */ + if ((!isPlaying)&&(vorbis_p)){ + start_audio(); + isPlaying = 1; + } + } + + /* HACK: always look for more audio data */ + audiobuf_ready=0; + + /* buffer compressed data every loop */ + if(hasdatatobuffer){ + hasdatatobuffer=buffer_data(&oy); + if(hasdatatobuffer==0){ + printf("Ogg buffering stopped, end of file reached.\n"); + } + } + + if (ogg_sync_pageout(&oy,&og)>0){ + queue_page(&og); + } + + } /* playbackdone */ + + /* show number of video frames decoded */ + printf( "\n"); + printf( "Frames decoded: %d", frameNum ); + if(skipNum) + printf( " (only %d shown)", frameNum-skipNum); + printf( "\n" ); + + /* tear it all down */ + fclose( infile ); + + if(vorbis_p){ + audio_close(); + + ogg_stream_clear(&vo); + vorbis_block_clear(&vb); + vorbis_dsp_clear(&vd); + vorbis_comment_clear(&vc); + vorbis_info_clear(&vi); + } + if(theora_p){ + ogg_stream_clear(&to); + theora_clear(&td); + theora_comment_clear(&tc); + theora_info_clear(&ti); + } + ogg_sync_clear(&oy); + + printf("\r " + "\nDone.\n"); + + SDL_Quit(); + + return(0); + +} diff --git a/libs/libtheora-1.1/include/Makefile.am b/libs/libtheora-1.1/include/Makefile.am new file mode 100644 index 00000000..4f369ef8 --- /dev/null +++ b/libs/libtheora-1.1/include/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = theora diff --git a/libs/libtheora-1.1/include/theora/Makefile.am b/libs/libtheora-1.1/include/theora/Makefile.am new file mode 100644 index 00000000..a917c6c6 --- /dev/null +++ b/libs/libtheora-1.1/include/theora/Makefile.am @@ -0,0 +1,7 @@ +## Process this file with automake to produce Makefile.in + +theoraincludedir = $(includedir)/theora + +theorainclude_HEADERS = theora.h theoradec.h theoraenc.h codec.h + +noinst_HEADERS = codec.h theoradec.h diff --git a/libs/libtheora-1.1/include/theora/codec.h b/libs/libtheora-1.1/include/theora/codec.h new file mode 100644 index 00000000..7d1f2652 --- /dev/null +++ b/libs/libtheora-1.1/include/theora/codec.h @@ -0,0 +1,591 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp $ + + ********************************************************************/ + +/**\mainpage + * + * \section intro Introduction + * + * This is the documentation for libtheora C API. + * The current reference + * implementation for Theora, a free, + * patent-unencumbered video codec. + * Theora is derived from On2's VP3 codec with additional features and + * integration with Ogg multimedia formats by + * the Xiph.Org Foundation. + * Complete documentation of the format itself is available in + * the Theora + * specification. + * + * \subsection Organization + * + * The functions documented here are actually subdivided into three + * separate libraries: + * - libtheoraenc contains the encoder interface, + * described in \ref encfuncs. + * - libtheoradec contains the decoder interface and + * routines shared with the encoder. + * You must also link to this if you link to libtheoraenc. + * The routines in this library are described in \ref decfuncs and + * \ref basefuncs. + * - libtheora contains the \ref oldfuncs. + * + * New code should link to libtheoradec and, if using encoder + * features, libtheoraenc. Together these two export both + * the standard and the legacy API, so this is all that is needed by + * any code. The older libtheora library is provided just for + * compatibility with older build configurations. + * + * In general the recommended 1.x API symbols can be distinguished + * by their th_ or TH_ namespace prefix. + * The older, legacy API uses theora_ or OC_ + * prefixes instead. + */ + +/**\file + * The shared libtheoradec and libtheoraenc C API. + * You don't need to include this directly.*/ + +#if !defined(_O_THEORA_CODEC_H_) +# define _O_THEORA_CODEC_H_ (1) +# include + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/**\name Return codes*/ +/*@{*/ +/**An invalid pointer was provided.*/ +#define TH_EFAULT (-1) +/**An invalid argument was provided.*/ +#define TH_EINVAL (-10) +/**The contents of the header were incomplete, invalid, or unexpected.*/ +#define TH_EBADHEADER (-20) +/**The header does not belong to a Theora stream.*/ +#define TH_ENOTFORMAT (-21) +/**The bitstream version is too high.*/ +#define TH_EVERSION (-22) +/**The specified function is not implemented.*/ +#define TH_EIMPL (-23) +/**There were errors in the video data packet.*/ +#define TH_EBADPACKET (-24) +/**The decoded packet represented a dropped frame. + The player can continue to display the current frame, as the contents of the + decoded frame buffer have not changed.*/ +#define TH_DUPFRAME (1) +/*@}*/ + +/**The currently defined color space tags. + * See the Theora + * specification, Chapter 4, for exact details on the meaning + * of each of these color spaces.*/ +typedef enum{ + /**The color space was not specified at the encoder. + It may be conveyed by an external means.*/ + TH_CS_UNSPECIFIED, + /**A color space designed for NTSC content.*/ + TH_CS_ITU_REC_470M, + /**A color space designed for PAL/SECAM content.*/ + TH_CS_ITU_REC_470BG, + /**The total number of currently defined color spaces.*/ + TH_CS_NSPACES +}th_colorspace; + +/**The currently defined pixel format tags. + * See the Theora + * specification, Section 4.4, for details on the precise sample + * locations.*/ +typedef enum{ + /**Chroma decimation by 2 in both the X and Y directions (4:2:0). + The Cb and Cr chroma planes are half the width and half the + height of the luma plane.*/ + TH_PF_420, + /**Currently reserved.*/ + TH_PF_RSVD, + /**Chroma decimation by 2 in the X direction (4:2:2). + The Cb and Cr chroma planes are half the width of the luma plane, but full + height.*/ + TH_PF_422, + /**No chroma decimation (4:4:4). + The Cb and Cr chroma planes are full width and full height.*/ + TH_PF_444, + /**The total number of currently defined pixel formats.*/ + TH_PF_NFORMATS +}th_pixel_fmt; + + + +/**A buffer for a single color plane in an uncompressed image. + * This contains the image data in a left-to-right, top-down format. + * Each row of pixels is stored contiguously in memory, but successive + * rows need not be. + * Use \a stride to compute the offset of the next row. + * The encoder accepts both positive \a stride values (top-down in memory) + * and negative (bottom-up in memory). + * The decoder currently always generates images with positive strides.*/ +typedef struct{ + /**The width of this plane.*/ + int width; + /**The height of this plane.*/ + int height; + /**The offset in bytes between successive rows.*/ + int stride; + /**A pointer to the beginning of the first row.*/ + unsigned char *data; +}th_img_plane; + +/**A complete image buffer for an uncompressed frame. + * The chroma planes may be decimated by a factor of two in either + * direction, as indicated by th_info#pixel_fmt. + * The width and height of the Y' plane must be multiples of 16. + * They may need to be cropped for display, using the rectangle + * specified by th_info#pic_x, th_info#pic_y, th_info#pic_width, + * and th_info#pic_height. + * All samples are 8 bits. + * \note The term YUV often used to describe a colorspace is ambiguous. + * The exact parameters of the RGB to YUV conversion process aside, in + * many contexts the U and V channels actually have opposite meanings. + * To avoid this confusion, we are explicit: the name of the color + * channels are Y'CbCr, and they appear in that order, always. + * The prime symbol denotes that the Y channel is non-linear. + * Cb and Cr stand for "Chroma blue" and "Chroma red", respectively.*/ +typedef th_img_plane th_ycbcr_buffer[3]; + +/**Theora bitstream information. + * This contains the basic playback parameters for a stream, and corresponds to + * the initial 'info' header packet. + * To initialize an encoder, the application fills in this structure and + * passes it to th_encode_alloc(). + * A default encoding mode is chosen based on the values of the #quality and + * #target_bitrate fields. + * On decode, it is filled in by th_decode_headerin(), and then passed to + * th_decode_alloc(). + * + * Encoded Theora frames must be a multiple of 16 in size; + * this is what the #frame_width and #frame_height members represent. + * To handle arbitrary picture sizes, a crop rectangle is specified in the + * #pic_x, #pic_y, #pic_width and #pic_height members. + * + * All frame buffers contain pointers to the full, padded frame. + * However, the current encoder will not reference pixels outside of + * the cropped picture region, and the application does not need to fill them + * in. + * The decoder will allocate storage for a full frame, but the + * application should not rely on the padding containing sensible + * data. + * + * It is also generally recommended that the offsets and sizes should still be + * multiples of 2 to avoid chroma sampling shifts when chroma is sub-sampled. + * See the Theora + * specification, Section 4.4, for more details. + * + * Frame rate, in frames per second, is stored as a rational fraction, as is + * the pixel aspect ratio. + * Note that this refers to the aspect ratio of the individual pixels, not of + * the overall frame itself. + * The frame aspect ratio can be computed from pixel aspect ratio using the + * image dimensions.*/ +typedef struct{ + /**\name Theora version + * Bitstream version information.*/ + /*@{*/ + unsigned char version_major; + unsigned char version_minor; + unsigned char version_subminor; + /*@}*/ + /**The encoded frame width. + * This must be a multiple of 16, and less than 1048576.*/ + ogg_uint32_t frame_width; + /**The encoded frame height. + * This must be a multiple of 16, and less than 1048576.*/ + ogg_uint32_t frame_height; + /**The displayed picture width. + * This must be no larger than width.*/ + ogg_uint32_t pic_width; + /**The displayed picture height. + * This must be no larger than height.*/ + ogg_uint32_t pic_height; + /**The X offset of the displayed picture. + * This must be no larger than #frame_width-#pic_width or 255, whichever is + * smaller.*/ + ogg_uint32_t pic_x; + /**The Y offset of the displayed picture. + * This must be no larger than #frame_height-#pic_height, and + * #frame_height-#pic_height-#pic_y must be no larger than 255. + * This slightly funny restriction is due to the fact that the offset is + * specified from the top of the image for consistency with the standard + * graphics left-handed coordinate system used throughout this API, while + * it is stored in the encoded stream as an offset from the bottom.*/ + ogg_uint32_t pic_y; + /**\name Frame rate + * The frame rate, as a fraction. + * If either is 0, the frame rate is undefined.*/ + /*@{*/ + ogg_uint32_t fps_numerator; + ogg_uint32_t fps_denominator; + /*@}*/ + /**\name Aspect ratio + * The aspect ratio of the pixels. + * If either value is zero, the aspect ratio is undefined. + * If not specified by any external means, 1:1 should be assumed. + * The aspect ratio of the full picture can be computed as + * \code + * aspect_numerator*pic_width/(aspect_denominator*pic_height). + * \endcode */ + /*@{*/ + ogg_uint32_t aspect_numerator; + ogg_uint32_t aspect_denominator; + /*@}*/ + /**The color space.*/ + th_colorspace colorspace; + /**The pixel format.*/ + th_pixel_fmt pixel_fmt; + /**The target bit-rate in bits per second. + If initializing an encoder with this struct, set this field to a non-zero + value to activate CBR encoding by default.*/ + int target_bitrate; + /**The target quality level. + Valid values range from 0 to 63, inclusive, with higher values giving + higher quality. + If initializing an encoder with this struct, and #target_bitrate is set + to zero, VBR encoding at this quality will be activated by default.*/ + /*Currently this is set so that a qi of 0 corresponds to distortions of 24 + times the JND, and each increase by 16 halves that value. + This gives us fine discrimination at low qualities, yet effective rate + control at high qualities. + The qi value 63 is special, however. + For this, the highest quality, we use one half of a JND for our threshold. + Due to the lower bounds placed on allowable quantizers in Theora, we will + not actually be able to achieve quality this good, but this should + provide as close to visually lossless quality as Theora is capable of. + We could lift the quantizer restrictions without breaking VP3.1 + compatibility, but this would result in quantized coefficients that are + too large for the current bitstream to be able to store. + We'd have to redesign the token syntax to store these large coefficients, + which would make transcoding complex.*/ + int quality; + /**The amount to shift to extract the last keyframe number from the granule + * position. + * This can be at most 31. + * th_info_init() will set this to a default value (currently 6, + * which is good for streaming applications), but you can set it to 0 to + * make every frame a keyframe. + * The maximum distance between key frames is + * 1<<#keyframe_granule_shift. + * The keyframe frequency can be more finely controlled with + * #TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, which can also be adjusted + * during encoding (for example, to force the next frame to be a keyframe), + * but it cannot be set larger than the amount permitted by this field after + * the headers have been output.*/ + int keyframe_granule_shift; +}th_info; + +/**The comment information. + * + * This structure holds the in-stream metadata corresponding to + * the 'comment' header packet. + * The comment header is meant to be used much like someone jotting a quick + * note on the label of a video. + * It should be a short, to the point text note that can be more than a couple + * words, but not more than a short paragraph. + * + * The metadata is stored as a series of (tag, value) pairs, in + * length-encoded string vectors. + * The first occurrence of the '=' character delimits the tag and value. + * A particular tag may occur more than once, and order is significant. + * The character set encoding for the strings is always UTF-8, but the tag + * names are limited to ASCII, and treated as case-insensitive. + * See the Theora + * specification, Section 6.3.3 for details. + * + * In filling in this structure, th_decode_headerin() will null-terminate + * the user_comment strings for safety. + * However, the bitstream format itself treats them as 8-bit clean vectors, + * possibly containing null characters, and so the length array should be + * treated as their authoritative length. + */ +typedef struct th_comment{ + /**The array of comment string vectors.*/ + char **user_comments; + /**An array of the corresponding length of each vector, in bytes.*/ + int *comment_lengths; + /**The total number of comment strings.*/ + int comments; + /**The null-terminated vendor string. + This identifies the software used to encode the stream.*/ + char *vendor; +}th_comment; + + + +/**A single base matrix.*/ +typedef unsigned char th_quant_base[64]; + +/**A set of \a qi ranges.*/ +typedef struct{ + /**The number of ranges in the set.*/ + int nranges; + /**The size of each of the #nranges ranges. + These must sum to 63.*/ + const int *sizes; + /**#nranges +1 base matrices. + Matrices \a i and i+1 form the endpoints of range \a i.*/ + const th_quant_base *base_matrices; +}th_quant_ranges; + +/**A complete set of quantization parameters. + The quantizer for each coefficient is calculated as: + \code + Q=MAX(MIN(qmin[qti][ci!=0],scale[ci!=0][qi]*base[qti][pli][qi][ci]/100), + 1024). + \endcode + + \a qti is the quantization type index: 0 for intra, 1 for inter. + ci!=0 is 0 for the DC coefficient and 1 for AC coefficients. + \a qi is the quality index, ranging between 0 (low quality) and 63 (high + quality). + \a pli is the color plane index: 0 for Y', 1 for Cb, 2 for Cr. + \a ci is the DCT coefficient index. + Coefficient indices correspond to the normal 2D DCT block + ordering--row-major with low frequencies first--\em not zig-zag order. + + Minimum quantizers are constant, and are given by: + \code + qmin[2][2]={{4,2},{8,4}}. + \endcode + + Parameters that can be stored in the bitstream are as follows: + - The two scale matrices ac_scale and dc_scale. + \code + scale[2][64]={dc_scale,ac_scale}. + \endcode + - The base matrices for each \a qi, \a qti and \a pli (up to 384 in all). + In order to avoid storing a full 384 base matrices, only a sparse set of + matrices are stored, and the rest are linearly interpolated. + This is done as follows. + For each \a qti and \a pli, a series of \a n \a qi ranges is defined. + The size of each \a qi range can vary arbitrarily, but they must sum to + 63. + Then, n+1 matrices are specified, one for each endpoint of the + ranges. + For interpolation purposes, each range's endpoints are the first \a qi + value it contains and one past the last \a qi value it contains. + Fractional values are rounded to the nearest integer, with ties rounded + away from zero. + + Base matrices are stored by reference, so if the same matrices are used + multiple times, they will only appear once in the bitstream. + The bitstream is also capable of omitting an entire set of ranges and + its associated matrices if they are the same as either the previous + set (indexed in row-major order) or if the inter set is the same as the + intra set. + + - Loop filter limit values. + The same limits are used for the loop filter in all color planes, despite + potentially differing levels of quantization in each. + + For the current encoder, scale[ci!=0][qi] must be no greater + than scale[ci!=0][qi-1] and base[qti][pli][qi][ci] must + be no greater than base[qti][pli][qi-1][ci]. + These two conditions ensure that the actual quantizer for a given \a qti, + \a pli, and \a ci does not increase as \a qi increases. + This is not required by the decoder.*/ +typedef struct{ + /**The DC scaling factors.*/ + ogg_uint16_t dc_scale[64]; + /**The AC scaling factors.*/ + ogg_uint16_t ac_scale[64]; + /**The loop filter limit values.*/ + unsigned char loop_filter_limits[64]; + /**The \a qi ranges for each \a ci and \a pli.*/ + th_quant_ranges qi_ranges[2][3]; +}th_quant_info; + + + +/**The number of Huffman tables used by Theora.*/ +#define TH_NHUFFMAN_TABLES (80) +/**The number of DCT token values in each table.*/ +#define TH_NDCT_TOKENS (32) + +/**A Huffman code for a Theora DCT token. + * Each set of Huffman codes in a given table must form a complete, prefix-free + * code. + * There is no requirement that all the tokens in a table have a valid code, + * but the current encoder is not optimized to take advantage of this. + * If each of the five grouops of 16 tables does not contain at least one table + * with a code for every token, then the encoder may fail to encode certain + * frames. + * The complete table in the first group of 16 does not have to be in the same + * place as the complete table in the other groups, but the complete tables in + * the remaining four groups must all be in the same place.*/ +typedef struct{ + /**The bit pattern for the code, with the LSbit of the pattern aligned in + * the LSbit of the word.*/ + ogg_uint32_t pattern; + /**The number of bits in the code. + * This must be between 0 and 32, inclusive.*/ + int nbits; +}th_huff_code; + + + +/**\defgroup basefuncs Functions Shared by Encode and Decode*/ +/*@{*/ +/**\name Basic shared functions*/ +/*@{*/ +/**Retrieves a human-readable string to identify the library vendor and + * version. + * \return the version string.*/ +extern const char *th_version_string(void); +/**Retrieves the library version number. + * This is the highest bitstream version that the encoder library will produce, + * or that the decoder library can decode. + * This number is composed of a 16-bit major version, 8-bit minor version + * and 8 bit sub-version, composed as follows: + * \code + * (VERSION_MAJOR<<16)+(VERSION_MINOR<<8)+(VERSION_SUBMINOR) + * \endcode + * \return the version number.*/ +extern ogg_uint32_t th_version_number(void); +/**Converts a granule position to an absolute frame index, starting at + * 0. + * The granule position is interpreted in the context of a given + * #th_enc_ctx or #th_dec_ctx handle (either will suffice). + * \param _encdec A previously allocated #th_enc_ctx or #th_dec_ctx + * handle. + * \param _granpos The granule position to convert. + * \returns The absolute frame index corresponding to \a _granpos. + * \retval -1 The given granule position was invalid (i.e. negative).*/ +extern ogg_int64_t th_granule_frame(void *_encdec,ogg_int64_t _granpos); +/**Converts a granule position to an absolute time in seconds. + * The granule position is interpreted in the context of a given + * #th_enc_ctx or #th_dec_ctx handle (either will suffice). + * \param _encdec A previously allocated #th_enc_ctx or #th_dec_ctx + * handle. + * \param _granpos The granule position to convert. + * \return The absolute time in seconds corresponding to \a _granpos. + * This is the "end time" for the frame, or the latest time it should + * be displayed. + * It is not the presentation time. + * \retval -1 The given granule position was invalid (i.e. negative).*/ +extern double th_granule_time(void *_encdec,ogg_int64_t _granpos); +/**Determines whether a Theora packet is a header or not. + * This function does no verification beyond checking the packet type bit, so + * it should not be used for bitstream identification; use + * th_decode_headerin() for that. + * As per the Theora specification, an empty (0-byte) packet is treated as a + * data packet (a delta frame with no coded blocks). + * \param _op An ogg_packet containing encoded Theora data. + * \retval 1 The packet is a header packet + * \retval 0 The packet is a video data packet.*/ +extern int th_packet_isheader(ogg_packet *_op); +/**Determines whether a theora packet is a key frame or not. + * This function does no verification beyond checking the packet type and + * key frame bits, so it should not be used for bitstream identification; use + * th_decode_headerin() for that. + * As per the Theora specification, an empty (0-byte) packet is treated as a + * delta frame (with no coded blocks). + * \param _op An ogg_packet containing encoded Theora data. + * \retval 1 The packet contains a key frame. + * \retval 0 The packet contains a delta frame. + * \retval -1 The packet is not a video data packet.*/ +extern int th_packet_iskeyframe(ogg_packet *_op); +/*@}*/ + + +/**\name Functions for manipulating header data*/ +/*@{*/ +/**Initializes a th_info structure. + * This should be called on a freshly allocated #th_info structure before + * attempting to use it. + * \param _info The #th_info struct to initialize.*/ +extern void th_info_init(th_info *_info); +/**Clears a #th_info structure. + * This should be called on a #th_info structure after it is no longer + * needed. + * \param _info The #th_info struct to clear.*/ +extern void th_info_clear(th_info *_info); + +/**Initialize a #th_comment structure. + * This should be called on a freshly allocated #th_comment structure + * before attempting to use it. + * \param _tc The #th_comment struct to initialize.*/ +extern void th_comment_init(th_comment *_tc); +/**Add a comment to an initialized #th_comment structure. + * \note Neither th_comment_add() nor th_comment_add_tag() support + * comments containing null values, although the bitstream format does + * support them. + * To add such comments you will need to manipulate the #th_comment + * structure directly. + * \param _tc The #th_comment struct to add the comment to. + * \param _comment Must be a null-terminated UTF-8 string containing the + * comment in "TAG=the value" form.*/ +extern void th_comment_add(th_comment *_tc, char *_comment); +/**Add a comment to an initialized #th_comment structure. + * \note Neither th_comment_add() nor th_comment_add_tag() support + * comments containing null values, although the bitstream format does + * support them. + * To add such comments you will need to manipulate the #th_comment + * structure directly. + * \param _tc The #th_comment struct to add the comment to. + * \param _tag A null-terminated string containing the tag associated with + * the comment. + * \param _val The corresponding value as a null-terminated string.*/ +extern void th_comment_add_tag(th_comment *_tc,char *_tag,char *_val); +/**Look up a comment value by its tag. + * \param _tc An initialized #th_comment structure. + * \param _tag The tag to look up. + * \param _count The instance of the tag. + * The same tag can appear multiple times, each with a distinct + * value, so an index is required to retrieve them all. + * The order in which these values appear is significant and + * should be preserved. + * Use th_comment_query_count() to get the legal range for + * the \a _count parameter. + * \return A pointer to the queried tag's value. + * This points directly to data in the #th_comment structure. + * It should not be modified or freed by the application, and + * modifications to the structure may invalidate the pointer. + * \retval NULL If no matching tag is found.*/ +extern char *th_comment_query(th_comment *_tc,char *_tag,int _count); +/**Look up the number of instances of a tag. + * Call this first when querying for a specific tag and then iterate over the + * number of instances with separate calls to th_comment_query() to + * retrieve all the values for that tag in order. + * \param _tc An initialized #th_comment structure. + * \param _tag The tag to look up. + * \return The number on instances of this particular tag.*/ +extern int th_comment_query_count(th_comment *_tc,char *_tag); +/**Clears a #th_comment structure. + * This should be called on a #th_comment structure after it is no longer + * needed. + * It will free all memory used by the structure members. + * \param _tc The #th_comment struct to clear.*/ +extern void th_comment_clear(th_comment *_tc); +/*@}*/ +/*@}*/ + + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/libs/libtheora-1.1/include/theora/theora.h b/libs/libtheora-1.1/include/theora/theora.h new file mode 100644 index 00000000..a9b0b010 --- /dev/null +++ b/libs/libtheora-1.1/include/theora/theora.h @@ -0,0 +1,784 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: theora.h,v 1.17 2003/12/06 18:06:19 arc Exp $ + + ********************************************************************/ + +#ifndef _O_THEORA_H_ +#define _O_THEORA_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#include /* for size_t */ + +#include + +/** \file + * The libtheora pre-1.0 legacy C API. + * + * \ingroup oldfuncs + * + * \section intro Introduction + * + * This is the documentation for the libtheora legacy C API, declared in + * the theora.h header, which describes the old interface used before + * the 1.0 release. This API was widely deployed for several years and + * remains supported, but for new code we recommend the cleaner API + * declared in theoradec.h and theoraenc.h. + * + * libtheora is the reference implementation for + * Theora, a free video codec. + * Theora is derived from On2's VP3 codec with improved integration with + * Ogg multimedia formats by Xiph.Org. + * + * \section overview Overview + * + * This library will both decode and encode theora packets to/from raw YUV + * frames. In either case, the packets will most likely either come from or + * need to be embedded in an Ogg stream. Use + * libogg or + * liboggz + * to extract/package these packets. + * + * \section decoding Decoding Process + * + * Decoding can be separated into the following steps: + * -# initialise theora_info and theora_comment structures using + * theora_info_init() and theora_comment_init(): + \verbatim + theora_info info; + theora_comment comment; + + theora_info_init(&info); + theora_comment_init(&comment); + \endverbatim + * -# retrieve header packets from Ogg stream (there should be 3) and decode + * into theora_info and theora_comment structures using + * theora_decode_header(). See \ref identification for more information on + * identifying which packets are theora packets. + \verbatim + int i; + for (i = 0; i < 3; i++) + { + (get a theora packet "op" from the Ogg stream) + theora_decode_header(&info, &comment, op); + } + \endverbatim + * -# initialise the decoder based on the information retrieved into the + * theora_info struct by theora_decode_header(). You will need a + * theora_state struct. + \verbatim + theora_state state; + + theora_decode_init(&state, &info); + \endverbatim + * -# pass in packets and retrieve decoded frames! See the yuv_buffer + * documentation for information on how to retrieve raw YUV data. + \verbatim + yuf_buffer buffer; + while (last packet was not e_o_s) { + (get a theora packet "op" from the Ogg stream) + theora_decode_packetin(&state, op); + theora_decode_YUVout(&state, &buffer); + } + \endverbatim + * + * + * \subsection identification Identifying Theora Packets + * + * All streams inside an Ogg file have a unique serial_no attached to the + * stream. Typically, you will want to + * - retrieve the serial_no for each b_o_s (beginning of stream) page + * encountered within the Ogg file; + * - test the first (only) packet on that page to determine if it is a theora + * packet; + * - once you have found a theora b_o_s page then use the retrieved serial_no + * to identify future packets belonging to the same theora stream. + * + * Note that you \e cannot use theora_packet_isheader() to determine if a + * packet is a theora packet or not, as this function does not perform any + * checking beyond whether a header bit is present. Instead, use the + * theora_decode_header() function and check the return value; or examine the + * header bytes at the beginning of the Ogg page. + */ + + +/** \defgroup oldfuncs Legacy pre-1.0 C API */ +/* @{ */ + +/** + * A YUV buffer for passing uncompressed frames to and from the codec. + * This holds a Y'CbCr frame in planar format. The CbCr planes can be + * subsampled and have their own separate dimensions and row stride + * offsets. Note that the strides may be negative in some + * configurations. For theora the width and height of the largest plane + * must be a multiple of 16. The actual meaningful picture size and + * offset are stored in the theora_info structure; frames returned by + * the decoder may need to be cropped for display. + * + * All samples are 8 bits. Within each plane samples are ordered by + * row from the top of the frame to the bottom. Within each row samples + * are ordered from left to right. + * + * During decode, the yuv_buffer struct is allocated by the user, but all + * fields (including luma and chroma pointers) are filled by the library. + * These pointers address library-internal memory and their contents should + * not be modified. + * + * Conversely, during encode the user allocates the struct and fills out all + * fields. The user also manages the data addressed by the luma and chroma + * pointers. See the encoder_example.c and dump_video.c example files in + * theora/examples/ for more information. + */ +typedef struct { + int y_width; /**< Width of the Y' luminance plane */ + int y_height; /**< Height of the luminance plane */ + int y_stride; /**< Offset in bytes between successive rows */ + + int uv_width; /**< Width of the Cb and Cr chroma planes */ + int uv_height; /**< Height of the chroma planes */ + int uv_stride; /**< Offset between successive chroma rows */ + unsigned char *y; /**< Pointer to start of luminance data */ + unsigned char *u; /**< Pointer to start of Cb data */ + unsigned char *v; /**< Pointer to start of Cr data */ + +} yuv_buffer; + +/** + * A Colorspace. + */ +typedef enum { + OC_CS_UNSPECIFIED, /**< The colorspace is unknown or unspecified */ + OC_CS_ITU_REC_470M, /**< This is the best option for 'NTSC' content */ + OC_CS_ITU_REC_470BG, /**< This is the best option for 'PAL' content */ + OC_CS_NSPACES /**< This marks the end of the defined colorspaces */ +} theora_colorspace; + +/** + * A Chroma subsampling + * + * These enumerate the available chroma subsampling options supported + * by the theora format. See Section 4.4 of the specification for + * exact definitions. + */ +typedef enum { + OC_PF_420, /**< Chroma subsampling by 2 in each direction (4:2:0) */ + OC_PF_RSVD, /**< Reserved value */ + OC_PF_422, /**< Horizonatal chroma subsampling by 2 (4:2:2) */ + OC_PF_444 /**< No chroma subsampling at all (4:4:4) */ +} theora_pixelformat; + +/** + * Theora bitstream info. + * Contains the basic playback parameters for a stream, + * corresponding to the initial 'info' header packet. + * + * Encoded theora frames must be a multiple of 16 in width and height. + * To handle other frame sizes, a crop rectangle is specified in + * frame_height and frame_width, offset_x and * offset_y. The offset + * and size should still be a multiple of 2 to avoid chroma sampling + * shifts. Offset values in this structure are measured from the + * upper left of the image. + * + * Frame rate, in frames per second, is stored as a rational + * fraction. Aspect ratio is also stored as a rational fraction, and + * refers to the aspect ratio of the frame pixels, not of the + * overall frame itself. + * + * See + * examples/encoder_example.c for usage examples of the + * other paramters and good default settings for the encoder parameters. + */ +typedef struct { + ogg_uint32_t width; /**< encoded frame width */ + ogg_uint32_t height; /**< encoded frame height */ + ogg_uint32_t frame_width; /**< display frame width */ + ogg_uint32_t frame_height; /**< display frame height */ + ogg_uint32_t offset_x; /**< horizontal offset of the displayed frame */ + ogg_uint32_t offset_y; /**< vertical offset of the displayed frame */ + ogg_uint32_t fps_numerator; /**< frame rate numerator **/ + ogg_uint32_t fps_denominator; /**< frame rate denominator **/ + ogg_uint32_t aspect_numerator; /**< pixel aspect ratio numerator */ + ogg_uint32_t aspect_denominator; /**< pixel aspect ratio denominator */ + theora_colorspace colorspace; /**< colorspace */ + int target_bitrate; /**< nominal bitrate in bits per second */ + int quality; /**< Nominal quality setting, 0-63 */ + int quick_p; /**< Quick encode/decode */ + + /* decode only */ + unsigned char version_major; + unsigned char version_minor; + unsigned char version_subminor; + + void *codec_setup; + + /* encode only */ + int dropframes_p; + int keyframe_auto_p; + ogg_uint32_t keyframe_frequency; + ogg_uint32_t keyframe_frequency_force; /* also used for decode init to + get granpos shift correct */ + ogg_uint32_t keyframe_data_target_bitrate; + ogg_int32_t keyframe_auto_threshold; + ogg_uint32_t keyframe_mindistance; + ogg_int32_t noise_sensitivity; + ogg_int32_t sharpness; + + theora_pixelformat pixelformat; /**< chroma subsampling mode to expect */ + +} theora_info; + +/** Codec internal state and context. + */ +typedef struct{ + theora_info *i; + ogg_int64_t granulepos; + + void *internal_encode; + void *internal_decode; + +} theora_state; + +/** + * Comment header metadata. + * + * This structure holds the in-stream metadata corresponding to + * the 'comment' header packet. + * + * Meta data is stored as a series of (tag, value) pairs, in + * length-encoded string vectors. The first occurence of the + * '=' character delimits the tag and value. A particular tag + * may occur more than once. The character set encoding for + * the strings is always UTF-8, but the tag names are limited + * to case-insensitive ASCII. See the spec for details. + * + * In filling in this structure, theora_decode_header() will + * null-terminate the user_comment strings for safety. However, + * the bitstream format itself treats them as 8-bit clean, + * and so the length array should be treated as authoritative + * for their length. + */ +typedef struct theora_comment{ + char **user_comments; /**< An array of comment string vectors */ + int *comment_lengths; /**< An array of corresponding string vector lengths in bytes */ + int comments; /**< The total number of comment string vectors */ + char *vendor; /**< The vendor string identifying the encoder, null terminated */ + +} theora_comment; + + +/**\name theora_control() codes */ +/* \anchor decctlcodes_old + * These are the available request codes for theora_control() + * when called with a decoder instance. + * By convention decoder control codes are odd, to distinguish + * them from \ref encctlcodes_old "encoder control codes" which + * are even. + * + * Note that since the 1.0 release, both the legacy and the final + * implementation accept all the same control codes, but only the + * final API declares the newer codes. + * + * Keep any experimental or vendor-specific values above \c 0x8000.*/ + +/*@{*/ + +/**Get the maximum post-processing level. + * The decoder supports a post-processing filter that can improve + * the appearance of the decoded images. This returns the highest + * level setting for this post-processor, corresponding to maximum + * improvement and computational expense. + */ +#define TH_DECCTL_GET_PPLEVEL_MAX (1) + +/**Set the post-processing level. + * Sets the level of post-processing to use when decoding the + * compressed stream. This must be a value between zero (off) + * and the maximum returned by TH_DECCTL_GET_PPLEVEL_MAX. + */ +#define TH_DECCTL_SET_PPLEVEL (3) + +/**Sets the maximum distance between key frames. + * This can be changed during an encode, but will be bounded by + * 1<. + * If it is set before encoding begins, th_info#keyframe_granule_shift will + * be enlarged appropriately. + * + * \param[in] buf ogg_uint32_t: The maximum distance between key + * frames. + * \param[out] buf ogg_uint32_t: The actual maximum distance set. + * \retval OC_FAULT \a theora_state or \a buf is NULL. + * \retval OC_EINVAL \a buf_sz is not sizeof(ogg_uint32_t). + * \retval OC_IMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE (4) + +/**Set the granule position. + * Call this after a seek, to update the internal granulepos + * in the decoder, to insure that subsequent frames are marked + * properly. If you track timestamps yourself and do not use + * the granule postion returned by the decoder, then you do + * not need to use this control. + */ +#define TH_DECCTL_SET_GRANPOS (5) + +/**\anchor encctlcodes_old */ + +/**Sets the quantization parameters to use. + * The parameters are copied, not stored by reference, so they can be freed + * after this call. + * NULL may be specified to revert to the default parameters. + * + * \param[in] buf #th_quant_info + * \retval OC_FAULT \a theora_state is NULL. + * \retval OC_EINVAL Encoding has already begun, the quantization parameters + * are not acceptable to this version of the encoder, + * \a buf is NULL and \a buf_sz is not zero, + * or \a buf is non-NULL and \a buf_sz is + * not sizeof(#th_quant_info). + * \retval OC_IMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_QUANT_PARAMS (2) + +/**Disables any encoder features that would prevent lossless transcoding back + * to VP3. + * This primarily means disabling block-level QI values and not using 4MV mode + * when any of the luma blocks in a macro block are not coded. + * It also includes using the VP3 quantization tables and Huffman codes; if you + * set them explicitly after calling this function, the resulting stream will + * not be VP3-compatible. + * If you enable VP3-compatibility when encoding 4:2:2 or 4:4:4 source + * material, or when using a picture region smaller than the full frame (e.g. + * a non-multiple-of-16 width or height), then non-VP3 bitstream features will + * still be disabled, but the stream will still not be VP3-compatible, as VP3 + * was not capable of encoding such formats. + * If you call this after encoding has already begun, then the quantization + * tables and codebooks cannot be changed, but the frame-level features will + * be enabled or disabled as requested. + * + * \param[in] buf int: a non-zero value to enable VP3 compatibility, + * or 0 to disable it (the default). + * \param[out] buf int: 1 if all bitstream features required for + * VP3-compatibility could be set, and 0 otherwise. + * The latter will be returned if the pixel format is not + * 4:2:0, the picture region is smaller than the full frame, + * or if encoding has begun, preventing the quantization + * tables and codebooks from being set. + * \retval OC_FAULT \a theora_state or \a buf is NULL. + * \retval OC_EINVAL \a buf_sz is not sizeof(int). + * \retval OC_IMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_VP3_COMPATIBLE (10) + +/**Gets the maximum speed level. + * Higher speed levels favor quicker encoding over better quality per bit. + * Depending on the encoding mode, and the internal algorithms used, quality + * may actually improve, but in this case bitrate will also likely increase. + * In any case, overall rate/distortion performance will probably decrease. + * The maximum value, and the meaning of each value, may change depending on + * the current encoding mode (VBR vs. CQI, etc.). + * + * \param[out] buf int: The maximum encoding speed level. + * \retval OC_FAULT \a theora_state or \a buf is NULL. + * \retval OC_EINVAL \a buf_sz is not sizeof(int). + * \retval OC_IMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_GET_SPLEVEL_MAX (12) + +/**Sets the speed level. + * By default a speed value of 1 is used. + * + * \param[in] buf int: The new encoding speed level. + * 0 is slowest, larger values use less CPU. + * \retval OC_FAULT \a theora_state or \a buf is NULL. + * \retval OC_EINVAL \a buf_sz is not sizeof(int), or the + * encoding speed level is out of bounds. + * The maximum encoding speed level may be + * implementation- and encoding mode-specific, and can be + * obtained via #TH_ENCCTL_GET_SPLEVEL_MAX. + * \retval OC_IMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_SET_SPLEVEL (14) + +/*@}*/ + +#define OC_FAULT -1 /**< General failure */ +#define OC_EINVAL -10 /**< Library encountered invalid internal data */ +#define OC_DISABLED -11 /**< Requested action is disabled */ +#define OC_BADHEADER -20 /**< Header packet was corrupt/invalid */ +#define OC_NOTFORMAT -21 /**< Packet is not a theora packet */ +#define OC_VERSION -22 /**< Bitstream version is not handled */ +#define OC_IMPL -23 /**< Feature or action not implemented */ +#define OC_BADPACKET -24 /**< Packet is corrupt */ +#define OC_NEWPACKET -25 /**< Packet is an (ignorable) unhandled extension */ +#define OC_DUPFRAME 1 /**< Packet is a dropped frame */ + +/** + * Retrieve a human-readable string to identify the encoder vendor and version. + * \returns A version string. + */ +extern const char *theora_version_string(void); + +/** + * Retrieve a 32-bit version number. + * This number is composed of a 16-bit major version, 8-bit minor version + * and 8 bit sub-version, composed as follows: +
+   (VERSION_MAJOR<<16) + (VERSION_MINOR<<8) + (VERSION_SUB)
+
+* \returns The version number. +*/ +extern ogg_uint32_t theora_version_number(void); + +/** + * Initialize the theora encoder. + * \param th The theora_state handle to initialize for encoding. + * \param ti A theora_info struct filled with the desired encoding parameters. + * \retval 0 Success + */ +extern int theora_encode_init(theora_state *th, theora_info *ti); + +/** + * Submit a YUV buffer to the theora encoder. + * \param t A theora_state handle previously initialized for encoding. + * \param yuv A buffer of YUV data to encode. Note that both the yuv_buffer + * struct and the luma/chroma buffers within should be allocated by + * the user. + * \retval OC_EINVAL Encoder is not ready, or is finished. + * \retval -1 The size of the given frame differs from those previously input + * \retval 0 Success + */ +extern int theora_encode_YUVin(theora_state *t, yuv_buffer *yuv); + +/** + * Request the next packet of encoded video. + * The encoded data is placed in a user-provided ogg_packet structure. + * \param t A theora_state handle previously initialized for encoding. + * \param last_p whether this is the last packet the encoder should produce. + * \param op An ogg_packet structure to fill. libtheora will set all + * elements of this structure, including a pointer to encoded + * data. The memory for the encoded data is owned by libtheora. + * \retval 0 No internal storage exists OR no packet is ready + * \retval -1 The encoding process has completed + * \retval 1 Success + */ +extern int theora_encode_packetout( theora_state *t, int last_p, + ogg_packet *op); + +/** + * Request a packet containing the initial header. + * A pointer to the header data is placed in a user-provided ogg_packet + * structure. + * \param t A theora_state handle previously initialized for encoding. + * \param op An ogg_packet structure to fill. libtheora will set all + * elements of this structure, including a pointer to the header + * data. The memory for the header data is owned by libtheora. + * \retval 0 Success + */ +extern int theora_encode_header(theora_state *t, ogg_packet *op); + +/** + * Request a comment header packet from provided metadata. + * A pointer to the comment data is placed in a user-provided ogg_packet + * structure. + * \param tc A theora_comment structure filled with the desired metadata + * \param op An ogg_packet structure to fill. libtheora will set all + * elements of this structure, including a pointer to the encoded + * comment data. The memory for the comment data is owned by + * libtheora. + * \retval 0 Success + */ +extern int theora_encode_comment(theora_comment *tc, ogg_packet *op); + +/** + * Request a packet containing the codebook tables for the stream. + * A pointer to the codebook data is placed in a user-provided ogg_packet + * structure. + * \param t A theora_state handle previously initialized for encoding. + * \param op An ogg_packet structure to fill. libtheora will set all + * elements of this structure, including a pointer to the codebook + * data. The memory for the header data is owned by libtheora. + * \retval 0 Success + */ +extern int theora_encode_tables(theora_state *t, ogg_packet *op); + +/** + * Decode an Ogg packet, with the expectation that the packet contains + * an initial header, comment data or codebook tables. + * + * \param ci A theora_info structure to fill. This must have been previously + * initialized with theora_info_init(). If \a op contains an initial + * header, theora_decode_header() will fill \a ci with the + * parsed header values. If \a op contains codebook tables, + * theora_decode_header() will parse these and attach an internal + * representation to \a ci->codec_setup. + * \param cc A theora_comment structure to fill. If \a op contains comment + * data, theora_decode_header() will fill \a cc with the parsed + * comments. + * \param op An ogg_packet structure which you expect contains an initial + * header, comment data or codebook tables. + * + * \retval OC_BADHEADER \a op is NULL; OR the first byte of \a op->packet + * has the signature of an initial packet, but op is + * not a b_o_s packet; OR this packet has the signature + * of an initial header packet, but an initial header + * packet has already been seen; OR this packet has the + * signature of a comment packet, but the initial header + * has not yet been seen; OR this packet has the signature + * of a comment packet, but contains invalid data; OR + * this packet has the signature of codebook tables, + * but the initial header or comments have not yet + * been seen; OR this packet has the signature of codebook + * tables, but contains invalid data; + * OR the stream being decoded has a compatible version + * but this packet does not have the signature of a + * theora initial header, comments, or codebook packet + * \retval OC_VERSION The packet data of \a op is an initial header with + * a version which is incompatible with this version of + * libtheora. + * \retval OC_NEWPACKET the stream being decoded has an incompatible (future) + * version and contains an unknown signature. + * \retval 0 Success + * + * \note The normal usage is that theora_decode_header() be called on the + * first three packets of a theora logical bitstream in succession. + */ +extern int theora_decode_header(theora_info *ci, theora_comment *cc, + ogg_packet *op); + +/** + * Initialize a theora_state handle for decoding. + * \param th The theora_state handle to initialize. + * \param c A theora_info struct filled with the desired decoding parameters. + * This is of course usually obtained from a previous call to + * theora_decode_header(). + * \retval 0 Success + */ +extern int theora_decode_init(theora_state *th, theora_info *c); + +/** + * Input a packet containing encoded data into the theora decoder. + * \param th A theora_state handle previously initialized for decoding. + * \param op An ogg_packet containing encoded theora data. + * \retval 0 Success + * \retval OC_BADPACKET \a op does not contain encoded video data + */ +extern int theora_decode_packetin(theora_state *th,ogg_packet *op); + +/** + * Output the next available frame of decoded YUV data. + * \param th A theora_state handle previously initialized for decoding. + * \param yuv A yuv_buffer in which libtheora should place the decoded data. + * Note that the buffer struct itself is allocated by the user, but + * that the luma and chroma pointers will be filled in by the + * library. Also note that these luma and chroma regions should be + * considered read-only by the user. + * \retval 0 Success + */ +extern int theora_decode_YUVout(theora_state *th,yuv_buffer *yuv); + +/** + * Report whether a theora packet is a header or not + * This function does no verification beyond checking the header + * flag bit so it should not be used for bitstream identification; + * use theora_decode_header() for that. + * + * \param op An ogg_packet containing encoded theora data. + * \retval 1 The packet is a header packet + * \retval 0 The packet is not a header packet (and so contains frame data) + * + * Thus function was added in the 1.0alpha4 release. + */ +extern int theora_packet_isheader(ogg_packet *op); + +/** + * Report whether a theora packet is a keyframe or not + * + * \param op An ogg_packet containing encoded theora data. + * \retval 1 The packet contains a keyframe image + * \retval 0 The packet is contains an interframe delta + * \retval -1 The packet is not an image data packet at all + * + * Thus function was added in the 1.0alpha4 release. + */ +extern int theora_packet_iskeyframe(ogg_packet *op); + +/** + * Report the granulepos shift radix + * + * When embedded in Ogg, Theora uses a two-part granulepos, + * splitting the 64-bit field into two pieces. The more-significant + * section represents the frame count at the last keyframe, + * and the less-significant section represents the count of + * frames since the last keyframe. In this way the overall + * field is still non-decreasing with time, but usefully encodes + * a pointer to the last keyframe, which is necessary for + * correctly restarting decode after a seek. + * + * This function reports the number of bits used to represent + * the distance to the last keyframe, and thus how the granulepos + * field must be shifted or masked to obtain the two parts. + * + * Since libtheora returns compressed data in an ogg_packet + * structure, this may be generally useful even if the Theora + * packets are not being used in an Ogg container. + * + * \param ti A previously initialized theora_info struct + * \returns The bit shift dividing the two granulepos fields + * + * This function was added in the 1.0alpha5 release. + */ +int theora_granule_shift(theora_info *ti); + +/** + * Convert a granulepos to an absolute frame index, starting at 0. + * The granulepos is interpreted in the context of a given theora_state handle. + * + * Note that while the granulepos encodes the frame count (i.e. starting + * from 1) this call returns the frame index, starting from zero. Thus + * One can calculate the presentation time by multiplying the index by + * the rate. + * + * \param th A previously initialized theora_state handle (encode or decode) + * \param granulepos The granulepos to convert. + * \returns The frame index corresponding to \a granulepos. + * \retval -1 The given granulepos is undefined (i.e. negative) + * + * Thus function was added in the 1.0alpha4 release. + */ +extern ogg_int64_t theora_granule_frame(theora_state *th,ogg_int64_t granulepos); + +/** + * Convert a granulepos to absolute time in seconds. The granulepos is + * interpreted in the context of a given theora_state handle, and gives + * the end time of a frame's presentation as used in Ogg mux ordering. + * + * \param th A previously initialized theora_state handle (encode or decode) + * \param granulepos The granulepos to convert. + * \returns The absolute time in seconds corresponding to \a granulepos. + * This is the "end time" for the frame, or the latest time it should + * be displayed. + * It is not the presentation time. + * \retval -1. The given granulepos is undefined (i.e. negative), or + * \retval -1. The function has been disabled because floating + * point support is not available. + */ +extern double theora_granule_time(theora_state *th,ogg_int64_t granulepos); + +/** + * Initialize a theora_info structure. All values within the given theora_info + * structure are initialized, and space is allocated within libtheora for + * internal codec setup data. + * \param c A theora_info struct to initialize. + */ +extern void theora_info_init(theora_info *c); + +/** + * Clear a theora_info structure. All values within the given theora_info + * structure are cleared, and associated internal codec setup data is freed. + * \param c A theora_info struct to initialize. + */ +extern void theora_info_clear(theora_info *c); + +/** + * Free all internal data associated with a theora_state handle. + * \param t A theora_state handle. + */ +extern void theora_clear(theora_state *t); + +/** + * Initialize an allocated theora_comment structure + * \param tc An allocated theora_comment structure + **/ +extern void theora_comment_init(theora_comment *tc); + +/** + * Add a comment to an initialized theora_comment structure + * \param tc A previously initialized theora comment structure + * \param comment A null-terminated string encoding the comment in the form + * "TAG=the value" + * + * Neither theora_comment_add() nor theora_comment_add_tag() support + * comments containing null values, although the bitstream format + * supports this. To add such comments you will need to manipulate + * the theora_comment structure directly. + **/ + +extern void theora_comment_add(theora_comment *tc, char *comment); + +/** + * Add a comment to an initialized theora_comment structure. + * \param tc A previously initialized theora comment structure + * \param tag A null-terminated string containing the tag + * associated with the comment. + * \param value The corresponding value as a null-terminated string + * + * Neither theora_comment_add() nor theora_comment_add_tag() support + * comments containing null values, although the bitstream format + * supports this. To add such comments you will need to manipulate + * the theora_comment structure directly. + **/ +extern void theora_comment_add_tag(theora_comment *tc, + char *tag, char *value); + +/** + * Look up a comment value by tag. + * \param tc Tn initialized theora_comment structure + * \param tag The tag to look up + * \param count The instance of the tag. The same tag can appear multiple + * times, each with a distinct and ordered value, so an index + * is required to retrieve them all. + * \returns A pointer to the queried tag's value + * \retval NULL No matching tag is found + * + * \note Use theora_comment_query_count() to get the legal range for the + * count parameter. + **/ + +extern char *theora_comment_query(theora_comment *tc, char *tag, int count); + +/** Look up the number of instances of a tag. + * \param tc An initialized theora_comment structure + * \param tag The tag to look up + * \returns The number on instances of a particular tag. + * + * Call this first when querying for a specific tag and then interate + * over the number of instances with separate calls to + * theora_comment_query() to retrieve all instances in order. + **/ +extern int theora_comment_query_count(theora_comment *tc, char *tag); + +/** + * Clear an allocated theora_comment struct so that it can be freed. + * \param tc An allocated theora_comment structure. + **/ +extern void theora_comment_clear(theora_comment *tc); + +/**Encoder control function. + * This is used to provide advanced control the encoding process. + * \param th A #theora_state handle. + * \param req The control code to process. + * See \ref encctlcodes_old "the list of available + * control codes" for details. + * \param buf The parameters for this control code. + * \param buf_sz The size of the parameter buffer.*/ +extern int theora_control(theora_state *th,int req,void *buf,size_t buf_sz); + +/* @} */ /* end oldfuncs doxygen group */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _O_THEORA_H_ */ diff --git a/libs/libtheora-1.1/include/theora/theoradec.h b/libs/libtheora-1.1/include/theora/theoradec.h new file mode 100644 index 00000000..41bacb1f --- /dev/null +++ b/libs/libtheora-1.1/include/theora/theoradec.h @@ -0,0 +1,325 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp $ + + ********************************************************************/ + +/**\file + * The libtheoradec C decoding API.*/ + +#if !defined(_O_THEORA_THEORADEC_H_) +# define _O_THEORA_THEORADEC_H_ (1) +# include +# include +# include "codec.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/**\name th_decode_ctl() codes + * \anchor decctlcodes + * These are the available request codes for th_decode_ctl(). + * By convention, these are odd, to distinguish them from the + * \ref encctlcodes "encoder control codes". + * Keep any experimental or vendor-specific values above \c 0x8000.*/ +/*@{*/ +/**Gets the maximum post-processing level. + * The decoder supports a post-processing filter that can improve + * the appearance of the decoded images. This returns the highest + * level setting for this post-processor, corresponding to maximum + * improvement and computational expense. + * + * \param[out] _buf int: The maximum post-processing level. + * \retval TH_EFAULT \a _dec_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int). + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_DECCTL_GET_PPLEVEL_MAX (1) +/**Sets the post-processing level. + * By default, post-processing is disabled. + * + * Sets the level of post-processing to use when decoding the + * compressed stream. This must be a value between zero (off) + * and the maximum returned by TH_DECCTL_GET_PPLEVEL_MAX. + * + * \param[in] _buf int: The new post-processing level. + * 0 to disable; larger values use more CPU. + * \retval TH_EFAULT \a _dec_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int), or the + * post-processing level is out of bounds. + * The maximum post-processing level may be + * implementation-specific, and can be obtained via + * #TH_DECCTL_GET_PPLEVEL_MAX. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_DECCTL_SET_PPLEVEL (3) +/**Sets the granule position. + * Call this after a seek, before decoding the first frame, to ensure that the + * proper granule position is returned for all subsequent frames. + * If you track timestamps yourself and do not use the granule position + * returned by the decoder, then you need not call this function. + * + * \param[in] _buf ogg_int64_t: The granule position of the next + * frame. + * \retval TH_EFAULT \a _dec_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(ogg_int64_t), or the + * granule position is negative.*/ +#define TH_DECCTL_SET_GRANPOS (5) +/**Sets the striped decode callback function. + * If set, this function will be called as each piece of a frame is fully + * decoded in th_decode_packetin(). + * You can pass in a #th_stripe_callback with + * th_stripe_callback#stripe_decoded set to NULL to disable the + * callbacks at any point. + * Enabling striped decode does not prevent you from calling + * th_decode_ycbcr_out() after the frame is fully decoded. + * + * \param[in] _buf #th_stripe_callback: The callback parameters. + * \retval TH_EFAULT \a _dec_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not + * sizeof(th_stripe_callback).*/ +#define TH_DECCTL_SET_STRIPE_CB (7) + +/**Enables telemetry and sets the macroblock display mode */ +#define TH_DECCTL_SET_TELEMETRY_MBMODE (9) +/**Enables telemetry and sets the motion vector display mode */ +#define TH_DECCTL_SET_TELEMETRY_MV (11) +/**Enables telemetry and sets the adaptive quantization display mode */ +#define TH_DECCTL_SET_TELEMETRY_QI (13) +/**Enables telemetry and sets the bitstream breakdown visualization mode */ +#define TH_DECCTL_SET_TELEMETRY_BITS (15) +/*@}*/ + + + +/**A callback function for striped decode. + * This is a function pointer to an application-provided function that will be + * called each time a section of the image is fully decoded in + * th_decode_packetin(). + * This allows the application to process the section immediately, while it is + * still in cache. + * Note that the frame is decoded bottom to top, so \a _yfrag0 will steadily + * decrease with each call until it reaches 0, at which point the full frame + * is decoded. + * The number of fragment rows made available in each call depends on the pixel + * format and the number of post-processing filters enabled, and may not even + * be constant for the entire frame. + * If a non-NULL \a _granpos pointer is passed to + * th_decode_packetin(), the granule position for the frame will be stored + * in it before the first callback is made. + * If an entire frame is dropped (a 0-byte packet), then no callbacks will be + * made at all for that frame. + * \param _ctx An application-provided context pointer. + * \param _buf The image buffer for the decoded frame. + * \param _yfrag0 The Y coordinate of the first row of 8x8 fragments + * decoded. + * Multiply this by 8 to obtain the pixel row number in the + * luma plane. + * If the chroma planes are subsampled in the Y direction, + * this will always be divisible by two. + * \param _yfrag_end The Y coordinate of the first row of 8x8 fragments past + * the newly decoded section. + * If the chroma planes are subsampled in the Y direction, + * this will always be divisible by two. + * I.e., this section contains fragment rows + * \a _yfrag0 ...\a _yfrag_end -1.*/ +typedef void (*th_stripe_decoded_func)(void *_ctx,th_ycbcr_buffer _buf, + int _yfrag0,int _yfrag_end); + +/**The striped decode callback data to pass to #TH_DECCTL_SET_STRIPE_CB.*/ +typedef struct{ + /**An application-provided context pointer. + * This will be passed back verbatim to the application.*/ + void *ctx; + /**The callback function pointer.*/ + th_stripe_decoded_func stripe_decoded; +}th_stripe_callback; + + + +/**\name Decoder state + The following data structures are opaque, and their contents are not + publicly defined by this API. + Referring to their internals directly is unsupported, and may break without + warning.*/ +/*@{*/ +/**The decoder context.*/ +typedef struct th_dec_ctx th_dec_ctx; +/**Setup information. + This contains auxiliary information (Huffman tables and quantization + parameters) decoded from the setup header by th_decode_headerin() to be + passed to th_decode_alloc(). + It can be re-used to initialize any number of decoders, and can be freed + via th_setup_free() at any time.*/ +typedef struct th_setup_info th_setup_info; +/*@}*/ + + + +/**\defgroup decfuncs Functions for Decoding*/ +/*@{*/ +/**\name Functions for decoding + * You must link to libtheoradec if you use any of the + * functions in this section. + * + * The functions are listed in the order they are used in a typical decode. + * The basic steps are: + * - Parse the header packets by repeatedly calling th_decode_headerin(). + * - Allocate a #th_dec_ctx handle with th_decode_alloc(). + * - Call th_setup_free() to free any memory used for codec setup + * information. + * - Perform any additional decoder configuration with th_decode_ctl(). + * - For each video data packet: + * - Submit the packet to the decoder via th_decode_packetin(). + * - Retrieve the uncompressed video data via th_decode_ycbcr_out(). + * - Call th_decode_free() to release all decoder memory.*/ +/*@{*/ +/**Decodes the header packets of a Theora stream. + * This should be called on the initial packets of the stream, in succession, + * until it returns 0, indicating that all headers have been + * processed, or an error is encountered. + * At least three header packets are required, and additional optional header + * packets may follow. + * This can be used on the first packet of any logical stream to determine if + * that stream is a Theora stream. + * \param _info A #th_info structure to fill in. + * This must have been previously initialized with + * th_info_init(). + * The application may immediately begin using the contents of + * this structure after the first header is decoded, though it + * must continue to be passed in on all subsequent calls. + * \param _tc A #th_comment structure to fill in. + * The application may immediately begin using the contents of + * this structure after the second header is decoded, though it + * must continue to be passed in on all subsequent calls. + * \param _setup Returns a pointer to additional, private setup information + * needed by the decoder. + * The contents of this pointer must be initialized to + * NULL on the first call, and the returned value must + * continue to be passed in on all subsequent calls. + * \param _op An ogg_packet structure which contains one of the + * initial packets of an Ogg logical stream. + * \return A positive value indicates that a Theora header was successfully + * processed. + * \retval 0 The first video data packet was encountered after all + * required header packets were parsed. + * The packet just passed in on this call should be saved + * and fed to th_decode_packetin() to begin decoding + * video data. + * \retval TH_EFAULT One of \a _info, \a _tc, or \a _setup was + * NULL. + * \retval TH_EBADHEADER \a _op was NULL, the packet was not the next + * header packet in the expected sequence, or the format + * of the header data was invalid. + * \retval TH_EVERSION The packet data was a Theora info header, but for a + * bitstream version not decodable with this version of + * libtheoradec. + * \retval TH_ENOTFORMAT The packet was not a Theora header. + */ +extern int th_decode_headerin(th_info *_info,th_comment *_tc, + th_setup_info **_setup,ogg_packet *_op); +/**Allocates a decoder instance. + * + * Security Warning: The Theora format supports very large frame sizes, + * potentially even larger than the address space of a 32-bit machine, and + * creating a decoder context allocates the space for several frames of data. + * If the allocation fails here, your program will crash, possibly at some + * future point because the OS kernel returned a valid memory range and will + * only fail when it tries to map the pages in it the first time they are + * used. + * Even if it succeeds, you may experience a denial of service if the frame + * size is large enough to cause excessive paging. + * If you are integrating libtheora in a larger application where such things + * are undesirable, it is highly recommended that you check the frame size in + * \a _info before calling this function and refuse to decode streams where it + * is larger than some reasonable maximum. + * libtheora will not check this for you, because there may be machines that + * can handle such streams and applications that wish to. + * \param _info A #th_info struct filled via th_decode_headerin(). + * \param _setup A #th_setup_info handle returned via + * th_decode_headerin(). + * \return The initialized #th_dec_ctx handle. + * \retval NULL If the decoding parameters were invalid.*/ +extern th_dec_ctx *th_decode_alloc(const th_info *_info, + const th_setup_info *_setup); +/**Releases all storage used for the decoder setup information. + * This should be called after you no longer want to create any decoders for + * a stream whose headers you have parsed with th_decode_headerin(). + * \param _setup The setup information to free. + * This can safely be NULL.*/ +extern void th_setup_free(th_setup_info *_setup); +/**Decoder control function. + * This is used to provide advanced control of the decoding process. + * \param _dec A #th_dec_ctx handle. + * \param _req The control code to process. + * See \ref decctlcodes "the list of available control codes" + * for details. + * \param _buf The parameters for this control code. + * \param _buf_sz The size of the parameter buffer.*/ +extern int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf, + size_t _buf_sz); +/**Submits a packet containing encoded video data to the decoder. + * \param _dec A #th_dec_ctx handle. + * \param _op An ogg_packet containing encoded video data. + * \param _granpos Returns the granule position of the decoded packet. + * If non-NULL, the granule position for this specific + * packet is stored in this location. + * This is computed incrementally from previously decoded + * packets. + * After a seek, the correct granule position must be set via + * #TH_DECCTL_SET_GRANPOS for this to work properly. + * \retval 0 Success. + * A new decoded frame can be retrieved by calling + * th_decode_ycbcr_out(). + * \retval TH_DUPFRAME The packet represented a dropped (0-byte) frame. + * The player can skip the call to th_decode_ycbcr_out(), + * as the contents of the decoded frame buffer have not + * changed. + * \retval TH_EFAULT \a _dec or \a _op was NULL. + * \retval TH_EBADPACKET \a _op does not contain encoded video data. + * \retval TH_EIMPL The video data uses bitstream features which this + * library does not support.*/ +extern int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op, + ogg_int64_t *_granpos); +/**Outputs the next available frame of decoded Y'CbCr data. + * If a striped decode callback has been set with #TH_DECCTL_SET_STRIPE_CB, + * then the application does not need to call this function. + * \param _dec A #th_dec_ctx handle. + * \param _ycbcr A video buffer structure to fill in. + * libtheoradec will fill in all the members of this + * structure, including the pointers to the uncompressed video + * data. + * The memory for this video data is owned by + * libtheoradec. + * It may be freed or overwritten without notification when + * subsequent frames are decoded. + * \retval 0 Success + * \retval TH_EFAULT \a _dec or \a _ycbcr was NULL. + */ +extern int th_decode_ycbcr_out(th_dec_ctx *_dec, + th_ycbcr_buffer _ycbcr); +/**Frees an allocated decoder instance. + * \param _dec A #th_dec_ctx handle.*/ +extern void th_decode_free(th_dec_ctx *_dec); +/*@}*/ +/*@}*/ + + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/libs/libtheora-1.1/include/theora/theoraenc.h b/libs/libtheora-1.1/include/theora/theoraenc.h new file mode 100644 index 00000000..b0b34434 --- /dev/null +++ b/libs/libtheora-1.1/include/theora/theoraenc.h @@ -0,0 +1,500 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: theora.h,v 1.8 2004/03/15 22:17:32 derf Exp $ + + ********************************************************************/ + +/**\file + * The libtheoraenc C encoding API.*/ + +#if !defined(_O_THEORA_THEORAENC_H_) +# define _O_THEORA_THEORAENC_H_ (1) +# include +# include +# include "codec.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + + +/**\name th_encode_ctl() codes + * \anchor encctlcodes + * These are the available request codes for th_encode_ctl(). + * By convention, these are even, to distinguish them from the + * \ref decctlcodes "decoder control codes". + * Keep any experimental or vendor-specific values above \c 0x8000.*/ +/*@{*/ +/**Sets the Huffman tables to use. + * The tables are copied, not stored by reference, so they can be freed after + * this call. + * NULL may be specified to revert to the default tables. + * + * \param[in] _buf #th_huff_code[#TH_NHUFFMAN_TABLES][#TH_NDCT_TOKENS] + * \retval TH_EFAULT \a _enc_ctx is NULL. + * \retval TH_EINVAL Encoding has already begun or one or more of the given + * tables is not full or prefix-free, \a _buf is + * NULL and \a _buf_sz is not zero, or \a _buf is + * non-NULL and \a _buf_sz is not + * sizeof(#th_huff_code)*#TH_NHUFFMAN_TABLES*#TH_NDCT_TOKENS. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_HUFFMAN_CODES (0) +/**Sets the quantization parameters to use. + * The parameters are copied, not stored by reference, so they can be freed + * after this call. + * NULL may be specified to revert to the default parameters. + * + * \param[in] _buf #th_quant_info + * \retval TH_EFAULT \a _enc_ctx is NULL. + * \retval TH_EINVAL Encoding has already begun, \a _buf is + * NULL and \a _buf_sz is not zero, + * or \a _buf is non-NULL and + * \a _buf_sz is not sizeof(#th_quant_info). + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_QUANT_PARAMS (2) +/**Sets the maximum distance between key frames. + * This can be changed during an encode, but will be bounded by + * 1<. + * If it is set before encoding begins, th_info#keyframe_granule_shift will + * be enlarged appropriately. + * + * \param[in] _buf ogg_uint32_t: The maximum distance between key + * frames. + * \param[out] _buf ogg_uint32_t: The actual maximum distance set. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(ogg_uint32_t). + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE (4) +/**Disables any encoder features that would prevent lossless transcoding back + * to VP3. + * This primarily means disabling block-adaptive quantization and always coding + * all four luma blocks in a macro block when 4MV is used. + * It also includes using the VP3 quantization tables and Huffman codes; if you + * set them explicitly after calling this function, the resulting stream will + * not be VP3-compatible. + * If you enable VP3-compatibility when encoding 4:2:2 or 4:4:4 source + * material, or when using a picture region smaller than the full frame (e.g. + * a non-multiple-of-16 width or height), then non-VP3 bitstream features will + * still be disabled, but the stream will still not be VP3-compatible, as VP3 + * was not capable of encoding such formats. + * If you call this after encoding has already begun, then the quantization + * tables and codebooks cannot be changed, but the frame-level features will + * be enabled or disabled as requested. + * + * \param[in] _buf int: a non-zero value to enable VP3 compatibility, + * or 0 to disable it (the default). + * \param[out] _buf int: 1 if all bitstream features required for + * VP3-compatibility could be set, and 0 otherwise. + * The latter will be returned if the pixel format is not + * 4:2:0, the picture region is smaller than the full frame, + * or if encoding has begun, preventing the quantization + * tables and codebooks from being set. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int). + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_VP3_COMPATIBLE (10) +/**Gets the maximum speed level. + * Higher speed levels favor quicker encoding over better quality per bit. + * Depending on the encoding mode, and the internal algorithms used, quality + * may actually improve, but in this case bitrate will also likely increase. + * In any case, overall rate/distortion performance will probably decrease. + * The maximum value, and the meaning of each value, may change depending on + * the current encoding mode (VBR vs. constant quality, etc.). + * + * \param[out] _buf int: The maximum encoding speed level. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int). + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_GET_SPLEVEL_MAX (12) +/**Sets the speed level. + * The current speed level may be retrieved using #TH_ENCCTL_GET_SPLEVEL. + * + * \param[in] _buf int: The new encoding speed level. + * 0 is slowest, larger values use less CPU. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int), or the + * encoding speed level is out of bounds. + * The maximum encoding speed level may be + * implementation- and encoding mode-specific, and can be + * obtained via #TH_ENCCTL_GET_SPLEVEL_MAX. + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_SET_SPLEVEL (14) +/**Gets the current speed level. + * The default speed level may vary according to encoder implementation, but if + * this control code is not supported (it returns #TH_EIMPL), the default may + * be assumed to be the slowest available speed (0). + * The maximum encoding speed level may be implementation- and encoding + * mode-specific, and can be obtained via #TH_ENCCTL_GET_SPLEVEL_MAX. + * + * \param[out] _buf int: The current encoding speed level. + * 0 is slowest, larger values use less CPU. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int). + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_GET_SPLEVEL (16) +/**Sets the number of duplicates of the next frame to produce. + * Although libtheora can encode duplicate frames very cheaply, it costs some + * amount of CPU to detect them, and a run of duplicates cannot span a + * keyframe boundary. + * This control code tells the encoder to produce the specified number of extra + * duplicates of the next frame. + * This allows the encoder to make smarter keyframe placement decisions and + * rate control decisions, and reduces CPU usage as well, when compared to + * just submitting the same frame for encoding multiple times. + * This setting only applies to the next frame submitted for encoding. + * You MUST call th_encode_packetout() repeatedly until it returns 0, or the + * extra duplicate frames will be lost. + * + * \param[in] _buf int: The number of duplicates to produce. + * If this is negative or zero, no duplicates will be produced. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int), or the + * number of duplicates is greater than or equal to the + * maximum keyframe interval. + * In the latter case, NO duplicate frames will be produced. + * You must ensure that the maximum keyframe interval is set + * larger than the maximum number of duplicates you will + * ever wish to insert prior to encoding. + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_SET_DUP_COUNT (18) +/**Modifies the default bitrate management behavior. + * Use to allow or disallow frame dropping, and to enable or disable capping + * bit reservoir overflows and underflows. + * See \ref encctlcodes "the list of available flags". + * The flags are set by default to + * #TH_RATECTL_DROP_FRAMES|#TH_RATECTL_CAP_OVERFLOW. + * + * \param[in] _buf int: Any combination of + * \ref ratectlflags "the available flags": + * - #TH_RATECTL_DROP_FRAMES: Enable frame dropping. + * - #TH_RATECTL_CAP_OVERFLOW: Don't bank excess bits for later + * use. + * - #TH_RATECTL_CAP_UNDERFLOW: Don't try to make up shortfalls + * later. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int) or rate control + * is not enabled. + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_SET_RATE_FLAGS (20) +/**Sets the size of the bitrate management bit reservoir as a function + * of number of frames. + * The reservoir size affects how quickly bitrate management reacts to + * instantaneous changes in the video complexity. + * Larger reservoirs react more slowly, and provide better overall quality, but + * require more buffering by a client, adding more latency to live streams. + * By default, libtheora sets the reservoir to the maximum distance between + * keyframes, subject to a minimum and maximum limit. + * This call may be used to increase or decrease the reservoir, increasing or + * decreasing the allowed temporary variance in bitrate. + * An implementation may impose some limits on the size of a reservoir it can + * handle, in which case the actual reservoir size may not be exactly what was + * requested. + * The actual value set will be returned. + * + * \param[in] _buf int: Requested size of the reservoir measured in + * frames. + * \param[out] _buf int: The actual size of the reservoir set. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(int), or rate control + * is not enabled. The buffer has an implementation + * defined minimum and maximum size and the value in _buf + * will be adjusted to match the actual value set. + * \retval TH_EIMPL Not supported by this implementation in the current + * encoding mode.*/ +#define TH_ENCCTL_SET_RATE_BUFFER (22) +/**Enable pass 1 of two-pass encoding mode and retrieve the first pass metrics. + * Pass 1 mode must be enabled before the first frame is encoded, and a target + * bitrate must have already been specified to the encoder. + * Although this does not have to be the exact rate that will be used in the + * second pass, closer values may produce better results. + * The first call returns the size of the two-pass header data, along with some + * placeholder content, and sets the encoder into pass 1 mode implicitly. + * This call sets the encoder to pass 1 mode implicitly. + * Then, a subsequent call must be made after each call to + * th_encode_ycbcr_in() to retrieve the metrics for that frame. + * An additional, final call must be made to retrieve the summary data, + * containing such information as the total number of frames, etc. + * This must be stored in place of the placeholder data that was returned + * in the first call, before the frame metrics data. + * All of this data must be presented back to the encoder during pass 2 using + * #TH_ENCCTL_2PASS_IN. + * + * \param[out] char *_buf: Returns a pointer to internal storage + * containing the two pass metrics data. + * This storage is only valid until the next call, or until the + * encoder context is freed, and must be copied by the + * application. + * \retval >=0 The number of bytes of metric data available in the + * returned buffer. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL \a _buf_sz is not sizeof(char *), no target + * bitrate has been set, or the first call was made after + * the first frame was submitted for encoding. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_2PASS_OUT (24) +/**Submits two-pass encoding metric data collected the first encoding pass to + * the second pass. + * The first call must be made before the first frame is encoded, and a target + * bitrate must have already been specified to the encoder. + * It sets the encoder to pass 2 mode implicitly; this cannot be disabled. + * The encoder may require reading data from some or all of the frames in + * advance, depending on, e.g., the reservoir size used in the second pass. + * You must call this function repeatedly before each frame to provide data + * until either a) it fails to consume all of the data presented or b) all of + * the pass 1 data has been consumed. + * In the first case, you must save the remaining data to be presented after + * the next frame. + * You can call this function with a NULL argument to get an upper bound on + * the number of bytes that will be required before the next frame. + * + * When pass 2 is first enabled, the default bit reservoir is set to the entire + * file; this gives maximum flexibility but can lead to very high peak rates. + * You can subsequently set it to another value with #TH_ENCCTL_SET_RATE_BUFFER + * (e.g., to set it to the keyframe interval for non-live streaming), however, + * you may then need to provide more data before the next frame. + * + * \param[in] _buf char[]: A buffer containing the data returned by + * #TH_ENCCTL_2PASS_OUT in pass 1. + * You may pass NULL for \a _buf to return an upper + * bound on the number of additional bytes needed before the + * next frame. + * The summary data returned at the end of pass 1 must be at + * the head of the buffer on the first call with a + * non-NULL \a _buf, and the placeholder data + * returned at the start of pass 1 should be omitted. + * After each call you should advance this buffer by the number + * of bytes consumed. + * \retval >0 The number of bytes of metric data required/consumed. + * \retval 0 No more data is required before the next frame. + * \retval TH_EFAULT \a _enc_ctx is NULL. + * \retval TH_EINVAL No target bitrate has been set, or the first call was + * made after the first frame was submitted for + * encoding. + * \retval TH_ENOTFORMAT The data did not appear to be pass 1 from a compatible + * implementation of this library. + * \retval TH_EBADHEADER The data was invalid; this may be returned when + * attempting to read an aborted pass 1 file that still + * has the placeholder data in place of the summary + * data. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_2PASS_IN (26) +/**Sets the current encoding quality. + * This is only valid so long as no bitrate has been specified, either through + * the #th_info struct used to initialize the encoder or through + * #TH_ENCCTL_SET_BITRATE (this restriction may be relaxed in a future + * version). + * If it is set before the headers are emitted, the target quality encoded in + * them will be updated. + * + * \param[in] _buf int: The new target quality, in the range 0...63, + * inclusive. + * \retval 0 Success. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL A target bitrate has already been specified, or the + * quality index was not in the range 0...63. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_QUALITY (28) +/**Sets the current encoding bitrate. + * Once a bitrate is set, the encoder must use a rate-controlled mode for all + * future frames (this restriction may be relaxed in a future version). + * If it is set before the headers are emitted, the target bitrate encoded in + * them will be updated. + * Due to the buffer delay, the exact bitrate of each section of the encode is + * not guaranteed. + * The encoder may have already used more bits than allowed for the frames it + * has encoded, expecting to make them up in future frames, or it may have + * used fewer, holding the excess in reserve. + * The exact transition between the two bitrates is not well-defined by this + * API, but may be affected by flags set with #TH_ENCCTL_SET_RATE_FLAGS. + * After a number of frames equal to the buffer delay, one may expect further + * output to average at the target bitrate. + * + * \param[in] _buf long: The new target bitrate, in bits per second. + * \retval 0 Success. + * \retval TH_EFAULT \a _enc_ctx or \a _buf is NULL. + * \retval TH_EINVAL The target bitrate was not positive. + * \retval TH_EIMPL Not supported by this implementation.*/ +#define TH_ENCCTL_SET_BITRATE (30) + +/*@}*/ + + +/**\name TH_ENCCTL_SET_RATE_FLAGS flags + * \anchor ratectlflags + * These are the flags available for use with #TH_ENCCTL_SET_RATE_FLAGS.*/ +/*@{*/ +/**Drop frames to keep within bitrate buffer constraints. + * This can have a severe impact on quality, but is the only way to ensure that + * bitrate targets are met at low rates during sudden bursts of activity.*/ +#define TH_RATECTL_DROP_FRAMES (0x1) +/**Ignore bitrate buffer overflows. + * If the encoder uses so few bits that the reservoir of available bits + * overflows, ignore the excess. + * The encoder will not try to use these extra bits in future frames. + * At high rates this may cause the result to be undersized, but allows a + * client to play the stream using a finite buffer; it should normally be + * enabled.*/ +#define TH_RATECTL_CAP_OVERFLOW (0x2) +/**Ignore bitrate buffer underflows. + * If the encoder uses so many bits that the reservoir of available bits + * underflows, ignore the deficit. + * The encoder will not try to make up these extra bits in future frames. + * At low rates this may cause the result to be oversized; it should normally + * be disabled.*/ +#define TH_RATECTL_CAP_UNDERFLOW (0x4) +/*@}*/ + + + +/**The quantization parameters used by VP3.*/ +extern const th_quant_info TH_VP31_QUANT_INFO; + +/**The Huffman tables used by VP3.*/ +extern const th_huff_code + TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]; + + + +/**\name Encoder state + The following data structure is opaque, and its contents are not publicly + defined by this API. + Referring to its internals directly is unsupported, and may break without + warning.*/ +/*@{*/ +/**The encoder context.*/ +typedef struct th_enc_ctx th_enc_ctx; +/*@}*/ + + + +/**\defgroup encfuncs Functions for Encoding*/ +/*@{*/ +/**\name Functions for encoding + * You must link to libtheoraenc and libtheoradec + * if you use any of the functions in this section. + * + * The functions are listed in the order they are used in a typical encode. + * The basic steps are: + * - Fill in a #th_info structure with details on the format of the video you + * wish to encode. + * - Allocate a #th_enc_ctx handle with th_encode_alloc(). + * - Perform any additional encoder configuration required with + * th_encode_ctl(). + * - Repeatedly call th_encode_flushheader() to retrieve all the header + * packets. + * - For each uncompressed frame: + * - Submit the uncompressed frame via th_encode_ycbcr_in() + * - Repeatedly call th_encode_packetout() to retrieve any video data packets + * that are ready. + * - Call th_encode_free() to release all encoder memory.*/ +/*@{*/ +/**Allocates an encoder instance. + * \param _info A #th_info struct filled with the desired encoding parameters. + * \return The initialized #th_enc_ctx handle. + * \retval NULL If the encoding parameters were invalid.*/ +extern th_enc_ctx *th_encode_alloc(const th_info *_info); +/**Encoder control function. + * This is used to provide advanced control the encoding process. + * \param _enc A #th_enc_ctx handle. + * \param _req The control code to process. + * See \ref encctlcodes "the list of available control codes" + * for details. + * \param _buf The parameters for this control code. + * \param _buf_sz The size of the parameter buffer.*/ +extern int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,size_t _buf_sz); +/**Outputs the next header packet. + * This should be called repeatedly after encoder initialization until it + * returns 0 in order to get all of the header packets, in order, before + * encoding actual video data. + * \param _enc A #th_enc_ctx handle. + * \param _comments The metadata to place in the comment header, when it is + * encoded. + * \param _op An ogg_packet structure to fill. + * All of the elements of this structure will be set, + * including a pointer to the header data. + * The memory for the header data is owned by + * libtheoraenc, and may be invalidated when the + * next encoder function is called. + * \return A positive value indicates that a header packet was successfully + * produced. + * \retval 0 No packet was produced, and no more header packets remain. + * \retval TH_EFAULT \a _enc, \a _comments, or \a _op was NULL.*/ +extern int th_encode_flushheader(th_enc_ctx *_enc, + th_comment *_comments,ogg_packet *_op); +/**Submits an uncompressed frame to the encoder. + * \param _enc A #th_enc_ctx handle. + * \param _ycbcr A buffer of Y'CbCr data to encode. + * If the width and height of the buffer matches the frame size + * the encoder was initialized with, the encoder will only + * reference the portion inside the picture region. + * Any data outside this region will be ignored, and need not map + * to a valid address. + * Alternatively, you can pass a buffer equal to the size of the + * picture region, if this is less than the full frame size. + * When using subsampled chroma planes, odd picture sizes or odd + * picture offsets may require an unexpected chroma plane size, + * and their use is generally discouraged, as they will not be + * well-supported by players and other media frameworks. + * See Section 4.4 of + * the Theora + * specification for details if you wish to use them anyway. + * \retval 0 Success. + * \retval TH_EFAULT \a _enc or \a _ycbcr is NULL. + * \retval TH_EINVAL The buffer size matches neither the frame size nor the + * picture size the encoder was initialized with, or + * encoding has already completed.*/ +extern int th_encode_ycbcr_in(th_enc_ctx *_enc,th_ycbcr_buffer _ycbcr); +/**Retrieves encoded video data packets. + * This should be called repeatedly after each frame is submitted to flush any + * encoded packets, until it returns 0. + * The encoder will not buffer these packets as subsequent frames are + * compressed, so a failure to do so will result in lost video data. + * \note Currently the encoder operates in a one-frame-in, one-packet-out + * manner. + * However, this may be changed in the future. + * \param _enc A #th_enc_ctx handle. + * \param _last Set this flag to a non-zero value if no more uncompressed + * frames will be submitted. + * This ensures that a proper EOS flag is set on the last packet. + * \param _op An ogg_packet structure to fill. + * All of the elements of this structure will be set, including a + * pointer to the video data. + * The memory for the video data is owned by + * libtheoraenc, and may be invalidated when the next + * encoder function is called. + * \return A positive value indicates that a video data packet was successfully + * produced. + * \retval 0 No packet was produced, and no more encoded video data + * remains. + * \retval TH_EFAULT \a _enc or \a _op was NULL.*/ +extern int th_encode_packetout(th_enc_ctx *_enc,int _last,ogg_packet *_op); +/**Frees an allocated encoder instance. + * \param _enc A #th_enc_ctx handle.*/ +extern void th_encode_free(th_enc_ctx *_enc); +/*@}*/ +/*@}*/ + + + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/libs/libtheora-1.1/lib/Makefile.am b/libs/libtheora-1.1/lib/Makefile.am new file mode 100644 index 00000000..bcd8e67c --- /dev/null +++ b/libs/libtheora-1.1/lib/Makefile.am @@ -0,0 +1,177 @@ +INCLUDES = -I$(top_srcdir)/include +AM_CFLAGS = $(OGG_CFLAGS) $(CAIRO_CFLAGS) + +EXTRA_DIST = \ + cpu.c \ + encoder_disabled.c \ + x86/mmxencfrag.c \ + x86/mmxfdct.c \ + x86/sse2fdct.c \ + x86/x86enc.c \ + x86/x86enc.h \ + x86/mmxfrag.c \ + x86/mmxfrag.h \ + x86/mmxidct.c \ + x86/mmxloop.h \ + x86/mmxstate.c \ + x86/x86int.h \ + x86/x86state.c \ + x86_vc + +lib_LTLIBRARIES = libtheoradec.la libtheoraenc.la libtheora.la + +if THEORA_DISABLE_ENCODE +encoder_uniq_sources = \ + encoder_disabled.c + +encoder_sources = \ + $(encoder_uniq_sources) +else +encoder_uniq_x86_sources = \ + x86/mmxencfrag.c \ + x86/mmxfdct.c \ + x86/x86enc.c + +encoder_uniq_x86_64_sources = \ + x86/sse2fdct.c + +encoder_shared_x86_sources = \ + x86/mmxfrag.c \ + x86/mmxidct.c \ + x86/mmxstate.c \ + x86/x86state.c + +encoder_shared_x86_64_sources = + +if CPU_x86_64 +encoder_uniq_arch_sources = \ + $(encoder_uniq_x86_sources) \ + $(encoder_uniq_x86_64_sources) +encoder_shared_arch_sources = \ + $(encoder_shared_x86_sources) \ + $(encoder_shared_x86_64_sources) +else +if CPU_x86_32 +encoder_uniq_arch_sources = $(encoder_uniq_x86_sources) +encoder_shared_arch_sources = $(encoder_shared_x86_sources) +else +encoder_uniq_arch_sources = +encoder_shared_arch_sources = +endif +endif + +encoder_uniq_sources = \ + analyze.c \ + fdct.c \ + encfrag.c \ + encapiwrapper.c \ + encinfo.c \ + encode.c \ + enquant.c \ + huffenc.c \ + mathops.c \ + mcenc.c \ + rate.c \ + tokenize.c \ + $(encoder_uniq_arch_sources) + +encoder_sources = \ + apiwrapper.c \ + fragment.c \ + idct.c \ + internal.c \ + state.c \ + quant.c \ + $(encoder_shared_arch_sources) \ + $(encoder_uniq_sources) + +endif + +decoder_x86_sources = \ + x86/mmxidct.c \ + x86/mmxfrag.c \ + x86/mmxstate.c \ + x86/x86state.c +if CPU_x86_64 +decoder_arch_sources = $(decoder_x86_sources) +else +if CPU_x86_32 +decoder_arch_sources = $(decoder_x86_sources) +else +decoder_arch_sources = +endif +endif + +decoder_sources = \ + apiwrapper.c \ + bitpack.c \ + decapiwrapper.c \ + decinfo.c \ + decode.c \ + dequant.c \ + fragment.c \ + huffdec.c \ + idct.c \ + info.c \ + internal.c \ + quant.c \ + state.c \ + $(decoder_arch_sources) + +noinst_HEADERS = \ + cpu.h \ + internal.h \ + encint.h \ + enquant.h \ + huffenc.h \ + mathops.h \ + modedec.h \ + x86/x86enc.h \ + apiwrapper.h \ + bitpack.h \ + dct.h \ + decint.h \ + dequant.h \ + huffdec.h \ + huffman.h \ + ocintrin.h \ + quant.h \ + x86/mmxfrag.h \ + x86/mmxloop.h \ + x86/x86int.h + +libtheoradec_la_SOURCES = \ + $(decoder_sources) \ + Version_script-dec theoradec.exp +libtheoradec_la_LDFLAGS = \ + -version-info @THDEC_LIB_CURRENT@:@THDEC_LIB_REVISION@:@THDEC_LIB_AGE@ \ + @THEORADEC_LDFLAGS@ @CAIRO_LIBS@ \ + -no-undefined + +libtheoraenc_la_SOURCES = \ + $(encoder_sources) \ + Version_script-enc theoraenc.exp +libtheoraenc_la_LDFLAGS = \ + -version-info @THENC_LIB_CURRENT@:@THENC_LIB_REVISION@:@THENC_LIB_AGE@ \ + @THEORAENC_LDFLAGS@ $(OGG_LIBS) \ + -no-undefined +libtheoraenc_la_LIBADD = libtheoradec.la + +libtheora_la_SOURCES = \ + $(decoder_sources) \ + $(encoder_uniq_sources) \ + Version_script theora.exp +libtheora_la_LDFLAGS = \ + -version-info @TH_LIB_CURRENT@:@TH_LIB_REVISION@:@TH_LIB_AGE@ \ + @THEORA_LDFLAGS@ @CAIRO_LIBS@ $(OGG_LIBS) \ + -no-undefined + +debug: + $(MAKE) all CFLAGS="@DEBUG@" + +profile: + $(MAKE) all CFLAGS="@PROFILE@" + +# contstruct various symbol export list files +.def.exp : defexp.awk + awk -f defexp.awk $< > $@ diff --git a/libs/libtheora-1.1/lib/Version_script b/libs/libtheora-1.1/lib/Version_script new file mode 100644 index 00000000..2ecb5e43 --- /dev/null +++ b/libs/libtheora-1.1/lib/Version_script @@ -0,0 +1,53 @@ +# +# Export file for libtheora +# +# Only the symbols listed in the global section will be callable from +# applications linking to the libraries. +# + +# We use something that looks like a versioned so filename here +# to define the old API because of a historical confusion. This +# label must be kept to maintain ABI compatibility. + +libtheora.so.1.0 +{ + global: + theora_version_string; + theora_version_number; + + theora_encode_init; + theora_encode_YUVin; + theora_encode_packetout; + theora_encode_header; + theora_encode_comment; + theora_encode_tables; + + theora_decode_header; + theora_decode_init; + theora_decode_packetin; + theora_decode_YUVout; + + theora_control; + + theora_packet_isheader; + theora_packet_iskeyframe; + + theora_granule_shift; + theora_granule_frame; + theora_granule_time; + + theora_info_init; + theora_info_clear; + + theora_clear; + + theora_comment_init; + theora_comment_add; + theora_comment_add_tag; + theora_comment_query; + theora_comment_query_count; + theora_comment_clear; + + local: + *; +}; diff --git a/libs/libtheora-1.1/lib/Version_script-dec b/libs/libtheora-1.1/lib/Version_script-dec new file mode 100644 index 00000000..cab36839 --- /dev/null +++ b/libs/libtheora-1.1/lib/Version_script-dec @@ -0,0 +1,82 @@ +# +# Export file for libtheoradec +# +# Only the symbols listed in the global section will be callable from +# applications linking to the libraries. +# + +# The 1.x API +libtheoradec_1.0 +{ + global: + th_version_string; + th_version_number; + + th_decode_headerin; + th_decode_alloc; + th_setup_free; + th_decode_ctl; + th_decode_packetin; + th_decode_ycbcr_out; + th_decode_free; + + th_packet_isheader; + th_packet_iskeyframe; + + th_granule_frame; + th_granule_time; + + th_info_init; + th_info_clear; + + th_comment_init; + th_comment_add; + th_comment_add_tag; + th_comment_query; + th_comment_query_count; + th_comment_clear; + + local: + *; +}; + +# The deprecated legacy api from the libtheora alpha releases. +# We use something that looks like a versioned so filename here +# to define the old API because of a historical confusion. This +# label must be kept to maintain ABI compatibility. + +libtheora.so.1.0 +{ + global: + theora_version_string; + theora_version_number; + + theora_decode_header; + theora_decode_init; + theora_decode_packetin; + theora_decode_YUVout; + + theora_control; + + theora_packet_isheader; + theora_packet_iskeyframe; + + theora_granule_shift; + theora_granule_frame; + theora_granule_time; + + theora_info_init; + theora_info_clear; + + theora_clear; + + theora_comment_init; + theora_comment_add; + theora_comment_add_tag; + theora_comment_query; + theora_comment_query_count; + theora_comment_clear; + + local: + *; +}; diff --git a/libs/libtheora-1.1/lib/Version_script-enc b/libs/libtheora-1.1/lib/Version_script-enc new file mode 100644 index 00000000..37699edd --- /dev/null +++ b/libs/libtheora-1.1/lib/Version_script-enc @@ -0,0 +1,43 @@ +# +# Export file for libtheora +# +# Only the symbols listed in the global section will be callable from +# applications linking to the libraries. +# + +# The 1.x encoder API +libtheoraenc_1.0 +{ + global: + th_encode_alloc; + th_encode_ctl; + th_encode_flushheader; + th_encode_ycbcr_in; + th_encode_packetout; + th_encode_free; + + TH_VP31_QUANT_INFO; + TH_VP31_HUFF_CODES; + + local: + *; +}; + +# The encoder portion of the deprecated alpha release api. +# We use something that looks like a versioned so filename here +# to define the old API because of a historical confusion. This +# label must be kept to maintain ABI compatibility. + +libtheora.so.1.0 +{ + global: + theora_encode_init; + theora_encode_YUVin; + theora_encode_packetout; + theora_encode_header; + theora_encode_comment; + theora_encode_tables; + + local: + *; +}; diff --git a/libs/libtheora-1.1/lib/analyze.c b/libs/libtheora-1.1/lib/analyze.c new file mode 100644 index 00000000..8a366c7a --- /dev/null +++ b/libs/libtheora-1.1/lib/analyze.c @@ -0,0 +1,2701 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: mode selection code + last mod: $Id$ + + ********************************************************************/ +#include +#include +#include "encint.h" +#include "modedec.h" + + + +typedef struct oc_fr_state oc_fr_state; +typedef struct oc_qii_state oc_qii_state; +typedef struct oc_enc_pipeline_state oc_enc_pipeline_state; +typedef struct oc_rd_metric oc_rd_metric; +typedef struct oc_mode_choice oc_mode_choice; + + + +/*There are 8 possible schemes used to encode macro block modes. + Schemes 0-6 use a maximally-skewed Huffman code to code each of the modes. + The same set of Huffman codes is used for each of these 7 schemes, but the + mode assigned to each codeword varies. + Scheme 0 writes a custom mapping from codeword to MB mode to the bitstream, + while schemes 1-6 have a fixed mapping. + Scheme 7 just encodes each mode directly in 3 bits.*/ + +/*The mode orderings for the various mode coding schemes. + Scheme 0 uses a custom alphabet, which is not stored in this table. + This is the inverse of the equivalent table OC_MODE_ALPHABETS in the + decoder.*/ +static const unsigned char OC_MODE_RANKS[7][OC_NMODES]={ + /*Last MV dominates.*/ + /*L P M N I G GM 4*/ + {3,4,2,0,1,5,6,7}, + /*L P N M I G GM 4*/ + {2,4,3,0,1,5,6,7}, + /*L M P N I G GM 4*/ + {3,4,1,0,2,5,6,7}, + /*L M N P I G GM 4*/ + {2,4,1,0,3,5,6,7}, + /*No MV dominates.*/ + /*N L P M I G GM 4*/ + {0,4,3,1,2,5,6,7}, + /*N G L P M I GM 4*/ + {0,5,4,2,3,1,6,7}, + /*Default ordering.*/ + /*N I M L P G GM 4*/ + {0,1,2,3,4,5,6,7} +}; + + + +/*Initialize the mode scheme chooser. + This need only be called once per encoder.*/ +void oc_mode_scheme_chooser_init(oc_mode_scheme_chooser *_chooser){ + int si; + _chooser->mode_ranks[0]=_chooser->scheme0_ranks; + for(si=1;si<8;si++)_chooser->mode_ranks[si]=OC_MODE_RANKS[si-1]; +} + +/*Reset the mode scheme chooser. + This needs to be called once for each frame, including the first.*/ +static void oc_mode_scheme_chooser_reset(oc_mode_scheme_chooser *_chooser){ + int si; + memset(_chooser->mode_counts,0,OC_NMODES*sizeof(*_chooser->mode_counts)); + /*Scheme 0 starts with 24 bits to store the mode list in.*/ + _chooser->scheme_bits[0]=24; + memset(_chooser->scheme_bits+1,0,7*sizeof(*_chooser->scheme_bits)); + for(si=0;si<8;si++){ + /*Scheme 7 should always start first, and scheme 0 should always start + last.*/ + _chooser->scheme_list[si]=7-si; + _chooser->scheme0_list[si]=_chooser->scheme0_ranks[si]=si; + } +} + + +/*This is the real purpose of this data structure: not actually selecting a + mode scheme, but estimating the cost of coding a given mode given all the + modes selected so far. + This is done via opportunity cost: the cost is defined as the number of bits + required to encode all the modes selected so far including the current one + using the best possible scheme, minus the number of bits required to encode + all the modes selected so far not including the current one using the best + possible scheme. + The computational expense of doing this probably makes it overkill. + Just be happy we take a greedy approach instead of trying to solve the + global mode-selection problem (which is NP-hard). + _mb_mode: The mode to determine the cost of. + Return: The number of bits required to code this mode.*/ +static int oc_mode_scheme_chooser_cost(oc_mode_scheme_chooser *_chooser, + int _mb_mode){ + int scheme0; + int scheme1; + int best_bits; + int mode_bits; + int si; + int scheme_bits; + scheme0=_chooser->scheme_list[0]; + scheme1=_chooser->scheme_list[1]; + best_bits=_chooser->scheme_bits[scheme0]; + mode_bits=OC_MODE_BITS[scheme0+1>>3][_chooser->mode_ranks[scheme0][_mb_mode]]; + /*Typical case: If the difference between the best scheme and the next best + is greater than 6 bits, then adding just one mode cannot change which + scheme we use.*/ + if(_chooser->scheme_bits[scheme1]-best_bits>6)return mode_bits; + /*Otherwise, check to see if adding this mode selects a different scheme as + the best.*/ + si=1; + best_bits+=mode_bits; + do{ + /*For any scheme except 0, we can just use the bit cost of the mode's rank + in that scheme.*/ + if(scheme1!=0){ + scheme_bits=_chooser->scheme_bits[scheme1]+ + OC_MODE_BITS[scheme1+1>>3][_chooser->mode_ranks[scheme1][_mb_mode]]; + } + else{ + int ri; + /*For scheme 0, incrementing the mode count could potentially change the + mode's rank. + Find the index where the mode would be moved to in the optimal list, + and use its bit cost instead of the one for the mode's current + position in the list.*/ + /*We don't recompute scheme bits; this is computing opportunity cost, not + an update.*/ + for(ri=_chooser->scheme0_ranks[_mb_mode];ri>0&& + _chooser->mode_counts[_mb_mode]>= + _chooser->mode_counts[_chooser->scheme0_list[ri-1]];ri--); + scheme_bits=_chooser->scheme_bits[0]+OC_MODE_BITS[0][ri]; + } + if(scheme_bits=8)break; + scheme1=_chooser->scheme_list[si]; + } + while(_chooser->scheme_bits[scheme1]-_chooser->scheme_bits[scheme0]<=6); + return best_bits-_chooser->scheme_bits[scheme0]; +} + +/*Incrementally update the mode counts and per-scheme bit counts and re-order + the scheme lists once a mode has been selected. + _mb_mode: The mode that was chosen.*/ +static void oc_mode_scheme_chooser_update(oc_mode_scheme_chooser *_chooser, + int _mb_mode){ + int ri; + int si; + _chooser->mode_counts[_mb_mode]++; + /*Re-order the scheme0 mode list if necessary.*/ + for(ri=_chooser->scheme0_ranks[_mb_mode];ri>0;ri--){ + int pmode; + pmode=_chooser->scheme0_list[ri-1]; + if(_chooser->mode_counts[pmode]>=_chooser->mode_counts[_mb_mode])break; + /*Reorder the mode ranking.*/ + _chooser->scheme0_ranks[pmode]++; + _chooser->scheme0_list[ri]=pmode; + } + _chooser->scheme0_ranks[_mb_mode]=ri; + _chooser->scheme0_list[ri]=_mb_mode; + /*Now add the bit cost for the mode to each scheme.*/ + for(si=0;si<8;si++){ + _chooser->scheme_bits[si]+= + OC_MODE_BITS[si+1>>3][_chooser->mode_ranks[si][_mb_mode]]; + } + /*Finally, re-order the list of schemes.*/ + for(si=1;si<8;si++){ + int sj; + int scheme0; + int bits0; + sj=si; + scheme0=_chooser->scheme_list[si]; + bits0=_chooser->scheme_bits[scheme0]; + do{ + int scheme1; + scheme1=_chooser->scheme_list[sj-1]; + if(bits0>=_chooser->scheme_bits[scheme1])break; + _chooser->scheme_list[sj]=scheme1; + } + while(--sj>0); + _chooser->scheme_list[sj]=scheme0; + } +} + + + +/*The number of bits required to encode a super block run. + _run_count: The desired run count; must be positive and less than 4130.*/ +static int oc_sb_run_bits(int _run_count){ + int i; + for(i=0;_run_count>=OC_SB_RUN_VAL_MIN[i+1];i++); + return OC_SB_RUN_CODE_NBITS[i]; +} + +/*The number of bits required to encode a block run. + _run_count: The desired run count; must be positive and less than 30.*/ +static int oc_block_run_bits(int _run_count){ + return OC_BLOCK_RUN_CODE_NBITS[_run_count-1]; +} + + + +/*State to track coded block flags and their bit cost.*/ +struct oc_fr_state{ + ptrdiff_t bits; + unsigned sb_partial_count:16; + unsigned sb_full_count:16; + unsigned b_coded_count_prev:8; + unsigned b_coded_count:8; + unsigned b_count:8; + signed int sb_partial:2; + signed int sb_full:2; + signed int b_coded_prev:2; + signed int b_coded:2; +}; + + + +static void oc_fr_state_init(oc_fr_state *_fr){ + _fr->bits=0; + _fr->sb_partial_count=0; + _fr->sb_full_count=0; + _fr->b_coded_count_prev=0; + _fr->b_coded_count=0; + _fr->b_count=0; + _fr->sb_partial=-1; + _fr->sb_full=-1; + _fr->b_coded_prev=-1; + _fr->b_coded=-1; +} + + +static void oc_fr_state_advance_sb(oc_fr_state *_fr, + int _sb_partial,int _sb_full){ + ptrdiff_t bits; + int sb_partial_count; + int sb_full_count; + bits=_fr->bits; + /*Extend the sb_partial run, or start a new one.*/ + sb_partial_count=_fr->sb_partial; + if(_fr->sb_partial==_sb_partial){ + if(sb_partial_count>=4129){ + bits++; + sb_partial_count=0; + } + else bits-=oc_sb_run_bits(sb_partial_count); + } + else sb_partial_count=0; + sb_partial_count++; + bits+=oc_sb_run_bits(sb_partial_count); + if(!_sb_partial){ + /*Extend the sb_full run, or start a new one.*/ + sb_full_count=_fr->sb_full_count; + if(_fr->sb_full==_sb_full){ + if(sb_full_count>=4129){ + bits++; + sb_full_count=0; + } + else bits-=oc_sb_run_bits(sb_full_count); + } + else sb_full_count=0; + sb_full_count++; + bits+=oc_sb_run_bits(sb_full_count); + _fr->sb_full=_sb_full; + _fr->sb_full_count=sb_full_count; + } + _fr->bits=bits; + _fr->sb_partial=_sb_partial; + _fr->sb_partial_count=sb_partial_count; +} + +/*Flush any outstanding block flags for a SB (e.g., one with fewer than 16 + blocks).*/ +static void oc_fr_state_flush_sb(oc_fr_state *_fr){ + ptrdiff_t bits; + int sb_partial; + int sb_full=sb_full; + int b_coded_count; + int b_coded; + int b_count; + b_count=_fr->b_count; + if(b_count>0){ + bits=_fr->bits; + b_coded=_fr->b_coded; + b_coded_count=_fr->b_coded_count; + if(b_coded_count>=b_count){ + /*This SB was fully coded/uncoded; roll back the partial block flags.*/ + bits-=oc_block_run_bits(b_coded_count); + if(b_coded_count>b_count)bits+=oc_block_run_bits(b_coded_count-b_count); + sb_partial=0; + sb_full=b_coded; + b_coded=_fr->b_coded_prev; + b_coded_count=_fr->b_coded_count_prev; + } + else{ + /*It was partially coded.*/ + sb_partial=1; + /*sb_full is unused.*/ + } + _fr->bits=bits; + _fr->b_coded_count=b_coded_count; + _fr->b_coded_count_prev=b_coded_count; + _fr->b_count=0; + _fr->b_coded=b_coded; + _fr->b_coded_prev=b_coded; + oc_fr_state_advance_sb(_fr,sb_partial,sb_full); + } +} + +static void oc_fr_state_advance_block(oc_fr_state *_fr,int _b_coded){ + ptrdiff_t bits; + int b_coded_count; + int b_count; + int sb_partial; + int sb_full=sb_full; + bits=_fr->bits; + /*Extend the b_coded run, or start a new one.*/ + b_coded_count=_fr->b_coded_count; + if(_fr->b_coded==_b_coded)bits-=oc_block_run_bits(b_coded_count); + else b_coded_count=0; + b_coded_count++; + b_count=_fr->b_count+1; + if(b_count>=16){ + /*We finished a superblock.*/ + if(b_coded_count>=16){ + /*It was fully coded/uncoded; roll back the partial block flags.*/ + if(b_coded_count>16)bits+=oc_block_run_bits(b_coded_count-16); + sb_partial=0; + sb_full=_b_coded; + _b_coded=_fr->b_coded_prev; + b_coded_count=_fr->b_coded_count_prev; + } + else{ + bits+=oc_block_run_bits(b_coded_count); + /*It was partially coded.*/ + sb_partial=1; + /*sb_full is unused.*/ + } + _fr->bits=bits; + _fr->b_coded_count=b_coded_count; + _fr->b_coded_count_prev=b_coded_count; + _fr->b_count=0; + _fr->b_coded=_b_coded; + _fr->b_coded_prev=_b_coded; + oc_fr_state_advance_sb(_fr,sb_partial,sb_full); + } + else{ + bits+=oc_block_run_bits(b_coded_count); + _fr->bits=bits; + _fr->b_coded_count=b_coded_count; + _fr->b_count=b_count; + _fr->b_coded=_b_coded; + } +} + +static void oc_fr_skip_block(oc_fr_state *_fr){ + oc_fr_state_advance_block(_fr,0); +} + +static void oc_fr_code_block(oc_fr_state *_fr){ + oc_fr_state_advance_block(_fr,1); +} + +static int oc_fr_cost1(const oc_fr_state *_fr){ + oc_fr_state tmp; + ptrdiff_t bits; + *&tmp=*_fr; + oc_fr_skip_block(&tmp); + bits=tmp.bits; + *&tmp=*_fr; + oc_fr_code_block(&tmp); + return (int)(tmp.bits-bits); +} + +static int oc_fr_cost4(const oc_fr_state *_pre,const oc_fr_state *_post){ + oc_fr_state tmp; + *&tmp=*_pre; + oc_fr_skip_block(&tmp); + oc_fr_skip_block(&tmp); + oc_fr_skip_block(&tmp); + oc_fr_skip_block(&tmp); + return (int)(_post->bits-tmp.bits); +} + + + +struct oc_qii_state{ + ptrdiff_t bits; + unsigned qi01_count:14; + signed int qi01:2; + unsigned qi12_count:14; + signed int qi12:2; +}; + + + +static void oc_qii_state_init(oc_qii_state *_qs){ + _qs->bits=0; + _qs->qi01_count=0; + _qs->qi01=-1; + _qs->qi12_count=0; + _qs->qi12=-1; +} + + +static void oc_qii_state_advance(oc_qii_state *_qd, + const oc_qii_state *_qs,int _qii){ + ptrdiff_t bits; + int qi01; + int qi01_count; + int qi12; + int qi12_count; + bits=_qs->bits; + qi01=_qii+1>>1; + qi01_count=_qs->qi01_count; + if(qi01==_qs->qi01){ + if(qi01_count>=4129){ + bits++; + qi01_count=0; + } + else bits-=oc_sb_run_bits(qi01_count); + } + else qi01_count=0; + qi01_count++; + bits+=oc_sb_run_bits(qi01_count); + qi12_count=_qs->qi12_count; + if(_qii){ + qi12=_qii>>1; + if(qi12==_qs->qi12){ + if(qi12_count>=4129){ + bits++; + qi12_count=0; + } + else bits-=oc_sb_run_bits(qi12_count); + } + else qi12_count=0; + qi12_count++; + bits+=oc_sb_run_bits(qi12_count); + } + else qi12=_qs->qi12; + _qd->bits=bits; + _qd->qi01=qi01; + _qd->qi01_count=qi01_count; + _qd->qi12=qi12; + _qd->qi12_count=qi12_count; +} + + + +/*Temporary encoder state for the analysis pipeline.*/ +struct oc_enc_pipeline_state{ + int bounding_values[256]; + oc_fr_state fr[3]; + oc_qii_state qs[3]; + /*Condensed dequantization tables.*/ + const ogg_uint16_t *dequant[3][3][2]; + /*Condensed quantization tables.*/ + const oc_iquant *enquant[3][3][2]; + /*Skip SSD storage for the current MCU in each plane.*/ + unsigned *skip_ssd[3]; + /*Coded/uncoded fragment lists for each plane for the current MCU.*/ + ptrdiff_t *coded_fragis[3]; + ptrdiff_t *uncoded_fragis[3]; + ptrdiff_t ncoded_fragis[3]; + ptrdiff_t nuncoded_fragis[3]; + /*The starting fragment for the current MCU in each plane.*/ + ptrdiff_t froffset[3]; + /*The starting row for the current MCU in each plane.*/ + int fragy0[3]; + /*The ending row for the current MCU in each plane.*/ + int fragy_end[3]; + /*The starting superblock for the current MCU in each plane.*/ + unsigned sbi0[3]; + /*The ending superblock for the current MCU in each plane.*/ + unsigned sbi_end[3]; + /*The number of tokens for zzi=1 for each color plane.*/ + int ndct_tokens1[3]; + /*The outstanding eob_run count for zzi=1 for each color plane.*/ + int eob_run1[3]; + /*Whether or not the loop filter is enabled.*/ + int loop_filter; +}; + + +static void oc_enc_pipeline_init(oc_enc_ctx *_enc,oc_enc_pipeline_state *_pipe){ + ptrdiff_t *coded_fragis; + unsigned mcu_nvsbs; + ptrdiff_t mcu_nfrags; + int hdec; + int vdec; + int pli; + int qii; + int qti; + /*Initialize the per-plane coded block flag trackers. + These are used for bit-estimation purposes only; the real flag bits span + all three planes, so we can't compute them in parallel.*/ + for(pli=0;pli<3;pli++)oc_fr_state_init(_pipe->fr+pli); + for(pli=0;pli<3;pli++)oc_qii_state_init(_pipe->qs+pli); + /*Set up the per-plane skip SSD storage pointers.*/ + mcu_nvsbs=_enc->mcu_nvsbs; + mcu_nfrags=mcu_nvsbs*_enc->state.fplanes[0].nhsbs*16; + hdec=!(_enc->state.info.pixel_fmt&1); + vdec=!(_enc->state.info.pixel_fmt&2); + _pipe->skip_ssd[0]=_enc->mcu_skip_ssd; + _pipe->skip_ssd[1]=_pipe->skip_ssd[0]+mcu_nfrags; + _pipe->skip_ssd[2]=_pipe->skip_ssd[1]+(mcu_nfrags>>hdec+vdec); + /*Set up per-plane pointers to the coded and uncoded fragments lists. + Unlike the decoder, each planes' coded and uncoded fragment list is kept + separate during the analysis stage; we only make the coded list for all + three planes contiguous right before the final packet is output + (destroying the uncoded lists, which are no longer needed).*/ + coded_fragis=_enc->state.coded_fragis; + for(pli=0;pli<3;pli++){ + _pipe->coded_fragis[pli]=coded_fragis; + coded_fragis+=_enc->state.fplanes[pli].nfrags; + _pipe->uncoded_fragis[pli]=coded_fragis; + } + memset(_pipe->ncoded_fragis,0,sizeof(_pipe->ncoded_fragis)); + memset(_pipe->nuncoded_fragis,0,sizeof(_pipe->nuncoded_fragis)); + /*Set up condensed quantizer tables.*/ + for(pli=0;pli<3;pli++){ + for(qii=0;qii<_enc->state.nqis;qii++){ + int qi; + qi=_enc->state.qis[qii]; + for(qti=0;qti<2;qti++){ + _pipe->dequant[pli][qii][qti]=_enc->state.dequant_tables[qi][pli][qti]; + _pipe->enquant[pli][qii][qti]=_enc->enquant_tables[qi][pli][qti]; + } + } + } + /*Initialize the tokenization state.*/ + for(pli=0;pli<3;pli++){ + _pipe->ndct_tokens1[pli]=0; + _pipe->eob_run1[pli]=0; + } + /*Initialize the bounding value array for the loop filter.*/ + _pipe->loop_filter=!oc_state_loop_filter_init(&_enc->state, + _pipe->bounding_values); +} + +/*Sets the current MCU stripe to super block row _sby. + Return: A non-zero value if this was the last MCU.*/ +static int oc_enc_pipeline_set_stripe(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,int _sby){ + const oc_fragment_plane *fplane; + unsigned mcu_nvsbs; + int sby_end; + int notdone; + int vdec; + int pli; + mcu_nvsbs=_enc->mcu_nvsbs; + sby_end=_enc->state.fplanes[0].nvsbs; + notdone=_sby+mcu_nvsbsstate.fplanes+pli; + _pipe->sbi0[pli]=fplane->sboffset+(_sby>>vdec)*fplane->nhsbs; + _pipe->fragy0[pli]=_sby<<2-vdec; + _pipe->froffset[pli]=fplane->froffset + +_pipe->fragy0[pli]*(ptrdiff_t)fplane->nhfrags; + if(notdone){ + _pipe->sbi_end[pli]=fplane->sboffset+(sby_end>>vdec)*fplane->nhsbs; + _pipe->fragy_end[pli]=sby_end<<2-vdec; + } + else{ + _pipe->sbi_end[pli]=fplane->sboffset+fplane->nsbs; + _pipe->fragy_end[pli]=fplane->nvfrags; + } + vdec=!(_enc->state.info.pixel_fmt&2); + } + return notdone; +} + +static void oc_enc_pipeline_finish_mcu_plane(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,int _pli,int _sdelay,int _edelay){ + int refi; + /*Copy over all the uncoded fragments from this plane and advance the uncoded + fragment list.*/ + _pipe->uncoded_fragis[_pli]-=_pipe->nuncoded_fragis[_pli]; + oc_state_frag_copy_list(&_enc->state,_pipe->uncoded_fragis[_pli], + _pipe->nuncoded_fragis[_pli],OC_FRAME_SELF,OC_FRAME_PREV,_pli); + _pipe->nuncoded_fragis[_pli]=0; + /*Perform DC prediction.*/ + oc_enc_pred_dc_frag_rows(_enc,_pli, + _pipe->fragy0[_pli],_pipe->fragy_end[_pli]); + /*Finish DC tokenization.*/ + oc_enc_tokenize_dc_frag_list(_enc,_pli, + _pipe->coded_fragis[_pli],_pipe->ncoded_fragis[_pli], + _pipe->ndct_tokens1[_pli],_pipe->eob_run1[_pli]); + _pipe->ndct_tokens1[_pli]=_enc->ndct_tokens[_pli][1]; + _pipe->eob_run1[_pli]=_enc->eob_run[_pli][1]; + /*And advance the coded fragment list.*/ + _enc->state.ncoded_fragis[_pli]+=_pipe->ncoded_fragis[_pli]; + _pipe->coded_fragis[_pli]+=_pipe->ncoded_fragis[_pli]; + _pipe->ncoded_fragis[_pli]=0; + /*Apply the loop filter if necessary.*/ + refi=_enc->state.ref_frame_idx[OC_FRAME_SELF]; + if(_pipe->loop_filter){ + oc_state_loop_filter_frag_rows(&_enc->state,_pipe->bounding_values, + refi,_pli,_pipe->fragy0[_pli]-_sdelay,_pipe->fragy_end[_pli]-_edelay); + } + else _sdelay=_edelay=0; + /*To fill borders, we have an additional two pixel delay, since a fragment + in the next row could filter its top edge, using two pixels from a + fragment in this row. + But there's no reason to delay a full fragment between the two.*/ + oc_state_borders_fill_rows(&_enc->state,refi,_pli, + (_pipe->fragy0[_pli]-_sdelay<<3)-(_sdelay<<1), + (_pipe->fragy_end[_pli]-_edelay<<3)-(_edelay<<1)); +} + + + +/*Cost information about the coded blocks in a MB.*/ +struct oc_rd_metric{ + int uncoded_ac_ssd; + int coded_ac_ssd; + int ac_bits; + int dc_flag; +}; + + + +static int oc_enc_block_transform_quantize(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,int _pli,ptrdiff_t _fragi,int _overhead_bits, + oc_rd_metric *_mo,oc_token_checkpoint **_stack){ + OC_ALIGN16(ogg_int16_t dct[64]); + OC_ALIGN16(ogg_int16_t data[64]); + ogg_uint16_t dc_dequant; + const ogg_uint16_t *dequant; + const oc_iquant *enquant; + ptrdiff_t frag_offs; + int ystride; + const unsigned char *src; + const unsigned char *ref; + unsigned char *dst; + int frame_type; + int nonzero; + unsigned uncoded_ssd; + unsigned coded_ssd; + int coded_dc; + oc_token_checkpoint *checkpoint; + oc_fragment *frags; + int mb_mode; + int mv_offs[2]; + int nmv_offs; + int ac_bits; + int borderi; + int qti; + int qii; + int pi; + int zzi; + int v; + int val; + int d; + int s; + int dc; + frags=_enc->state.frags; + frag_offs=_enc->state.frag_buf_offs[_fragi]; + ystride=_enc->state.ref_ystride[_pli]; + src=_enc->state.ref_frame_data[OC_FRAME_IO]+frag_offs; + borderi=frags[_fragi].borderi; + qii=frags[_fragi].qii; + if(qii&~3){ +#if !defined(OC_COLLECT_METRICS) + if(_enc->sp_level>=OC_SP_LEVEL_EARLY_SKIP){ + /*Enable early skip detection.*/ + frags[_fragi].coded=0; + return 0; + } +#endif + /*Try and code this block anyway.*/ + qii&=3; + frags[_fragi].qii=qii; + } + mb_mode=frags[_fragi].mb_mode; + ref=_enc->state.ref_frame_data[ + _enc->state.ref_frame_idx[OC_FRAME_FOR_MODE(mb_mode)]]+frag_offs; + dst=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[OC_FRAME_SELF]] + +frag_offs; + /*Motion compensation:*/ + switch(mb_mode){ + case OC_MODE_INTRA:{ + nmv_offs=0; + oc_enc_frag_sub_128(_enc,data,src,ystride); + }break; + case OC_MODE_GOLDEN_NOMV: + case OC_MODE_INTER_NOMV:{ + nmv_offs=1; + mv_offs[0]=0; + oc_enc_frag_sub(_enc,data,src,ref,ystride); + }break; + default:{ + const oc_mv *frag_mvs; + frag_mvs=(const oc_mv *)_enc->state.frag_mvs; + nmv_offs=oc_state_get_mv_offsets(&_enc->state,mv_offs,_pli, + frag_mvs[_fragi][0],frag_mvs[_fragi][1]); + if(nmv_offs>1){ + oc_enc_frag_copy2(_enc,dst, + ref+mv_offs[0],ref+mv_offs[1],ystride); + oc_enc_frag_sub(_enc,data,src,dst,ystride); + } + else oc_enc_frag_sub(_enc,data,src,ref+mv_offs[0],ystride); + }break; + } +#if defined(OC_COLLECT_METRICS) + { + unsigned satd; + switch(nmv_offs){ + case 0:satd=oc_enc_frag_intra_satd(_enc,src,ystride);break; + case 1:{ + satd=oc_enc_frag_satd_thresh(_enc,src,ref+mv_offs[0],ystride,UINT_MAX); + }break; + default:{ + satd=oc_enc_frag_satd_thresh(_enc,src,dst,ystride,UINT_MAX); + } + } + _enc->frag_satd[_fragi]=satd; + } +#endif + /*Transform:*/ + oc_enc_fdct8x8(_enc,dct,data); + /*Quantize the DC coefficient:*/ + qti=mb_mode!=OC_MODE_INTRA; + enquant=_pipe->enquant[_pli][0][qti]; + dc_dequant=_pipe->dequant[_pli][0][qti][0]; + v=dct[0]; + val=v<<1; + s=OC_SIGNMASK(val); + val+=dc_dequant+s^s; + val=((enquant[0].m*(ogg_int32_t)val>>16)+val>>enquant[0].l)-s; + dc=OC_CLAMPI(-580,val,580); + nonzero=0; + /*Quantize the AC coefficients:*/ + dequant=_pipe->dequant[_pli][qii][qti]; + enquant=_pipe->enquant[_pli][qii][qti]; + for(zzi=1;zzi<64;zzi++){ + v=dct[OC_FZIG_ZAG[zzi]]; + d=dequant[zzi]; + val=v<<1; + v=abs(val); + if(v>=d){ + s=OC_SIGNMASK(val); + /*The bias added here rounds ties away from zero, since token + optimization can only decrease the magnitude of the quantized + value.*/ + val+=d+s^s; + /*Note the arithmetic right shift is not guaranteed by ANSI C. + Hopefully no one still uses ones-complement architectures.*/ + val=((enquant[zzi].m*(ogg_int32_t)val>>16)+val>>enquant[zzi].l)-s; + data[zzi]=OC_CLAMPI(-580,val,580); + nonzero=zzi; + } + else data[zzi]=0; + } + /*Tokenize.*/ + checkpoint=*_stack; + ac_bits=oc_enc_tokenize_ac(_enc,_pli,_fragi,data,dequant,dct,nonzero+1, + _stack,qti?0:3); + /*Reconstruct. + TODO: nonzero may need to be adjusted after tokenization.*/ + if(nonzero==0){ + ogg_int16_t p; + int ci; + /*We round this dequant product (and not any of the others) because there's + no iDCT rounding.*/ + p=(ogg_int16_t)(dc*(ogg_int32_t)dc_dequant+15>>5); + /*LOOP VECTORIZES.*/ + for(ci=0;ci<64;ci++)data[ci]=p; + } + else{ + data[0]=dc*dc_dequant; + oc_idct8x8(&_enc->state,data,nonzero+1); + } + if(!qti)oc_enc_frag_recon_intra(_enc,dst,ystride,data); + else{ + oc_enc_frag_recon_inter(_enc,dst, + nmv_offs==1?ref+mv_offs[0]:dst,ystride,data); + } + frame_type=_enc->state.frame_type; +#if !defined(OC_COLLECT_METRICS) + if(frame_type!=OC_INTRA_FRAME) +#endif + { + /*In retrospect, should we have skipped this block?*/ + oc_enc_frag_sub(_enc,data,src,dst,ystride); + coded_ssd=coded_dc=0; + if(borderi<0){ + for(pi=0;pi<64;pi++){ + coded_ssd+=data[pi]*data[pi]; + coded_dc+=data[pi]; + } + } + else{ + ogg_int64_t mask; + mask=_enc->state.borders[borderi].mask; + for(pi=0;pi<64;pi++,mask>>=1)if(mask&1){ + coded_ssd+=data[pi]*data[pi]; + coded_dc+=data[pi]; + } + } + /*Scale to match DCT domain.*/ + coded_ssd<<=4; + /*We actually only want the AC contribution to the SSD.*/ + coded_ssd-=coded_dc*coded_dc>>2; +#if defined(OC_COLLECT_METRICS) + _enc->frag_ssd[_fragi]=coded_ssd; + } + if(frame_type!=OC_INTRA_FRAME){ +#endif + uncoded_ssd=_pipe->skip_ssd[_pli][_fragi-_pipe->froffset[_pli]]; + if(uncoded_ssdlambda&& + /*Don't allow luma blocks to be skipped in 4MV mode when VP3 + compatibility is enabled.*/ + (!_enc->vp3_compatible||mb_mode!=OC_MODE_INTER_MV_FOUR||_pli)){ + /*Hm, not worth it; roll back.*/ + oc_enc_tokenlog_rollback(_enc,checkpoint,(*_stack)-checkpoint); + *_stack=checkpoint; + frags[_fragi].coded=0; + return 0; + } + } + else _mo->dc_flag=1; + _mo->uncoded_ac_ssd+=uncoded_ssd; + _mo->coded_ac_ssd+=coded_ssd; + _mo->ac_bits+=ac_bits; + } + oc_qii_state_advance(_pipe->qs+_pli,_pipe->qs+_pli,qii); + frags[_fragi].dc=dc; + frags[_fragi].coded=1; + return 1; +} + +static int oc_enc_mb_transform_quantize_luma(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,unsigned _mbi,int _mode_overhead){ + /*Worst case token stack usage for 4 fragments.*/ + oc_token_checkpoint stack[64*4]; + oc_token_checkpoint *stackptr; + const oc_sb_map *sb_maps; + signed char *mb_modes; + oc_fragment *frags; + ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t *uncoded_fragis; + ptrdiff_t nuncoded_fragis; + oc_rd_metric mo; + oc_fr_state fr_checkpoint; + oc_qii_state qs_checkpoint; + int mb_mode; + int ncoded; + ptrdiff_t fragi; + int bi; + *&fr_checkpoint=*(_pipe->fr+0); + *&qs_checkpoint=*(_pipe->qs+0); + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + mb_modes=_enc->state.mb_modes; + frags=_enc->state.frags; + coded_fragis=_pipe->coded_fragis[0]; + ncoded_fragis=_pipe->ncoded_fragis[0]; + uncoded_fragis=_pipe->uncoded_fragis[0]; + nuncoded_fragis=_pipe->nuncoded_fragis[0]; + mb_mode=mb_modes[_mbi]; + ncoded=0; + stackptr=stack; + memset(&mo,0,sizeof(mo)); + for(bi=0;bi<4;bi++){ + fragi=sb_maps[_mbi>>2][_mbi&3][bi]; + frags[fragi].mb_mode=mb_mode; + if(oc_enc_block_transform_quantize(_enc, + _pipe,0,fragi,oc_fr_cost1(_pipe->fr+0),&mo,&stackptr)){ + oc_fr_code_block(_pipe->fr+0); + coded_fragis[ncoded_fragis++]=fragi; + ncoded++; + } + else{ + *(uncoded_fragis-++nuncoded_fragis)=fragi; + oc_fr_skip_block(_pipe->fr+0); + } + } + if(_enc->state.frame_type!=OC_INTRA_FRAME){ + if(ncoded>0&&!mo.dc_flag){ + int cost; + /*Some individual blocks were worth coding. + See if that's still true when accounting for mode and MV overhead.*/ + cost=mo.coded_ac_ssd+_enc->lambda*(mo.ac_bits + +oc_fr_cost4(&fr_checkpoint,_pipe->fr+0)+_mode_overhead); + if(mo.uncoded_ac_ssd<=cost){ + /*Taking macroblock overhead into account, it is not worth coding this + MB.*/ + oc_enc_tokenlog_rollback(_enc,stack,stackptr-stack); + *(_pipe->fr+0)=*&fr_checkpoint; + *(_pipe->qs+0)=*&qs_checkpoint; + for(bi=0;bi<4;bi++){ + fragi=sb_maps[_mbi>>2][_mbi&3][bi]; + if(frags[fragi].coded){ + *(uncoded_fragis-++nuncoded_fragis)=fragi; + frags[fragi].coded=0; + } + oc_fr_skip_block(_pipe->fr+0); + } + ncoded_fragis-=ncoded; + ncoded=0; + } + } + /*If no luma blocks coded, the mode is forced.*/ + if(ncoded==0)mb_modes[_mbi]=OC_MODE_INTER_NOMV; + /*Assume that a 1MV with a single coded block is always cheaper than a 4MV + with a single coded block. + This may not be strictly true: a 4MV computes chroma MVs using (0,0) for + skipped blocks, while a 1MV does not.*/ + else if(ncoded==1&&mb_mode==OC_MODE_INTER_MV_FOUR){ + mb_modes[_mbi]=OC_MODE_INTER_MV; + } + } + _pipe->ncoded_fragis[0]=ncoded_fragis; + _pipe->nuncoded_fragis[0]=nuncoded_fragis; + return ncoded; +} + +static void oc_enc_sb_transform_quantize_chroma(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,int _pli,int _sbi_start,int _sbi_end){ + const oc_sb_map *sb_maps; + oc_sb_flags *sb_flags; + ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t *uncoded_fragis; + ptrdiff_t nuncoded_fragis; + int sbi; + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + sb_flags=_enc->state.sb_flags; + coded_fragis=_pipe->coded_fragis[_pli]; + ncoded_fragis=_pipe->ncoded_fragis[_pli]; + uncoded_fragis=_pipe->uncoded_fragis[_pli]; + nuncoded_fragis=_pipe->nuncoded_fragis[_pli]; + for(sbi=_sbi_start;sbi<_sbi_end;sbi++){ + /*Worst case token stack usage for 1 fragment.*/ + oc_token_checkpoint stack[64]; + oc_rd_metric mo; + int quadi; + int bi; + memset(&mo,0,sizeof(mo)); + for(quadi=0;quadi<4;quadi++)for(bi=0;bi<4;bi++){ + ptrdiff_t fragi; + fragi=sb_maps[sbi][quadi][bi]; + if(fragi>=0){ + oc_token_checkpoint *stackptr; + stackptr=stack; + if(oc_enc_block_transform_quantize(_enc, + _pipe,_pli,fragi,oc_fr_cost1(_pipe->fr+_pli),&mo,&stackptr)){ + coded_fragis[ncoded_fragis++]=fragi; + oc_fr_code_block(_pipe->fr+_pli); + } + else{ + *(uncoded_fragis-++nuncoded_fragis)=fragi; + oc_fr_skip_block(_pipe->fr+_pli); + } + } + } + oc_fr_state_flush_sb(_pipe->fr+_pli); + sb_flags[sbi].coded_fully=_pipe->fr[_pli].sb_full; + sb_flags[sbi].coded_partially=_pipe->fr[_pli].sb_partial; + } + _pipe->ncoded_fragis[_pli]=ncoded_fragis; + _pipe->nuncoded_fragis[_pli]=nuncoded_fragis; +} + +/*Mode decision is done by exhaustively examining all potential choices. + Obviously, doing the motion compensation, fDCT, tokenization, and then + counting the bits each token uses is computationally expensive. + Theora's EOB runs can also split the cost of these tokens across multiple + fragments, and naturally we don't know what the optimal choice of Huffman + codes will be until we know all the tokens we're going to encode in all the + fragments. + So we use a simple approach to estimating the bit cost and distortion of each + mode based upon the SATD value of the residual before coding. + The mathematics behind the technique are outlined by Kim \cite{Kim03}, but + the process (modified somewhat from that of the paper) is very simple. + We build a non-linear regression of the mappings from + (pre-transform+quantization) SATD to (post-transform+quantization) bits and + SSD for each qi. + A separate set of mappings is kept for each quantization type and color + plane. + The mappings are constructed by partitioning the SATD values into a small + number of bins (currently 24) and using a linear regression in each bin + (as opposed to the 0th-order regression used by Kim). + The bit counts and SSD measurements are obtained by examining actual encoded + frames, with appropriate lambda values and optimal Huffman codes selected. + EOB bits are assigned to the fragment that started the EOB run (as opposed to + dividing them among all the blocks in the run; though the latter approach + seems more theoretically correct, Monty's testing showed a small improvement + with the former, though that may have been merely statistical noise). + + @ARTICLE{Kim03, + author="Hyun Mun Kim", + title="Adaptive Rate Control Using Nonlinear Regression", + journal="IEEE Transactions on Circuits and Systems for Video Technology", + volume=13, + number=5, + pages="432--439", + month=May, + year=2003 + }*/ + +/*Computes (_ssd+_lambda*_rate)/(1<>OC_BIT_SCALE)+((_rate)>>OC_BIT_SCALE)*(_lambda) \ + +(((_ssd)&(1<>1)>>OC_BIT_SCALE) + +/*Estimate the R-D cost of the DCT coefficients given the SATD of a block after + prediction.*/ +static unsigned oc_dct_cost2(unsigned *_ssd, + int _qi,int _pli,int _qti,int _satd){ + unsigned rmse; + int bin; + int dx; + int y0; + int z0; + int dy; + int dz; + /*SATD metrics for chroma planes vary much less than luma, so we scale them + by 4 to distribute them into the mode decision bins more evenly.*/ + _satd<<=_pli+1&2; + bin=OC_MINI(_satd>>OC_SAD_SHIFT,OC_SAD_BINS-2); + dx=_satd-(bin<>OC_SAD_SHIFT),0); + *_ssd=rmse*rmse>>2*OC_RMSE_SCALE-OC_BIT_SCALE; + return OC_MAXI(y0+(dy*dx>>OC_SAD_SHIFT),0); +} + +/*Select luma block-level quantizers for a MB in an INTRA frame.*/ +static unsigned oc_analyze_intra_mb_luma(oc_enc_ctx *_enc, + const oc_qii_state *_qs,unsigned _mbi){ + const unsigned char *src; + const ptrdiff_t *frag_buf_offs; + const oc_sb_map *sb_maps; + oc_fragment *frags; + ptrdiff_t frag_offs; + ptrdiff_t fragi; + oc_qii_state qs[4][3]; + unsigned cost[4][3]; + unsigned ssd[4][3]; + unsigned rate[4][3]; + int prev[3][3]; + unsigned satd; + unsigned best_cost; + unsigned best_ssd; + unsigned best_rate; + int best_qii; + int qii; + int lambda; + int ystride; + int nqis; + int bi; + frag_buf_offs=_enc->state.frag_buf_offs; + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ystride=_enc->state.ref_ystride[0]; + fragi=sb_maps[_mbi>>2][_mbi&3][0]; + frag_offs=frag_buf_offs[fragi]; + satd=oc_enc_frag_intra_satd(_enc,src+frag_offs,ystride); + nqis=_enc->state.nqis; + lambda=_enc->lambda; + for(qii=0;qiistate.qis[qii],0,0,satd) + +(qs[0][qii].bits-_qs->bits<>2][_mbi&3][bi]; + frag_offs=frag_buf_offs[fragi]; + satd=oc_enc_frag_intra_satd(_enc,src+frag_offs,ystride); + for(qii=0;qiistate.qis[qii],0,0,satd); + best_ssd=ssd[bi-1][0]+cur_ssd; + best_rate=rate[bi-1][0]+cur_rate + +(qt[0].bits-qs[bi-1][0].bits<state.frags; + for(bi=3;;){ + fragi=sb_maps[_mbi>>2][_mbi&3][bi]; + frags[fragi].qii=best_qii; + if(bi--<=0)break; + best_qii=prev[bi][best_qii]; + } + return best_cost; +} + +/*Select a block-level quantizer for a single chroma block in an INTRA frame.*/ +static unsigned oc_analyze_intra_chroma_block(oc_enc_ctx *_enc, + const oc_qii_state *_qs,int _pli,ptrdiff_t _fragi){ + const unsigned char *src; + oc_fragment *frags; + ptrdiff_t frag_offs; + oc_qii_state qt[3]; + unsigned cost[3]; + unsigned satd; + unsigned best_cost; + int best_qii; + int qii; + int lambda; + int ystride; + int nqis; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ystride=_enc->state.ref_ystride[_pli]; + frag_offs=_enc->state.frag_buf_offs[_fragi]; + satd=oc_enc_frag_intra_satd(_enc,src+frag_offs,ystride); + nqis=_enc->state.nqis; + lambda=_enc->lambda; + best_qii=0; + for(qii=0;qiistate.qis[qii],_pli,0,satd) + +(qt[qii].bits-_qs->bits<state.frags; + frags[_fragi].qii=best_qii; + return best_cost; +} + +static void oc_enc_sb_transform_quantize_intra_chroma(oc_enc_ctx *_enc, + oc_enc_pipeline_state *_pipe,int _pli,int _sbi_start,int _sbi_end){ + const oc_sb_map *sb_maps; + ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + int sbi; + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + coded_fragis=_pipe->coded_fragis[_pli]; + ncoded_fragis=_pipe->ncoded_fragis[_pli]; + for(sbi=_sbi_start;sbi<_sbi_end;sbi++){ + /*Worst case token stack usage for 1 fragment.*/ + oc_token_checkpoint stack[64]; + int quadi; + int bi; + for(quadi=0;quadi<4;quadi++)for(bi=0;bi<4;bi++){ + ptrdiff_t fragi; + fragi=sb_maps[sbi][quadi][bi]; + if(fragi>=0){ + oc_token_checkpoint *stackptr; + oc_analyze_intra_chroma_block(_enc,_pipe->qs+_pli,_pli,fragi); + stackptr=stack; + oc_enc_block_transform_quantize(_enc, + _pipe,_pli,fragi,0,NULL,&stackptr); + coded_fragis[ncoded_fragis++]=fragi; + } + } + } + _pipe->ncoded_fragis[_pli]=ncoded_fragis; +} + +/*Analysis stage for an INTRA frame.*/ +void oc_enc_analyze_intra(oc_enc_ctx *_enc,int _recode){ + oc_enc_pipeline_state pipe; + const unsigned char *map_idxs; + int nmap_idxs; + oc_sb_flags *sb_flags; + signed char *mb_modes; + const oc_mb_map *mb_maps; + oc_fragment *frags; + unsigned stripe_sby; + unsigned mcu_nvsbs; + int notstart; + int notdone; + int refi; + int pli; + _enc->state.frame_type=OC_INTRA_FRAME; + oc_enc_tokenize_start(_enc); + oc_enc_pipeline_init(_enc,&pipe); + /*Choose MVs and MB modes and quantize and code luma. + Must be done in Hilbert order.*/ + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + nmap_idxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + _enc->state.ncoded_fragis[0]=0; + _enc->state.ncoded_fragis[1]=0; + _enc->state.ncoded_fragis[2]=0; + sb_flags=_enc->state.sb_flags; + mb_modes=_enc->state.mb_modes; + mb_maps=(const oc_mb_map *)_enc->state.mb_maps; + frags=_enc->state.frags; + notstart=0; + notdone=1; + mcu_nvsbs=_enc->mcu_nvsbs; + for(stripe_sby=0;notdone;stripe_sby+=mcu_nvsbs){ + unsigned sbi; + unsigned sbi_end; + notdone=oc_enc_pipeline_set_stripe(_enc,&pipe,stripe_sby); + sbi_end=pipe.sbi_end[0]; + for(sbi=pipe.sbi0[0];sbistate.curframe_num>0)oc_mcenc_search(_enc,mbi); + oc_analyze_intra_mb_luma(_enc,pipe.qs+0,mbi); + mb_modes[mbi]=OC_MODE_INTRA; + oc_enc_mb_transform_quantize_luma(_enc,&pipe,mbi,0); + /*Propagate final MB mode and MVs to the chroma blocks.*/ + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_maps[mbi][pli][bi]; + frags[fragi].mb_mode=OC_MODE_INTRA; + } + } + } + oc_enc_pipeline_finish_mcu_plane(_enc,&pipe,0,notstart,notdone); + /*Code chroma planes.*/ + for(pli=1;pli<3;pli++){ + oc_enc_sb_transform_quantize_intra_chroma(_enc,&pipe, + pli,pipe.sbi0[pli],pipe.sbi_end[pli]); + oc_enc_pipeline_finish_mcu_plane(_enc,&pipe,pli,notstart,notdone); + } + notstart=1; + } + /*Finish filling in the reference frame borders.*/ + refi=_enc->state.ref_frame_idx[OC_FRAME_SELF]; + for(pli=0;pli<3;pli++)oc_state_borders_fill_caps(&_enc->state,refi,pli); + _enc->state.ntotal_coded_fragis=_enc->state.nfrags; +} + + + +/*Cost information about a MB mode.*/ +struct oc_mode_choice{ + unsigned cost; + unsigned ssd; + unsigned rate; + unsigned overhead; + unsigned char qii[12]; +}; + + + +static void oc_mode_set_cost(oc_mode_choice *_modec,int _lambda){ + _modec->cost=OC_MODE_RD_COST(_modec->ssd, + _modec->rate+_modec->overhead,_lambda); +} + +/*A set of skip SSD's to use to disable early skipping.*/ +static const unsigned OC_NOSKIP[12]={ + UINT_MAX,UINT_MAX,UINT_MAX,UINT_MAX, + UINT_MAX,UINT_MAX,UINT_MAX,UINT_MAX, + UINT_MAX,UINT_MAX,UINT_MAX,UINT_MAX +}; + +/*The estimated number of bits used by a coded chroma block to specify the AC + quantizer. + TODO: Currently this is just 0.5*log2(3) (estimating about 50% compression); + measurements suggest this is in the right ballpark, but it varies somewhat + with lambda.*/ +#define OC_CHROMA_QII_RATE ((0xCAE00D1DU>>31-OC_BIT_SCALE)+1>>1) + +static void oc_analyze_mb_mode_luma(oc_enc_ctx *_enc, + oc_mode_choice *_modec,const oc_fr_state *_fr,const oc_qii_state *_qs, + const unsigned _frag_satd[12],const unsigned _skip_ssd[12],int _qti){ + oc_fr_state fr; + oc_qii_state qs; + unsigned ssd; + unsigned rate; + int overhead; + unsigned satd; + unsigned best_ssd; + unsigned best_rate; + int best_overhead; + int best_fri; + int best_qii; + unsigned cur_cost; + unsigned cur_ssd; + unsigned cur_rate; + int cur_overhead; + int lambda; + int nqis; + int nskipped; + int bi; + int qii; + lambda=_enc->lambda; + nqis=_enc->state.nqis; + /*We could do a trellis optimization here, but we don't make final skip + decisions until after transform+quantization, so the result wouldn't be + optimal anyway. + Instead we just use a greedy approach; for most SATD values, the + differences between the qiis are large enough to drown out the cost to + code the flags, anyway.*/ + *&fr=*_fr; + *&qs=*_qs; + ssd=rate=overhead=nskipped=0; + for(bi=0;bi<4;bi++){ + oc_fr_state ft[2]; + oc_qii_state qt[3]; + unsigned best_cost; + satd=_frag_satd[bi]; + *(ft+0)=*&fr; + oc_fr_code_block(ft+0); + oc_qii_state_advance(qt+0,&qs,0); + best_overhead=(ft[0].bits-fr.bits<state.qis[0],0,_qti,satd) + +(qt[0].bits-qs.bits<state.qis[qii],0,_qti,satd) + +(qt[qii].bits-qs.bits<qii[bi]=best_qii; + } + _modec->ssd=ssd; + _modec->rate=rate; + _modec->overhead=OC_MAXI(overhead,0); +} + +static void oc_analyze_mb_mode_chroma(oc_enc_ctx *_enc, + oc_mode_choice *_modec,const oc_fr_state *_fr,const oc_qii_state *_qs, + const unsigned _frag_satd[12],const unsigned _skip_ssd[12],int _qti){ + unsigned ssd; + unsigned rate; + unsigned satd; + unsigned best_ssd; + unsigned best_rate; + int best_qii; + unsigned cur_cost; + unsigned cur_ssd; + unsigned cur_rate; + int lambda; + int nblocks; + int nqis; + int pli; + int bi; + int qii; + lambda=_enc->lambda; + nqis=_enc->state.nqis; + ssd=_modec->ssd; + rate=_modec->rate; + /*Because (except in 4:4:4 mode) we aren't considering chroma blocks in coded + order, we assume a constant overhead for coded block and qii flags.*/ + nblocks=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + nblocks=(nblocks-4>>1)+4; + bi=4; + for(pli=1;pli<3;pli++){ + for(;bistate.qis[0],pli,_qti,satd) + +OC_CHROMA_QII_RATE; + best_cost=OC_MODE_RD_COST(ssd+best_ssd,rate+best_rate,lambda); + best_qii=0; + for(qii=1;qiistate.qis[qii],0,_qti,satd) + +OC_CHROMA_QII_RATE; + cur_cost=OC_MODE_RD_COST(ssd+cur_ssd,rate+cur_rate,lambda); + if(cur_costqii[bi]=best_qii; + } + nblocks=(nblocks-4<<1)+4; + } + _modec->ssd=ssd; + _modec->rate=rate; +} + +static void oc_skip_cost(oc_enc_ctx *_enc,oc_enc_pipeline_state *_pipe, + unsigned _mbi,unsigned _ssd[12]){ + OC_ALIGN16(ogg_int16_t buffer[64]); + const unsigned char *src; + const unsigned char *ref; + int ystride; + const oc_fragment *frags; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *sb_map; + const oc_mb_map_plane *mb_map; + const unsigned char *map_idxs; + int map_nidxs; + ogg_int64_t mask; + unsigned uncoded_ssd; + int uncoded_dc; + unsigned dc_dequant; + int dc_flag; + int mapii; + int mapi; + int pli; + int bi; + ptrdiff_t fragi; + ptrdiff_t frag_offs; + int borderi; + int pi; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[OC_FRAME_PREV]]; + ystride=_enc->state.ref_ystride[0]; + frags=_enc->state.frags; + frag_buf_offs=_enc->state.frag_buf_offs; + sb_map=_enc->state.sb_maps[_mbi>>2][_mbi&3]; + dc_dequant=_enc->state.dequant_tables[_enc->state.qis[0]][0][1][0]; + for(bi=0;bi<4;bi++){ + fragi=sb_map[bi]; + frag_offs=frag_buf_offs[fragi]; + oc_enc_frag_sub(_enc,buffer,src+frag_offs,ref+frag_offs,ystride); + borderi=frags[fragi].borderi; + uncoded_ssd=uncoded_dc=0; + if(borderi<0){ + for(pi=0;pi<64;pi++){ + uncoded_ssd+=buffer[pi]*buffer[pi]; + uncoded_dc+=buffer[pi]; + } + } + else{ + ogg_int64_t mask; + mask=_enc->state.borders[borderi].mask; + for(pi=0;pi<64;pi++,mask>>=1)if(mask&1){ + uncoded_ssd+=buffer[pi]*buffer[pi]; + uncoded_dc+=buffer[pi]; + } + } + /*Scale to match DCT domain.*/ + uncoded_ssd<<=4; + /*We actually only want the AC contribution to the SSD.*/ + uncoded_ssd-=uncoded_dc*uncoded_dc>>2; + /*DC is a special case; if there's more than a full-quantizer improvement + in the effective DC component, always force-code the block.*/ + dc_flag=abs(uncoded_dc)>dc_dequant<<1; + uncoded_ssd|=-dc_flag; + _pipe->skip_ssd[0][fragi-_pipe->froffset[0]]=_ssd[bi]=uncoded_ssd; + } + mb_map=(const oc_mb_map_plane *)_enc->state.mb_maps[_mbi]; + map_nidxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + map_nidxs=(map_nidxs-4>>1)+4; + mapii=4; + for(pli=1;pli<3;pli++){ + ystride=_enc->state.ref_ystride[pli]; + dc_dequant=_enc->state.dequant_tables[_enc->state.qis[0]][pli][1][0]; + for(;mapiistate.borders[borderi].mask; + for(pi=0;pi<64;pi++,mask>>=1)if(mask&1){ + uncoded_ssd+=buffer[pi]*buffer[pi]; + uncoded_dc+=buffer[pi]; + } + } + /*Scale to match DCT domain.*/ + uncoded_ssd<<=4; + /*We actually only want the AC contribution to the SSD.*/ + uncoded_ssd-=uncoded_dc*uncoded_dc>>2; + /*DC is a special case; if there's more than a full-quantizer improvement + in the effective DC component, always force-code the block.*/ + dc_flag=abs(uncoded_dc)>dc_dequant<<1; + uncoded_ssd|=-dc_flag; + _pipe->skip_ssd[pli][fragi-_pipe->froffset[pli]]=_ssd[mapii]=uncoded_ssd; + } + map_nidxs=(map_nidxs-4<<1)+4; + } +} + +static void oc_mb_intra_satd(oc_enc_ctx *_enc,unsigned _mbi, + unsigned _frag_satd[12]){ + const unsigned char *src; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *sb_map; + const oc_mb_map_plane *mb_map; + const unsigned char *map_idxs; + int map_nidxs; + int mapii; + int mapi; + int ystride; + int pli; + int bi; + ptrdiff_t fragi; + ptrdiff_t frag_offs; + frag_buf_offs=_enc->state.frag_buf_offs; + sb_map=_enc->state.sb_maps[_mbi>>2][_mbi&3]; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ystride=_enc->state.ref_ystride[0]; + for(bi=0;bi<4;bi++){ + fragi=sb_map[bi]; + frag_offs=frag_buf_offs[fragi]; + _frag_satd[bi]=oc_enc_frag_intra_satd(_enc,src+frag_offs,ystride); + } + mb_map=(const oc_mb_map_plane *)_enc->state.mb_maps[_mbi]; + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + map_nidxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + /*Note: This assumes ref_ystride[1]==ref_ystride[2].*/ + ystride=_enc->state.ref_ystride[1]; + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_map[pli][bi]; + frag_offs=frag_buf_offs[fragi]; + _frag_satd[mapii]=oc_enc_frag_intra_satd(_enc,src+frag_offs,ystride); + } +} + +static void oc_cost_intra(oc_enc_ctx *_enc,oc_mode_choice *_modec, + unsigned _mbi,const oc_fr_state *_fr,const oc_qii_state *_qs, + const unsigned _frag_satd[12],const unsigned _skip_ssd[12]){ + oc_analyze_mb_mode_luma(_enc,_modec,_fr,_qs,_frag_satd,_skip_ssd,0); + oc_analyze_mb_mode_chroma(_enc,_modec,_fr,_qs,_frag_satd,_skip_ssd,0); + _modec->overhead+= + oc_mode_scheme_chooser_cost(&_enc->chooser,OC_MODE_INTRA)<lambda); +} + +static void oc_cost_inter(oc_enc_ctx *_enc,oc_mode_choice *_modec, + unsigned _mbi,int _mb_mode,const signed char *_mv, + const oc_fr_state *_fr,const oc_qii_state *_qs,const unsigned _skip_ssd[12]){ + unsigned frag_satd[12]; + const unsigned char *src; + const unsigned char *ref; + int ystride; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *sb_map; + const oc_mb_map_plane *mb_map; + const unsigned char *map_idxs; + int map_nidxs; + int mapii; + int mapi; + int mv_offs[2]; + int dx; + int dy; + int pli; + int bi; + ptrdiff_t fragi; + ptrdiff_t frag_offs; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[ + _enc->state.ref_frame_idx[OC_FRAME_FOR_MODE(_mb_mode)]]; + ystride=_enc->state.ref_ystride[0]; + frag_buf_offs=_enc->state.frag_buf_offs; + sb_map=_enc->state.sb_maps[_mbi>>2][_mbi&3]; + dx=_mv[0]; + dy=_mv[1]; + _modec->rate=_modec->ssd=0; + if(oc_state_get_mv_offsets(&_enc->state,mv_offs,0,dx,dy)>1){ + for(bi=0;bi<4;bi++){ + fragi=sb_map[bi]; + frag_offs=frag_buf_offs[fragi]; + frag_satd[bi]=oc_enc_frag_satd2_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ref+frag_offs+mv_offs[1],ystride,UINT_MAX); + } + } + else{ + for(bi=0;bi<4;bi++){ + fragi=sb_map[bi]; + frag_offs=frag_buf_offs[fragi]; + frag_satd[bi]=oc_enc_frag_satd_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ystride,UINT_MAX); + } + } + mb_map=(const oc_mb_map_plane *)_enc->state.mb_maps[_mbi]; + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + map_nidxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + /*Note: This assumes ref_ystride[1]==ref_ystride[2].*/ + ystride=_enc->state.ref_ystride[1]; + if(oc_state_get_mv_offsets(&_enc->state,mv_offs,1,dx,dy)>1){ + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_map[pli][bi]; + frag_offs=frag_buf_offs[fragi]; + frag_satd[mapii]=oc_enc_frag_satd2_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ref+frag_offs+mv_offs[1],ystride,UINT_MAX); + } + } + else{ + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_map[pli][bi]; + frag_offs=frag_buf_offs[fragi]; + frag_satd[mapii]=oc_enc_frag_satd_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ystride,UINT_MAX); + } + } + oc_analyze_mb_mode_luma(_enc,_modec,_fr,_qs,frag_satd,_skip_ssd,1); + oc_analyze_mb_mode_chroma(_enc,_modec,_fr,_qs,frag_satd,_skip_ssd,1); + _modec->overhead+= + oc_mode_scheme_chooser_cost(&_enc->chooser,_mb_mode)<lambda); +} + +static void oc_cost_inter_nomv(oc_enc_ctx *_enc,oc_mode_choice *_modec, + unsigned _mbi,int _mb_mode,const oc_fr_state *_fr,const oc_qii_state *_qs, + const unsigned _skip_ssd[12]){ + static const oc_mv OC_MV_ZERO; + oc_cost_inter(_enc,_modec,_mbi,_mb_mode,OC_MV_ZERO,_fr,_qs,_skip_ssd); +} + +static int oc_cost_inter1mv(oc_enc_ctx *_enc,oc_mode_choice *_modec, + unsigned _mbi,int _mb_mode,const signed char *_mv, + const oc_fr_state *_fr,const oc_qii_state *_qs,const unsigned _skip_ssd[12]){ + int bits0; + oc_cost_inter(_enc,_modec,_mbi,_mb_mode,_mv,_fr,_qs,_skip_ssd); + bits0=OC_MV_BITS[0][_mv[0]+31]+OC_MV_BITS[0][_mv[1]+31]; + _modec->overhead+=OC_MINI(_enc->mv_bits[0]+bits0,_enc->mv_bits[1]+12) + -OC_MINI(_enc->mv_bits[0],_enc->mv_bits[1])<lambda); + return bits0; +} + +/*A mapping from oc_mb_map (raster) ordering to oc_sb_map (Hilbert) ordering.*/ +static const unsigned char OC_MB_PHASE[4][4]={ + {0,1,3,2},{0,3,1,2},{0,3,1,2},{2,3,1,0} +}; + +static void oc_cost_inter4mv(oc_enc_ctx *_enc,oc_mode_choice *_modec, + unsigned _mbi,oc_mv _mv[4],const oc_fr_state *_fr,const oc_qii_state *_qs, + const unsigned _skip_ssd[12]){ + unsigned frag_satd[12]; + oc_mv lbmvs[4]; + oc_mv cbmvs[4]; + const unsigned char *src; + const unsigned char *ref; + int ystride; + const ptrdiff_t *frag_buf_offs; + oc_mv *frag_mvs; + const oc_mb_map_plane *mb_map; + const unsigned char *map_idxs; + int map_nidxs; + int nqis; + int mapii; + int mapi; + int mv_offs[2]; + int dx; + int dy; + int pli; + int bi; + ptrdiff_t fragi; + ptrdiff_t frag_offs; + int bits0; + int bits1; + unsigned satd; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[OC_FRAME_PREV]]; + ystride=_enc->state.ref_ystride[0]; + frag_buf_offs=_enc->state.frag_buf_offs; + frag_mvs=_enc->state.frag_mvs; + mb_map=(const oc_mb_map_plane *)_enc->state.mb_maps[_mbi]; + _modec->rate=_modec->ssd=0; + for(bi=0;bi<4;bi++){ + fragi=mb_map[0][bi]; + dx=_mv[bi][0]; + dy=_mv[bi][1]; + /*Save the block MVs as the current ones while we're here; we'll replace + them if we don't ultimately choose 4MV mode.*/ + frag_mvs[fragi][0]=(signed char)dx; + frag_mvs[fragi][1]=(signed char)dy; + frag_offs=frag_buf_offs[fragi]; + if(oc_state_get_mv_offsets(&_enc->state,mv_offs,0,dx,dy)>1){ + satd=oc_enc_frag_satd2_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ref+frag_offs+mv_offs[1],ystride,UINT_MAX); + } + else{ + satd=oc_enc_frag_satd_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ystride,UINT_MAX); + } + frag_satd[OC_MB_PHASE[_mbi&3][bi]]=satd; + } + oc_analyze_mb_mode_luma(_enc,_modec,_fr,_qs,frag_satd, + _enc->vp3_compatible?OC_NOSKIP:_skip_ssd,1); + /*Figure out which blocks are being skipped and give them (0,0) MVs.*/ + bits0=0; + bits1=0; + nqis=_enc->state.nqis; + for(bi=0;bi<4;bi++){ + if(_modec->qii[OC_MB_PHASE[_mbi&3][bi]]>=nqis){ + memset(lbmvs+bi,0,sizeof(*lbmvs)); + } + else{ + memcpy(lbmvs+bi,_mv+bi,sizeof(*lbmvs)); + bits0+=OC_MV_BITS[0][_mv[bi][0]+31]+OC_MV_BITS[0][_mv[bi][1]+31]; + bits1+=12; + } + } + (*OC_SET_CHROMA_MVS_TABLE[_enc->state.info.pixel_fmt])(cbmvs, + (const oc_mv *)lbmvs); + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + map_nidxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + /*Note: This assumes ref_ystride[1]==ref_ystride[2].*/ + ystride=_enc->state.ref_ystride[1]; + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_map[pli][bi]; + dx=cbmvs[bi][0]; + dy=cbmvs[bi][1]; + frag_offs=frag_buf_offs[fragi]; + /*TODO: We could save half these calls by re-using the results for the Cb + and Cr planes; is it worth it?*/ + if(oc_state_get_mv_offsets(&_enc->state,mv_offs,pli,dx,dy)>1){ + satd=oc_enc_frag_satd2_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ref+frag_offs+mv_offs[1],ystride,UINT_MAX); + } + else{ + satd=oc_enc_frag_satd_thresh(_enc,src+frag_offs, + ref+frag_offs+mv_offs[0],ystride,UINT_MAX); + } + frag_satd[mapii]=satd; + } + oc_analyze_mb_mode_chroma(_enc,_modec,_fr,_qs,frag_satd,_skip_ssd,1); + _modec->overhead+= + oc_mode_scheme_chooser_cost(&_enc->chooser,OC_MODE_INTER_MV_FOUR) + +OC_MINI(_enc->mv_bits[0]+bits0,_enc->mv_bits[1]+bits1) + -OC_MINI(_enc->mv_bits[0],_enc->mv_bits[1])<lambda); +} + +int oc_enc_analyze_inter(oc_enc_ctx *_enc,int _allow_keyframe,int _recode){ + oc_set_chroma_mvs_func set_chroma_mvs; + oc_enc_pipeline_state pipe; + oc_qii_state intra_luma_qs; + oc_mv last_mv; + oc_mv prior_mv; + ogg_int64_t interbits; + ogg_int64_t intrabits; + const unsigned char *map_idxs; + int nmap_idxs; + unsigned *coded_mbis; + unsigned *uncoded_mbis; + size_t ncoded_mbis; + size_t nuncoded_mbis; + oc_sb_flags *sb_flags; + signed char *mb_modes; + const oc_sb_map *sb_maps; + const oc_mb_map *mb_maps; + oc_mb_enc_info *embs; + oc_fragment *frags; + oc_mv *frag_mvs; + unsigned stripe_sby; + unsigned mcu_nvsbs; + int notstart; + int notdone; + unsigned sbi; + unsigned sbi_end; + int refi; + int pli; + set_chroma_mvs=OC_SET_CHROMA_MVS_TABLE[_enc->state.info.pixel_fmt]; + _enc->state.frame_type=OC_INTER_FRAME; + oc_mode_scheme_chooser_reset(&_enc->chooser); + oc_enc_tokenize_start(_enc); + oc_enc_pipeline_init(_enc,&pipe); + if(_allow_keyframe)oc_qii_state_init(&intra_luma_qs); + _enc->mv_bits[0]=_enc->mv_bits[1]=0; + interbits=intrabits=0; + last_mv[0]=last_mv[1]=prior_mv[0]=prior_mv[1]=0; + /*Choose MVs and MB modes and quantize and code luma. + Must be done in Hilbert order.*/ + map_idxs=OC_MB_MAP_IDXS[_enc->state.info.pixel_fmt]; + nmap_idxs=OC_MB_MAP_NIDXS[_enc->state.info.pixel_fmt]; + coded_mbis=_enc->coded_mbis; + uncoded_mbis=coded_mbis+_enc->state.nmbs; + ncoded_mbis=0; + nuncoded_mbis=0; + _enc->state.ncoded_fragis[0]=0; + _enc->state.ncoded_fragis[1]=0; + _enc->state.ncoded_fragis[2]=0; + sb_flags=_enc->state.sb_flags; + mb_modes=_enc->state.mb_modes; + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + mb_maps=(const oc_mb_map *)_enc->state.mb_maps; + embs=_enc->mb_info; + frags=_enc->state.frags; + frag_mvs=_enc->state.frag_mvs; + notstart=0; + notdone=1; + mcu_nvsbs=_enc->mcu_nvsbs; + for(stripe_sby=0;notdone;stripe_sby+=mcu_nvsbs){ + notdone=oc_enc_pipeline_set_stripe(_enc,&pipe,stripe_sby); + sbi_end=pipe.sbi_end[0]; + for(sbi=pipe.sbi0[0];sbisp_levelsp_levellambda*3; + if(modes[OC_MODE_INTER_MV_FOUR].cost>2][mbi&3][bi]; + frags[fragi].qii=modes[mb_mode].qii[bi]; + } + if(oc_enc_mb_transform_quantize_luma(_enc,&pipe,mbi, + modes[mb_mode].overhead>>OC_BIT_SCALE)>0){ + int orig_mb_mode; + orig_mb_mode=mb_mode; + mb_mode=mb_modes[mbi]; + switch(mb_mode){ + case OC_MODE_INTER_MV:{ + memcpy(prior_mv,last_mv,sizeof(prior_mv)); + /*If we're backing out from 4MV, find the MV we're actually + using.*/ + if(orig_mb_mode==OC_MODE_INTER_MV_FOUR){ + for(bi=0;;bi++){ + fragi=mb_maps[mbi][0][bi]; + if(frags[fragi].coded){ + memcpy(last_mv,frag_mvs[fragi],sizeof(last_mv)); + dx=frag_mvs[fragi][0]; + dy=frag_mvs[fragi][1]; + break; + } + } + mb_mv_bits_0=OC_MV_BITS[0][dx+31]+OC_MV_BITS[0][dy+31]; + } + /*Otherwise we used the original analysis MV.*/ + else{ + memcpy(last_mv, + embs[mbi].analysis_mv[0][OC_FRAME_PREV],sizeof(last_mv)); + } + _enc->mv_bits[0]+=mb_mv_bits_0; + _enc->mv_bits[1]+=12; + }break; + case OC_MODE_INTER_MV_LAST2:{ + oc_mv tmp_mv; + memcpy(tmp_mv,prior_mv,sizeof(tmp_mv)); + memcpy(prior_mv,last_mv,sizeof(prior_mv)); + memcpy(last_mv,tmp_mv,sizeof(last_mv)); + }break; + case OC_MODE_GOLDEN_MV:{ + _enc->mv_bits[0]+=mb_gmv_bits_0; + _enc->mv_bits[1]+=12; + }break; + case OC_MODE_INTER_MV_FOUR:{ + oc_mv lbmvs[4]; + oc_mv cbmvs[4]; + memcpy(prior_mv,last_mv,sizeof(prior_mv)); + for(bi=0;bi<4;bi++){ + fragi=mb_maps[mbi][0][bi]; + if(frags[fragi].coded){ + memcpy(last_mv,frag_mvs[fragi],sizeof(last_mv)); + memcpy(lbmvs[bi],frag_mvs[fragi],sizeof(lbmvs[bi])); + _enc->mv_bits[0]+=OC_MV_BITS[0][frag_mvs[fragi][0]+31] + +OC_MV_BITS[0][frag_mvs[fragi][1]+31]; + _enc->mv_bits[1]+=12; + } + /*Replace the block MVs for not-coded blocks with (0,0).*/ + else memset(lbmvs[bi],0,sizeof(lbmvs[bi])); + } + (*set_chroma_mvs)(cbmvs,(const oc_mv *)lbmvs); + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_maps[mbi][pli][bi]; + frags[fragi].mb_mode=mb_mode; + frags[fragi].qii=modes[OC_MODE_INTER_MV_FOUR].qii[mapii]; + memcpy(frag_mvs[fragi],cbmvs[bi],sizeof(frag_mvs[fragi])); + } + }break; + } + coded_mbis[ncoded_mbis++]=mbi; + oc_mode_scheme_chooser_update(&_enc->chooser,mb_mode); + interbits+=modes[mb_mode].rate+modes[mb_mode].overhead; + } + else{ + *(uncoded_mbis-++nuncoded_mbis)=mbi; + mb_mode=OC_MODE_INTER_NOMV; + dx=dy=0; + } + /*Propagate final MB mode and MVs to the chroma blocks. + This has already been done for 4MV mode, since it requires individual + block motion vectors.*/ + if(mb_mode!=OC_MODE_INTER_MV_FOUR){ + for(mapii=4;mapii>2; + bi=mapi&3; + fragi=mb_maps[mbi][pli][bi]; + frags[fragi].mb_mode=mb_mode; + /*If we switched from 4MV mode to INTER_MV mode, then the qii + values won't have been chosen with the right MV, but it's + probaby not worth re-estimating them.*/ + frags[fragi].qii=modes[mb_mode].qii[mapii]; + frag_mvs[fragi][0]=(signed char)dx; + frag_mvs[fragi][1]=(signed char)dy; + } + } + } + oc_fr_state_flush_sb(pipe.fr+0); + sb_flags[sbi].coded_fully=pipe.fr[0].sb_full; + sb_flags[sbi].coded_partially=pipe.fr[0].sb_partial; + } + oc_enc_pipeline_finish_mcu_plane(_enc,&pipe,0,notstart,notdone); + /*Code chroma planes.*/ + for(pli=1;pli<3;pli++){ + oc_enc_sb_transform_quantize_chroma(_enc,&pipe, + pli,pipe.sbi0[pli],pipe.sbi_end[pli]); + oc_enc_pipeline_finish_mcu_plane(_enc,&pipe,pli,notstart,notdone); + } + notstart=1; + } + /*Finish filling in the reference frame borders.*/ + refi=_enc->state.ref_frame_idx[OC_FRAME_SELF]; + for(pli=0;pli<3;pli++)oc_state_borders_fill_caps(&_enc->state,refi,pli); + /*Finish adding flagging overhead costs to inter bit counts to determine if + we should have coded a key frame instead.*/ + if(_allow_keyframe){ + if(interbits>intrabits)return 1; + /*Technically the chroma plane counts are over-estimations, because they + don't account for continuing runs from the luma planes, but the + inaccuracy is small.*/ + for(pli=0;pli<3;pli++)interbits+=pipe.fr[pli].bits<mv_bits[0],_enc->mv_bits[1])<chooser.scheme_bits[_enc->chooser.scheme_list[0]]<intrabits)return 1; + } + _enc->ncoded_mbis=ncoded_mbis; + /*Compact the coded fragment list.*/ + { + ptrdiff_t ncoded_fragis; + ncoded_fragis=_enc->state.ncoded_fragis[0]; + for(pli=1;pli<3;pli++){ + memmove(_enc->state.coded_fragis+ncoded_fragis, + _enc->state.coded_fragis+_enc->state.fplanes[pli].froffset, + _enc->state.ncoded_fragis[pli]*sizeof(*_enc->state.coded_fragis)); + ncoded_fragis+=_enc->state.ncoded_fragis[pli]; + } + _enc->state.ntotal_coded_fragis=ncoded_fragis; + } + return 0; +} + +#if defined(OC_COLLECT_METRICS) +# include +# include + +/*TODO: It may be helpful (for block-level quantizers especially) to separate + out the contributions from AC and DC into separate tables.*/ + +# define OC_ZWEIGHT (0.25) + +static void oc_mode_metrics_add(oc_mode_metrics *_metrics, + double _w,int _satd,int _rate,double _rmse){ + double rate; + /*Accumulate statistics without the scaling; this lets us change the scale + factor yet still use old data.*/ + rate=ldexp(_rate,-OC_BIT_SCALE); + if(_metrics->fragw>0){ + double dsatd; + double drate; + double drmse; + double w; + dsatd=_satd-_metrics->satd/_metrics->fragw; + drate=rate-_metrics->rate/_metrics->fragw; + drmse=_rmse-_metrics->rmse/_metrics->fragw; + w=_metrics->fragw*_w/(_metrics->fragw+_w); + _metrics->satd2+=dsatd*dsatd*w; + _metrics->satdrate+=dsatd*drate*w; + _metrics->rate2+=drate*drate*w; + _metrics->satdrmse+=dsatd*drmse*w; + _metrics->rmse2+=drmse*drmse*w; + } + _metrics->fragw+=_w; + _metrics->satd+=_satd*_w; + _metrics->rate+=rate*_w; + _metrics->rmse+=_rmse*_w; +} + +static void oc_mode_metrics_merge(oc_mode_metrics *_dst, + const oc_mode_metrics *_src,int _n){ + int i; + /*Find a non-empty set of metrics.*/ + for(i=0;i<_n&&_src[i].fragw<=0;i++); + if(i>=_n){ + memset(_dst,0,sizeof(*_dst)); + return; + } + memcpy(_dst,_src+i,sizeof(*_dst)); + /*And iterate over the remaining non-empty sets of metrics.*/ + for(i++;i<_n;i++)if(_src[i].fragw>0){ + double wa; + double wb; + double dsatd; + double drate; + double drmse; + double w; + wa=_dst->fragw; + wb=_src[i].fragw; + dsatd=_src[i].satd/wb-_dst->satd/wa; + drate=_src[i].rate/wb-_dst->rate/wa; + drmse=_src[i].rmse/wb-_dst->rmse/wa; + w=wa*wb/(wa+wb); + _dst->fragw+=_src[i].fragw; + _dst->satd+=_src[i].satd; + _dst->rate+=_src[i].rate; + _dst->rmse+=_src[i].rmse; + _dst->satd2+=_src[i].satd2+dsatd*dsatd*w; + _dst->satdrate+=_src[i].satdrate+dsatd*drate*w; + _dst->rate2+=_src[i].rate2+drate*drate*w; + _dst->satdrmse+=_src[i].satdrmse+dsatd*drmse*w; + _dst->rmse2+=_src[i].rmse2+drmse*drmse*w; + } +} + +/*Compile collected SATD/rate/RMSE metrics into a form that's immediately + useful for mode decision.*/ +static void oc_enc_mode_metrics_update(oc_enc_ctx *_enc,int _qi){ + int pli; + int qti; + oc_restore_fpu(&_enc->state); + /*Convert raw collected data into cleaned up sample points.*/ + for(pli=0;pli<3;pli++){ + for(qti=0;qti<2;qti++){ + double fragw; + int bin0; + int bin1; + int bin; + fragw=0; + bin0=bin1=0; + for(bin=0;bin=OC_ZWEIGHT){ + fragw-=OC_MODE_METRICS[_qi][pli][qti][bin0++].fragw; + } + /*Merge statistics and fit lines.*/ + oc_mode_metrics_merge(&metrics, + OC_MODE_METRICS[_qi][pli][qti]+bin0,bin1-bin0); + if(metrics.fragw>0&&metrics.satd2>0){ + double a; + double b; + double msatd; + double mrate; + double mrmse; + double rate; + double rmse; + msatd=metrics.satd/metrics.fragw; + mrate=metrics.rate/metrics.fragw; + mrmse=metrics.rmse/metrics.fragw; + /*Compute the points on these lines corresponding to the actual bin + value.*/ + b=metrics.satdrate/metrics.satd2; + a=mrate-b*msatd; + rate=ldexp(a+b*(bin<>1); + return -_extra_bits; +} + +/*Handles the pure zero run tokens.*/ +static ptrdiff_t oc_token_skip_zrl(int _token,int _extra_bits){ + return _extra_bits+1; +} + +/*Handles a normal coefficient value token.*/ +static ptrdiff_t oc_token_skip_val(void){ + return 1; +} + +/*Handles a category 1A zero run/coefficient value combo token.*/ +static ptrdiff_t oc_token_skip_run_cat1a(int _token){ + return _token-OC_DCT_RUN_CAT1A+2; +} + +/*Handles category 1b, 1c, 2a, and 2b zero run/coefficient value combo tokens.*/ +static ptrdiff_t oc_token_skip_run(int _token,int _extra_bits){ + int run_cati; + int ncoeffs_mask; + int ncoeffs_adjust; + run_cati=_token-OC_DCT_RUN_CAT1B; + ncoeffs_mask=OC_BYTE_TABLE32(3,7,0,1,run_cati); + ncoeffs_adjust=OC_BYTE_TABLE32(7,11,2,3,run_cati); + return (_extra_bits&ncoeffs_mask)+ncoeffs_adjust; +} + +/*A jump table for computing the number of coefficients or blocks to skip for + a given token value. + This reduces all the conditional branches, etc., needed to parse these token + values down to one indirect jump.*/ +static const oc_token_skip_func OC_TOKEN_SKIP_TABLE[TH_NDCT_TOKENS]={ + oc_token_skip_eob, + oc_token_skip_eob, + oc_token_skip_eob, + oc_token_skip_eob, + oc_token_skip_eob, + oc_token_skip_eob, + oc_token_skip_eob6, + oc_token_skip_zrl, + oc_token_skip_zrl, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_val, + (oc_token_skip_func)oc_token_skip_run_cat1a, + (oc_token_skip_func)oc_token_skip_run_cat1a, + (oc_token_skip_func)oc_token_skip_run_cat1a, + (oc_token_skip_func)oc_token_skip_run_cat1a, + (oc_token_skip_func)oc_token_skip_run_cat1a, + oc_token_skip_run, + oc_token_skip_run, + oc_token_skip_run, + oc_token_skip_run +}; + +/*Determines the number of blocks or coefficients to be skipped for a given + token value. + _token: The token value to skip. + _extra_bits: The extra bits attached to this token. + Return: A positive value indicates that number of coefficients are to be + skipped in the current block. + Otherwise, the negative of the return value indicates that number of + blocks are to be ended. + 0 will never be returned, so that at least one coefficient in one + block will always be decoded for every token.*/ +static ptrdiff_t oc_dct_token_skip(int _token,int _extra_bits){ + return (*OC_TOKEN_SKIP_TABLE[_token])(_token,_extra_bits); +} + + + +void oc_enc_mode_metrics_collect(oc_enc_ctx *_enc){ + static const unsigned char OC_ZZI_HUFF_OFFSET[64]={ + 0,16,16,16,16,16,32,32, + 32,32,32,32,32,32,32,48, + 48,48,48,48,48,48,48,48, + 48,48,48,48,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64 + }; + const oc_fragment *frags; + const unsigned *frag_satd; + const unsigned *frag_ssd; + const ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t fragii; + double fragw; + int qti; + int qii; + int qi; + int pli; + int zzi; + int token; + int eb; + oc_restore_fpu(&_enc->state); + /*Load any existing mode metrics if we haven't already.*/ + if(!oc_has_mode_metrics){ + FILE *fmetrics; + memset(OC_MODE_METRICS,0,sizeof(OC_MODE_METRICS)); + fmetrics=fopen("modedec.stats","rb"); + if(fmetrics!=NULL){ + fread(OC_MODE_METRICS,sizeof(OC_MODE_METRICS),1,fmetrics); + fclose(fmetrics); + } + for(qi=0;qi<64;qi++)oc_enc_mode_metrics_update(_enc,qi); + oc_has_mode_metrics=1; + } + qti=_enc->state.frame_type; + frags=_enc->state.frags; + frag_satd=_enc->frag_satd; + frag_ssd=_enc->frag_ssd; + coded_fragis=_enc->state.coded_fragis; + ncoded_fragis=fragii=0; + /*Weight the fragments by the inverse frame size; this prevents HD content + from dominating the statistics.*/ + fragw=1.0/_enc->state.nfrags; + for(pli=0;pli<3;pli++){ + ptrdiff_t ti[64]; + int eob_token[64]; + int eob_run[64]; + /*Set up token indices and eob run counts. + We don't bother trying to figure out the real cost of the runs that span + coefficients; instead we use the costs that were available when R-D + token optimization was done.*/ + for(zzi=0;zzi<64;zzi++){ + ti[zzi]=_enc->dct_token_offs[pli][zzi]; + if(ti[zzi]>0){ + token=_enc->dct_tokens[pli][zzi][0]; + eb=_enc->extra_bits[pli][zzi][0]; + eob_token[zzi]=token; + eob_run[zzi]=-oc_dct_token_skip(token,eb); + } + else{ + eob_token[zzi]=OC_NDCT_EOB_TOKEN_MAX; + eob_run[zzi]=0; + } + } + /*Scan the list of coded fragments for this plane.*/ + ncoded_fragis+=_enc->state.ncoded_fragis[pli]; + for(;fragii0){ + /*We've reached the end of the block.*/ + eob_run[zzi]--; + break; + } + huffi=_enc->huff_idxs[qti][zzi>0][pli+1>>1] + +OC_ZZI_HUFF_OFFSET[zzi]; + if(eob_token[zzi]huff_codes[huffi][eob_token[zzi]].nbits + +OC_DCT_TOKEN_EXTRA_BITS[eob_token[zzi]]; + eob_token[zzi]=OC_NDCT_EOB_TOKEN_MAX; + } + token=_enc->dct_tokens[pli][zzi][ti[zzi]]; + eb=_enc->extra_bits[pli][zzi][ti[zzi]]; + ti[zzi]++; + skip=oc_dct_token_skip(token,eb); + if(skip<0){ + eob_token[zzi]=token; + eob_run[zzi]=-skip; + } + else{ + /*A regular DCT value token; accumulate the bits for it.*/ + frag_bits+=_enc->huff_codes[huffi][token].nbits + +OC_DCT_TOKEN_EXTRA_BITS[token]; + zzi+=skip; + } + } + mb_mode=frags[fragi].mb_mode; + qi=_enc->state.qis[frags[fragi].qii]; + satd=frag_satd[fragi]<<(pli+1&2); + bin=OC_MINI(satd>>OC_SAD_SHIFT,OC_SAD_BINS-1); + oc_mode_metrics_add(OC_MODE_METRICS[qi][pli][mb_mode!=OC_MODE_INTRA]+bin, + fragw,satd,frag_bits<state.nqis;qii++){ + oc_enc_mode_metrics_update(_enc,_enc->state.qis[qii]); + } +} + +void oc_enc_mode_metrics_dump(oc_enc_ctx *_enc){ + FILE *fmetrics; + int qi; + /*Generate sample points for complete list of QI values.*/ + for(qi=0;qi<64;qi++)oc_enc_mode_metrics_update(_enc,qi); + fmetrics=fopen("modedec.stats","wb"); + if(fmetrics!=NULL){ + fwrite(OC_MODE_METRICS,sizeof(OC_MODE_METRICS),1,fmetrics); + fclose(fmetrics); + } + fprintf(stdout, + "/*File generated by libtheora with OC_COLLECT_METRICS" + " defined at compile time.*/\n" + "#if !defined(_modedec_H)\n" + "# define _modedec_H (1)\n" + "\n" + "\n" + "\n" + "# if defined(OC_COLLECT_METRICS)\n" + "typedef struct oc_mode_metrics oc_mode_metrics;\n" + "# endif\n" + "typedef struct oc_mode_rd oc_mode_rd;\n" + "\n" + "\n" + "\n" + "/*The number of extra bits of precision at which to store rate" + " metrics.*/\n" + "# define OC_BIT_SCALE (%i)\n" + "/*The number of extra bits of precision at which to store RMSE metrics.\n" + " This must be at least half OC_BIT_SCALE (rounded up).*/\n" + "# define OC_RMSE_SCALE (%i)\n" + "/*The number of bins to partition statistics into.*/\n" + "# define OC_SAD_BINS (%i)\n" + "/*The number of bits of precision to drop" + " from SAD scores to assign them to a\n" + " bin.*/\n" + "# define OC_SAD_SHIFT (%i)\n" + "\n" + "\n" + "\n" + "# if defined(OC_COLLECT_METRICS)\n" + "struct oc_mode_metrics{\n" + " double fragw;\n" + " double satd;\n" + " double rate;\n" + " double rmse;\n" + " double satd2;\n" + " double satdrate;\n" + " double rate2;\n" + " double satdrmse;\n" + " double rmse2;\n" + "};\n" + "\n" + "\n" + "int oc_has_mode_metrics;\n" + "oc_mode_metrics OC_MODE_METRICS[64][3][2][OC_SAD_BINS];\n" + "# endif\n" + "\n" + "\n" + "\n" + "struct oc_mode_rd{\n" + " ogg_int16_t rate;\n" + " ogg_int16_t rmse;\n" + "};\n" + "\n" + "\n" + "# if !defined(OC_COLLECT_METRICS)\n" + "static const\n" + "# endif\n" + "oc_mode_rd OC_MODE_RD[64][3][2][OC_SAD_BINS]={\n", + OC_BIT_SCALE,OC_RMSE_SCALE,OC_SAD_BINS,OC_SAD_SHIFT); + for(qi=0;qi<64;qi++){ + int pli; + fprintf(stdout," {\n"); + for(pli=0;pli<3;pli++){ + int qti; + fprintf(stdout," {\n"); + for(qti=0;qti<2;qti++){ + int bin; + static const char *pl_names[3]={"Y'","Cb","Cr"}; + static const char *qti_names[2]={"INTRA","INTER"}; + fprintf(stdout," /*%s qi=%i %s*/\n", + pl_names[pli],qi,qti_names[qti]); + fprintf(stdout," {\n"); + fprintf(stdout," "); + for(bin=0;bin +#include +#include +#include "apiwrapper.h" + + + +const char *theora_version_string(void){ + return th_version_string(); +} + +ogg_uint32_t theora_version_number(void){ + return th_version_number(); +} + +void theora_info_init(theora_info *_ci){ + memset(_ci,0,sizeof(*_ci)); +} + +void theora_info_clear(theora_info *_ci){ + th_api_wrapper *api; + api=(th_api_wrapper *)_ci->codec_setup; + memset(_ci,0,sizeof(*_ci)); + if(api!=NULL){ + if(api->clear!=NULL)(*api->clear)(api); + _ogg_free(api); + } +} + +void theora_clear(theora_state *_th){ + /*Provide compatibility with mixed encoder and decoder shared lib versions.*/ + if(_th->internal_decode!=NULL){ + (*((oc_state_dispatch_vtable *)_th->internal_decode)->clear)(_th); + } + if(_th->internal_encode!=NULL){ + (*((oc_state_dispatch_vtable *)_th->internal_encode)->clear)(_th); + } + if(_th->i!=NULL)theora_info_clear(_th->i); + memset(_th,0,sizeof(*_th)); +} + +int theora_control(theora_state *_th,int _req,void *_buf,size_t _buf_sz){ + /*Provide compatibility with mixed encoder and decoder shared lib versions.*/ + if(_th->internal_decode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_decode)->control)(_th, + _req,_buf,_buf_sz); + } + else if(_th->internal_encode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_encode)->control)(_th, + _req,_buf,_buf_sz); + } + else return TH_EINVAL; +} + +ogg_int64_t theora_granule_frame(theora_state *_th,ogg_int64_t _gp){ + /*Provide compatibility with mixed encoder and decoder shared lib versions.*/ + if(_th->internal_decode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_decode)->granule_frame)( + _th,_gp); + } + else if(_th->internal_encode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_encode)->granule_frame)( + _th,_gp); + } + else return -1; +} + +double theora_granule_time(theora_state *_th, ogg_int64_t _gp){ + /*Provide compatibility with mixed encoder and decoder shared lib versions.*/ + if(_th->internal_decode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_decode)->granule_time)( + _th,_gp); + } + else if(_th->internal_encode!=NULL){ + return (*((oc_state_dispatch_vtable *)_th->internal_encode)->granule_time)( + _th,_gp); + } + else return -1; +} + +void oc_theora_info2th_info(th_info *_info,const theora_info *_ci){ + _info->version_major=_ci->version_major; + _info->version_minor=_ci->version_minor; + _info->version_subminor=_ci->version_subminor; + _info->frame_width=_ci->width; + _info->frame_height=_ci->height; + _info->pic_width=_ci->frame_width; + _info->pic_height=_ci->frame_height; + _info->pic_x=_ci->offset_x; + _info->pic_y=_ci->offset_y; + _info->fps_numerator=_ci->fps_numerator; + _info->fps_denominator=_ci->fps_denominator; + _info->aspect_numerator=_ci->aspect_numerator; + _info->aspect_denominator=_ci->aspect_denominator; + switch(_ci->colorspace){ + case OC_CS_ITU_REC_470M:_info->colorspace=TH_CS_ITU_REC_470M;break; + case OC_CS_ITU_REC_470BG:_info->colorspace=TH_CS_ITU_REC_470BG;break; + default:_info->colorspace=TH_CS_UNSPECIFIED;break; + } + switch(_ci->pixelformat){ + case OC_PF_420:_info->pixel_fmt=TH_PF_420;break; + case OC_PF_422:_info->pixel_fmt=TH_PF_422;break; + case OC_PF_444:_info->pixel_fmt=TH_PF_444;break; + default:_info->pixel_fmt=TH_PF_RSVD; + } + _info->target_bitrate=_ci->target_bitrate; + _info->quality=_ci->quality; + _info->keyframe_granule_shift=_ci->keyframe_frequency_force>0? + OC_MINI(31,oc_ilog(_ci->keyframe_frequency_force-1)):0; +} + +int theora_packet_isheader(ogg_packet *_op){ + return th_packet_isheader(_op); +} + +int theora_packet_iskeyframe(ogg_packet *_op){ + return th_packet_iskeyframe(_op); +} + +int theora_granule_shift(theora_info *_ci){ + /*This breaks when keyframe_frequency_force is not positive or is larger than + 2**31 (if your int is more than 32 bits), but that's what the original + function does.*/ + return oc_ilog(_ci->keyframe_frequency_force-1); +} + +void theora_comment_init(theora_comment *_tc){ + th_comment_init((th_comment *)_tc); +} + +char *theora_comment_query(theora_comment *_tc,char *_tag,int _count){ + return th_comment_query((th_comment *)_tc,_tag,_count); +} + +int theora_comment_query_count(theora_comment *_tc,char *_tag){ + return th_comment_query_count((th_comment *)_tc,_tag); +} + +void theora_comment_clear(theora_comment *_tc){ + th_comment_clear((th_comment *)_tc); +} + +void theora_comment_add(theora_comment *_tc,char *_comment){ + th_comment_add((th_comment *)_tc,_comment); +} + +void theora_comment_add_tag(theora_comment *_tc, char *_tag, char *_value){ + th_comment_add_tag((th_comment *)_tc,_tag,_value); +} diff --git a/libs/libtheora-1.1/lib/apiwrapper.h b/libs/libtheora-1.1/lib/apiwrapper.h new file mode 100644 index 00000000..588f78e6 --- /dev/null +++ b/libs/libtheora-1.1/lib/apiwrapper.h @@ -0,0 +1,54 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: apiwrapper.h 13596 2007-08-23 20:05:38Z tterribe $ + + ********************************************************************/ + +#if !defined(_apiwrapper_H) +# define _apiwrapper_H (1) +# include +# include +# include "theora/theoradec.h" +# include "theora/theoraenc.h" +# include "internal.h" + +typedef struct th_api_wrapper th_api_wrapper; +typedef struct th_api_info th_api_info; + +/*Provide an entry point for the codec setup to clear itself in case we ever + want to break pieces off into a common base library shared by encoder and + decoder. + In addition, this makes several other pieces of the API wrapper cleaner.*/ +typedef void (*oc_setup_clear_func)(void *_ts); + +/*Generally only one of these pointers will be non-NULL in any given instance. + Technically we do not even really need this struct, since we should be able + to figure out which one from "context", but doing it this way makes sure we + don't flub it up.*/ +struct th_api_wrapper{ + oc_setup_clear_func clear; + th_setup_info *setup; + th_dec_ctx *decode; + th_enc_ctx *encode; +}; + +struct th_api_info{ + th_api_wrapper api; + theora_info info; +}; + + +void oc_theora_info2th_info(th_info *_info,const theora_info *_ci); + +#endif diff --git a/libs/libtheora-1.1/lib/bitpack.c b/libs/libtheora-1.1/lib/bitpack.c new file mode 100644 index 00000000..8195003b --- /dev/null +++ b/libs/libtheora-1.1/lib/bitpack.c @@ -0,0 +1,111 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggTheora SOURCE CODE IS (C) COPYRIGHT 1994-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: packing variable sized words into an octet stream + last mod: $Id: bitpack.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include +#include "bitpack.h" + +/*We're 'MSb' endian; if we write a word but read individual bits, + then we'll read the MSb first.*/ + +void oc_pack_readinit(oc_pack_buf *_b,unsigned char *_buf,long _bytes){ + memset(_b,0,sizeof(*_b)); + _b->ptr=_buf; + _b->stop=_buf+_bytes; +} + +static oc_pb_window oc_pack_refill(oc_pack_buf *_b,int _bits){ + const unsigned char *ptr; + const unsigned char *stop; + oc_pb_window window; + int available; + window=_b->window; + available=_b->bits; + ptr=_b->ptr; + stop=_b->stop; + while(available<=OC_PB_WINDOW_SIZE-8&&ptrptr=ptr; + if(_bits>available){ + if(ptr>=stop){ + _b->eof=1; + available=OC_LOTS_OF_BITS; + } + else window|=*ptr>>(available&7); + } + _b->bits=available; + return window; +} + +int oc_pack_look1(oc_pack_buf *_b){ + oc_pb_window window; + int available; + window=_b->window; + available=_b->bits; + if(available<1)_b->window=window=oc_pack_refill(_b,1); + return window>>OC_PB_WINDOW_SIZE-1; +} + +void oc_pack_adv1(oc_pack_buf *_b){ + _b->window<<=1; + _b->bits--; +} + +/*Here we assume that 0<=_bits&&_bits<=32.*/ +long oc_pack_read(oc_pack_buf *_b,int _bits){ + oc_pb_window window; + int available; + long result; + window=_b->window; + available=_b->bits; + if(_bits==0)return 0; + if(available<_bits){ + window=oc_pack_refill(_b,_bits); + available=_b->bits; + } + result=window>>OC_PB_WINDOW_SIZE-_bits; + available-=_bits; + window<<=1; + window<<=_bits-1; + _b->bits=available; + _b->window=window; + return result; +} + +int oc_pack_read1(oc_pack_buf *_b){ + oc_pb_window window; + int available; + int result; + window=_b->window; + available=_b->bits; + if(available<1){ + window=oc_pack_refill(_b,1); + available=_b->bits; + } + result=window>>OC_PB_WINDOW_SIZE-1; + available--; + window<<=1; + _b->bits=available; + _b->window=window; + return result; +} + +long oc_pack_bytes_left(oc_pack_buf *_b){ + if(_b->eof)return -1; + return _b->stop-_b->ptr+(_b->bits>>3); +} diff --git a/libs/libtheora-1.1/lib/bitpack.h b/libs/libtheora-1.1/lib/bitpack.h new file mode 100644 index 00000000..649c6f04 --- /dev/null +++ b/libs/libtheora-1.1/lib/bitpack.h @@ -0,0 +1,60 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggTheora SOURCE CODE IS (C) COPYRIGHT 1994-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: packing variable sized words into an octet stream + last mod: $Id: bitwise.c 7675 2004-09-01 00:34:39Z xiphmont $ + + ********************************************************************/ +#if !defined(_bitpack_H) +# define _bitpack_H (1) +# include +# include + + + +typedef size_t oc_pb_window; +typedef struct oc_pack_buf oc_pack_buf; + + + +# define OC_PB_WINDOW_SIZE ((int)sizeof(oc_pb_window)*CHAR_BIT) +/*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 OC_LOTS_OF_BITS (0x40000000) + + + +struct oc_pack_buf{ + oc_pb_window window; + const unsigned char *ptr; + const unsigned char *stop; + int bits; + int eof; +}; + +void oc_pack_readinit(oc_pack_buf *_b,unsigned char *_buf,long _bytes); +int oc_pack_look1(oc_pack_buf *_b); +void oc_pack_adv1(oc_pack_buf *_b); +/*Here we assume 0<=_bits&&_bits<=32.*/ +long oc_pack_read(oc_pack_buf *_b,int _bits); +int oc_pack_read1(oc_pack_buf *_b); +/* returns -1 for read beyond EOF, or the number of whole bytes available */ +long oc_pack_bytes_left(oc_pack_buf *_b); + +/*These two functions are implemented locally in huffdec.c*/ +/*Read in bits without advancing the bitptr. + Here we assume 0<=_bits&&_bits<=32.*/ +/*static int oc_pack_look(oc_pack_buf *_b,int _bits);*/ +/*static void oc_pack_adv(oc_pack_buf *_b,int _bits);*/ + +#endif diff --git a/libs/libtheora-1.1/lib/cpu.c b/libs/libtheora-1.1/lib/cpu.c new file mode 100644 index 00000000..f7f8d428 --- /dev/null +++ b/libs/libtheora-1.1/lib/cpu.c @@ -0,0 +1,226 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + CPU capability detection for x86 processors. + Originally written by Rudolf Marek. + + function: + last mod: $Id: cpu.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include "cpu.h" + +#if !defined(OC_X86_ASM) +static ogg_uint32_t oc_cpu_flags_get(void){ + return 0; +} +#else +# if !defined(_MSC_VER) +# if defined(__amd64__)||defined(__x86_64__) +/*On x86-64, gcc seems to be able to figure out how to save %rbx for us when + compiling with -fPIC.*/ +# define cpuid(_op,_eax,_ebx,_ecx,_edx) \ + __asm__ __volatile__( \ + "cpuid\n\t" \ + :[eax]"=a"(_eax),[ebx]"=b"(_ebx),[ecx]"=c"(_ecx),[edx]"=d"(_edx) \ + :"a"(_op) \ + :"cc" \ + ) +# else +/*On x86-32, not so much.*/ +# define cpuid(_op,_eax,_ebx,_ecx,_edx) \ + __asm__ __volatile__( \ + "xchgl %%ebx,%[ebx]\n\t" \ + "cpuid\n\t" \ + "xchgl %%ebx,%[ebx]\n\t" \ + :[eax]"=a"(_eax),[ebx]"=r"(_ebx),[ecx]"=c"(_ecx),[edx]"=d"(_edx) \ + :"a"(_op) \ + :"cc" \ + ) +# endif +# else +/*Why does MSVC need this complicated rigamarole? + At this point I honestly do not care.*/ + +/*Visual C cpuid helper function. + For VS2005 we could as well use the _cpuid builtin, but that wouldn't work + for VS2003 users, so we do it in inline assembler.*/ +static void oc_cpuid_helper(ogg_uint32_t _cpu_info[4],ogg_uint32_t _op){ + _asm{ + mov eax,[_op] + mov esi,_cpu_info + cpuid + mov [esi+0],eax + mov [esi+4],ebx + mov [esi+8],ecx + mov [esi+12],edx + } +} + +# define cpuid(_op,_eax,_ebx,_ecx,_edx) \ + do{ \ + ogg_uint32_t cpu_info[4]; \ + oc_cpuid_helper(cpu_info,_op); \ + (_eax)=cpu_info[0]; \ + (_ebx)=cpu_info[1]; \ + (_ecx)=cpu_info[2]; \ + (_edx)=cpu_info[3]; \ + }while(0) + +static void oc_detect_cpuid_helper(ogg_uint32_t *_eax,ogg_uint32_t *_ebx){ + _asm{ + pushfd + pushfd + pop eax + mov ebx,eax + xor eax,200000h + push eax + popfd + pushfd + pop eax + popfd + mov ecx,_eax + mov [ecx],eax + mov ecx,_ebx + mov [ecx],ebx + } +} +# endif + +static ogg_uint32_t oc_parse_intel_flags(ogg_uint32_t _edx,ogg_uint32_t _ecx){ + ogg_uint32_t flags; + /*If there isn't even MMX, give up.*/ + if(!(_edx&0x00800000))return 0; + flags=OC_CPU_X86_MMX; + if(_edx&0x02000000)flags|=OC_CPU_X86_MMXEXT|OC_CPU_X86_SSE; + if(_edx&0x04000000)flags|=OC_CPU_X86_SSE2; + if(_ecx&0x00000001)flags|=OC_CPU_X86_PNI; + if(_ecx&0x00000100)flags|=OC_CPU_X86_SSSE3; + if(_ecx&0x00080000)flags|=OC_CPU_X86_SSE4_1; + if(_ecx&0x00100000)flags|=OC_CPU_X86_SSE4_2; + return flags; +} + +static ogg_uint32_t oc_parse_amd_flags(ogg_uint32_t _edx,ogg_uint32_t _ecx){ + ogg_uint32_t flags; + /*If there isn't even MMX, give up.*/ + if(!(_edx&0x00800000))return 0; + flags=OC_CPU_X86_MMX; + if(_edx&0x00400000)flags|=OC_CPU_X86_MMXEXT; + if(_edx&0x80000000)flags|=OC_CPU_X86_3DNOW; + if(_edx&0x40000000)flags|=OC_CPU_X86_3DNOWEXT; + if(_ecx&0x00000040)flags|=OC_CPU_X86_SSE4A; + if(_ecx&0x00000800)flags|=OC_CPU_X86_SSE5; + return flags; +} + +static ogg_uint32_t oc_cpu_flags_get(void){ + ogg_uint32_t flags; + ogg_uint32_t eax; + ogg_uint32_t ebx; + ogg_uint32_t ecx; + ogg_uint32_t edx; +# if !defined(__amd64__)&&!defined(__x86_64__) + /*Not all x86-32 chips support cpuid, so we have to check.*/ +# if !defined(_MSC_VER) + __asm__ __volatile__( + "pushfl\n\t" + "pushfl\n\t" + "popl %[a]\n\t" + "movl %[a],%[b]\n\t" + "xorl $0x200000,%[a]\n\t" + "pushl %[a]\n\t" + "popfl\n\t" + "pushfl\n\t" + "popl %[a]\n\t" + "popfl\n\t" + :[a]"=r"(eax),[b]"=r"(ebx) + : + :"cc" + ); +# else + oc_detect_cpuid_helper(&eax,&ebx); +# endif + /*No cpuid.*/ + if(eax==ebx)return 0; +# endif + cpuid(0,eax,ebx,ecx,edx); + /* l e t n I e n i u n e G*/ + if(ecx==0x6C65746E&&edx==0x49656E69&&ebx==0x756E6547|| + /* 6 8 x M T e n i u n e G*/ + ecx==0x3638784D&&edx==0x54656E69&&ebx==0x756E6547){ + /*Intel, Transmeta (tested with Crusoe TM5800):*/ + cpuid(1,eax,ebx,ecx,edx); + flags=oc_parse_intel_flags(edx,ecx); + } + /* D M A c i t n e h t u A*/ + else if(ecx==0x444D4163&&edx==0x69746E65&&ebx==0x68747541|| + /* C S N y b e d o e G*/ + ecx==0x43534e20&&edx==0x79622065&&ebx==0x646f6547){ + /*AMD, Geode:*/ + cpuid(0x80000000,eax,ebx,ecx,edx); + if(eax<0x80000001)flags=0; + else{ + cpuid(0x80000001,eax,ebx,ecx,edx); + flags=oc_parse_amd_flags(edx,ecx); + } + /*Also check for SSE.*/ + cpuid(1,eax,ebx,ecx,edx); + flags|=oc_parse_intel_flags(edx,ecx); + } + /*Technically some VIA chips can be configured in the BIOS to return any + string here the user wants. + There is a special detection method that can be used to identify such + processors, but in my opinion, if the user really wants to change it, they + deserve what they get.*/ + /* s l u a H r u a t n e C*/ + else if(ecx==0x736C7561&&edx==0x48727561&&ebx==0x746E6543){ + /*VIA:*/ + /*I only have documentation for the C7 (Esther) and Isaiah (forthcoming) + chips (thanks to the engineers from Centaur Technology who provided it). + These chips support Intel-like cpuid info. + The C3-2 (Nehemiah) cores appear to, as well.*/ + cpuid(1,eax,ebx,ecx,edx); + flags=oc_parse_intel_flags(edx,ecx); + if(eax>=0x80000001){ + /*The (non-Nehemiah) C3 processors support AMD-like cpuid info. + We need to check this even if the Intel test succeeds to pick up 3DNow! + support on these processors. + Unlike actual AMD processors, we cannot _rely_ on this info, since + some cores (e.g., the 693 stepping of the Nehemiah) claim to support + this function, yet return edx=0, despite the Intel test indicating + MMX support. + Therefore the features detected here are strictly added to those + detected by the Intel test.*/ + /*TODO: How about earlier chips?*/ + cpuid(0x80000001,eax,ebx,ecx,edx); + /*Note: As of the C7, this function returns Intel-style extended feature + flags, not AMD-style. + Currently, this only defines bits 11, 20, and 29 (0x20100800), which + do not conflict with any of the AMD flags we inspect. + For the remaining bits, Intel tells us, "Do not count on their value", + but VIA assures us that they will all be zero (at least on the C7 and + Isaiah chips). + In the (unlikely) event a future processor uses bits 18, 19, 30, or 31 + (0xC0C00000) for something else, we will have to add code to detect + the model to decide when it is appropriate to inspect them.*/ + flags|=oc_parse_amd_flags(edx,ecx); + } + } + else{ + /*Implement me.*/ + flags=0; + } + return flags; +} +#endif diff --git a/libs/libtheora-1.1/lib/cpu.h b/libs/libtheora-1.1/lib/cpu.h new file mode 100644 index 00000000..d450185e --- /dev/null +++ b/libs/libtheora-1.1/lib/cpu.h @@ -0,0 +1,34 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + function: + last mod: $Id: cpu.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_x86_cpu_H) +# define _x86_cpu_H (1) +#include "internal.h" + +#define OC_CPU_X86_MMX (1<<0) +#define OC_CPU_X86_3DNOW (1<<1) +#define OC_CPU_X86_3DNOWEXT (1<<2) +#define OC_CPU_X86_MMXEXT (1<<3) +#define OC_CPU_X86_SSE (1<<4) +#define OC_CPU_X86_SSE2 (1<<5) +#define OC_CPU_X86_PNI (1<<6) +#define OC_CPU_X86_SSSE3 (1<<7) +#define OC_CPU_X86_SSE4_1 (1<<8) +#define OC_CPU_X86_SSE4_2 (1<<9) +#define OC_CPU_X86_SSE4A (1<<10) +#define OC_CPU_X86_SSE5 (1<<11) + +#endif diff --git a/libs/libtheora-1.1/lib/dct.h b/libs/libtheora-1.1/lib/dct.h new file mode 100644 index 00000000..091f5c26 --- /dev/null +++ b/libs/libtheora-1.1/lib/dct.h @@ -0,0 +1,31 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: dct.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*Definitions shared by the forward and inverse DCT transforms.*/ +#if !defined(_dct_H) +# define _dct_H (1) + +/*cos(n*pi/16) (resp. sin(m*pi/16)) scaled by 65536.*/ +#define OC_C1S7 ((ogg_int32_t)64277) +#define OC_C2S6 ((ogg_int32_t)60547) +#define OC_C3S5 ((ogg_int32_t)54491) +#define OC_C4S4 ((ogg_int32_t)46341) +#define OC_C5S3 ((ogg_int32_t)36410) +#define OC_C6S2 ((ogg_int32_t)25080) +#define OC_C7S1 ((ogg_int32_t)12785) + +#endif diff --git a/libs/libtheora-1.1/lib/decapiwrapper.c b/libs/libtheora-1.1/lib/decapiwrapper.c new file mode 100644 index 00000000..d3e666cf --- /dev/null +++ b/libs/libtheora-1.1/lib/decapiwrapper.c @@ -0,0 +1,193 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: decapiwrapper.c 13596 2007-08-23 20:05:38Z tterribe $ + + ********************************************************************/ + +#include +#include +#include +#include "apiwrapper.h" +#include "decint.h" +#include "theora/theoradec.h" + +static void th_dec_api_clear(th_api_wrapper *_api){ + if(_api->setup)th_setup_free(_api->setup); + if(_api->decode)th_decode_free(_api->decode); + memset(_api,0,sizeof(*_api)); +} + +static void theora_decode_clear(theora_state *_td){ + if(_td->i!=NULL)theora_info_clear(_td->i); + memset(_td,0,sizeof(*_td)); +} + +static int theora_decode_control(theora_state *_td,int _req, + void *_buf,size_t _buf_sz){ + return th_decode_ctl(((th_api_wrapper *)_td->i->codec_setup)->decode, + _req,_buf,_buf_sz); +} + +static ogg_int64_t theora_decode_granule_frame(theora_state *_td, + ogg_int64_t _gp){ + return th_granule_frame(((th_api_wrapper *)_td->i->codec_setup)->decode,_gp); +} + +static double theora_decode_granule_time(theora_state *_td,ogg_int64_t _gp){ + return th_granule_time(((th_api_wrapper *)_td->i->codec_setup)->decode,_gp); +} + +static const oc_state_dispatch_vtable OC_DEC_DISPATCH_VTBL={ + (oc_state_clear_func)theora_decode_clear, + (oc_state_control_func)theora_decode_control, + (oc_state_granule_frame_func)theora_decode_granule_frame, + (oc_state_granule_time_func)theora_decode_granule_time, +}; + +static void th_info2theora_info(theora_info *_ci,const th_info *_info){ + _ci->version_major=_info->version_major; + _ci->version_minor=_info->version_minor; + _ci->version_subminor=_info->version_subminor; + _ci->width=_info->frame_width; + _ci->height=_info->frame_height; + _ci->frame_width=_info->pic_width; + _ci->frame_height=_info->pic_height; + _ci->offset_x=_info->pic_x; + _ci->offset_y=_info->pic_y; + _ci->fps_numerator=_info->fps_numerator; + _ci->fps_denominator=_info->fps_denominator; + _ci->aspect_numerator=_info->aspect_numerator; + _ci->aspect_denominator=_info->aspect_denominator; + switch(_info->colorspace){ + case TH_CS_ITU_REC_470M:_ci->colorspace=OC_CS_ITU_REC_470M;break; + case TH_CS_ITU_REC_470BG:_ci->colorspace=OC_CS_ITU_REC_470BG;break; + default:_ci->colorspace=OC_CS_UNSPECIFIED;break; + } + switch(_info->pixel_fmt){ + case TH_PF_420:_ci->pixelformat=OC_PF_420;break; + case TH_PF_422:_ci->pixelformat=OC_PF_422;break; + case TH_PF_444:_ci->pixelformat=OC_PF_444;break; + default:_ci->pixelformat=OC_PF_RSVD; + } + _ci->target_bitrate=_info->target_bitrate; + _ci->quality=_info->quality; + _ci->keyframe_frequency_force=1<<_info->keyframe_granule_shift; +} + +int theora_decode_init(theora_state *_td,theora_info *_ci){ + th_api_info *apiinfo; + th_api_wrapper *api; + th_info info; + api=(th_api_wrapper *)_ci->codec_setup; + /*Allocate our own combined API wrapper/theora_info struct. + We put them both in one malloc'd block so that when the API wrapper is + freed, the info struct goes with it. + This avoids having to figure out whether or not we need to free the info + struct in either theora_info_clear() or theora_clear().*/ + apiinfo=(th_api_info *)_ogg_calloc(1,sizeof(*apiinfo)); + if(apiinfo==NULL)return OC_FAULT; + /*Make our own copy of the info struct, since its lifetime should be + independent of the one we were passed in.*/ + *&apiinfo->info=*_ci; + /*Convert the info struct now instead of saving the the one we decoded with + theora_decode_header(), since the user might have modified values (i.e., + color space, aspect ratio, etc. can be specified from a higher level). + The user also might be doing something "clever" with the header packets if + they are not using an Ogg encapsulation.*/ + oc_theora_info2th_info(&info,_ci); + /*Don't bother to copy the setup info; th_decode_alloc() makes its own copy + of the stuff it needs.*/ + apiinfo->api.decode=th_decode_alloc(&info,api->setup); + if(apiinfo->api.decode==NULL){ + _ogg_free(apiinfo); + return OC_EINVAL; + } + apiinfo->api.clear=(oc_setup_clear_func)th_dec_api_clear; + _td->internal_encode=NULL; + /*Provide entry points for ABI compatibility with old decoder shared libs.*/ + _td->internal_decode=(void *)&OC_DEC_DISPATCH_VTBL; + _td->granulepos=0; + _td->i=&apiinfo->info; + _td->i->codec_setup=&apiinfo->api; + return 0; +} + +int theora_decode_header(theora_info *_ci,theora_comment *_cc,ogg_packet *_op){ + th_api_wrapper *api; + th_info info; + int ret; + api=(th_api_wrapper *)_ci->codec_setup; + /*Allocate an API wrapper struct on demand, since it will not also include a + theora_info struct like the ones that are used in a theora_state struct.*/ + if(api==NULL){ + _ci->codec_setup=_ogg_calloc(1,sizeof(*api)); + if(_ci->codec_setup==NULL)return OC_FAULT; + api=(th_api_wrapper *)_ci->codec_setup; + api->clear=(oc_setup_clear_func)th_dec_api_clear; + } + /*Convert from the theora_info struct instead of saving our own th_info + struct between calls. + The user might be doing something "clever" with the header packets if they + are not using an Ogg encapsulation, and we don't want to break this.*/ + oc_theora_info2th_info(&info,_ci); + /*We rely on the fact that theora_comment and th_comment structures are + actually identical. + Take care not to change this fact unless you change the code here as + well!*/ + ret=th_decode_headerin(&info,(th_comment *)_cc,&api->setup,_op); + /*We also rely on the fact that the error return code values are the same, + and that the implementations of these two functions return the same set of + them. + Note that theora_decode_header() really can return OC_NOTFORMAT, even + though it is not currently documented to do so.*/ + if(ret<0)return ret; + th_info2theora_info(_ci,&info); + return 0; +} + +int theora_decode_packetin(theora_state *_td,ogg_packet *_op){ + th_api_wrapper *api; + ogg_int64_t gp; + int ret; + if(!_td||!_td->i||!_td->i->codec_setup)return OC_FAULT; + api=(th_api_wrapper *)_td->i->codec_setup; + ret=th_decode_packetin(api->decode,_op,&gp); + if(ret<0)return OC_BADPACKET; + _td->granulepos=gp; + return 0; +} + +int theora_decode_YUVout(theora_state *_td,yuv_buffer *_yuv){ + th_api_wrapper *api; + th_dec_ctx *decode; + th_ycbcr_buffer buf; + int ret; + if(!_td||!_td->i||!_td->i->codec_setup)return OC_FAULT; + api=(th_api_wrapper *)_td->i->codec_setup; + decode=(th_dec_ctx *)api->decode; + if(!decode)return OC_FAULT; + ret=th_decode_ycbcr_out(decode,buf); + if(ret>=0){ + _yuv->y_width=buf[0].width; + _yuv->y_height=buf[0].height; + _yuv->y_stride=buf[0].stride; + _yuv->uv_width=buf[1].width; + _yuv->uv_height=buf[1].height; + _yuv->uv_stride=buf[1].stride; + _yuv->y=buf[0].data; + _yuv->u=buf[1].data; + _yuv->v=buf[2].data; + } + return ret; +} diff --git a/libs/libtheora-1.1/lib/decinfo.c b/libs/libtheora-1.1/lib/decinfo.c new file mode 100644 index 00000000..72dfbac2 --- /dev/null +++ b/libs/libtheora-1.1/lib/decinfo.c @@ -0,0 +1,246 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: decinfo.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include +#include "decint.h" + + + +/*Unpacks a series of octets from a given byte array into the pack buffer. + No checking is done to ensure the buffer contains enough data. + _opb: The pack buffer to read the octets from. + _buf: The byte array to store the unpacked bytes in. + _len: The number of octets to unpack.*/ +static void oc_unpack_octets(oc_pack_buf *_opb,char *_buf,size_t _len){ + while(_len-->0){ + long val; + val=oc_pack_read(_opb,8); + *_buf++=(char)val; + } +} + +/*Unpacks a 32-bit integer encoded by octets in little-endian form.*/ +static long oc_unpack_length(oc_pack_buf *_opb){ + long ret[4]; + int i; + for(i=0;i<4;i++)ret[i]=oc_pack_read(_opb,8); + return ret[0]|ret[1]<<8|ret[2]<<16|ret[3]<<24; +} + +static int oc_info_unpack(oc_pack_buf *_opb,th_info *_info){ + long val; + /*Check the codec bitstream version.*/ + val=oc_pack_read(_opb,8); + _info->version_major=(unsigned char)val; + val=oc_pack_read(_opb,8); + _info->version_minor=(unsigned char)val; + val=oc_pack_read(_opb,8); + _info->version_subminor=(unsigned char)val; + /*verify we can parse this bitstream version. + We accept earlier minors and all subminors, by spec*/ + if(_info->version_major>TH_VERSION_MAJOR|| + _info->version_major==TH_VERSION_MAJOR&& + _info->version_minor>TH_VERSION_MINOR){ + return TH_EVERSION; + } + /*Read the encoded frame description.*/ + val=oc_pack_read(_opb,16); + _info->frame_width=(ogg_uint32_t)val<<4; + val=oc_pack_read(_opb,16); + _info->frame_height=(ogg_uint32_t)val<<4; + val=oc_pack_read(_opb,24); + _info->pic_width=(ogg_uint32_t)val; + val=oc_pack_read(_opb,24); + _info->pic_height=(ogg_uint32_t)val; + val=oc_pack_read(_opb,8); + _info->pic_x=(ogg_uint32_t)val; + val=oc_pack_read(_opb,8); + _info->pic_y=(ogg_uint32_t)val; + val=oc_pack_read(_opb,32); + _info->fps_numerator=(ogg_uint32_t)val; + val=oc_pack_read(_opb,32); + _info->fps_denominator=(ogg_uint32_t)val; + if(_info->frame_width==0||_info->frame_height==0|| + _info->pic_width+_info->pic_x>_info->frame_width|| + _info->pic_height+_info->pic_y>_info->frame_height|| + _info->fps_numerator==0||_info->fps_denominator==0){ + return TH_EBADHEADER; + } + /*Note: The sense of pic_y is inverted in what we pass back to the + application compared to how it is stored in the bitstream. + This is because the bitstream uses a right-handed coordinate system, while + applications expect a left-handed one.*/ + _info->pic_y=_info->frame_height-_info->pic_height-_info->pic_y; + val=oc_pack_read(_opb,24); + _info->aspect_numerator=(ogg_uint32_t)val; + val=oc_pack_read(_opb,24); + _info->aspect_denominator=(ogg_uint32_t)val; + val=oc_pack_read(_opb,8); + _info->colorspace=(th_colorspace)val; + val=oc_pack_read(_opb,24); + _info->target_bitrate=(int)val; + val=oc_pack_read(_opb,6); + _info->quality=(int)val; + val=oc_pack_read(_opb,5); + _info->keyframe_granule_shift=(int)val; + val=oc_pack_read(_opb,2); + _info->pixel_fmt=(th_pixel_fmt)val; + if(_info->pixel_fmt==TH_PF_RSVD)return TH_EBADHEADER; + val=oc_pack_read(_opb,3); + if(val!=0||oc_pack_bytes_left(_opb)<0)return TH_EBADHEADER; + return 0; +} + +static int oc_comment_unpack(oc_pack_buf *_opb,th_comment *_tc){ + long len; + int i; + /*Read the vendor string.*/ + len=oc_unpack_length(_opb); + if(len<0||len>oc_pack_bytes_left(_opb))return TH_EBADHEADER; + _tc->vendor=_ogg_malloc((size_t)len+1); + if(_tc->vendor==NULL)return TH_EFAULT; + oc_unpack_octets(_opb,_tc->vendor,len); + _tc->vendor[len]='\0'; + /*Read the user comments.*/ + _tc->comments=(int)oc_unpack_length(_opb); + len=_tc->comments; + if(len<0||len>(LONG_MAX>>2)||len<<2>oc_pack_bytes_left(_opb)){ + _tc->comments=0; + return TH_EBADHEADER; + } + _tc->comment_lengths=(int *)_ogg_malloc( + _tc->comments*sizeof(_tc->comment_lengths[0])); + _tc->user_comments=(char **)_ogg_malloc( + _tc->comments*sizeof(_tc->user_comments[0])); + for(i=0;i<_tc->comments;i++){ + len=oc_unpack_length(_opb); + if(len<0||len>oc_pack_bytes_left(_opb)){ + _tc->comments=i; + return TH_EBADHEADER; + } + _tc->comment_lengths[i]=len; + _tc->user_comments[i]=_ogg_malloc((size_t)len+1); + if(_tc->user_comments[i]==NULL){ + _tc->comments=i; + return TH_EFAULT; + } + oc_unpack_octets(_opb,_tc->user_comments[i],len); + _tc->user_comments[i][len]='\0'; + } + return oc_pack_bytes_left(_opb)<0?TH_EBADHEADER:0; +} + +static int oc_setup_unpack(oc_pack_buf *_opb,th_setup_info *_setup){ + int ret; + /*Read the quantizer tables.*/ + ret=oc_quant_params_unpack(_opb,&_setup->qinfo); + if(ret<0)return ret; + /*Read the Huffman trees.*/ + return oc_huff_trees_unpack(_opb,_setup->huff_tables); +} + +static void oc_setup_clear(th_setup_info *_setup){ + oc_quant_params_clear(&_setup->qinfo); + oc_huff_trees_clear(_setup->huff_tables); +} + +static int oc_dec_headerin(oc_pack_buf *_opb,th_info *_info, + th_comment *_tc,th_setup_info **_setup,ogg_packet *_op){ + char buffer[6]; + long val; + int packtype; + int ret; + val=oc_pack_read(_opb,8); + packtype=(int)val; + /*If we're at a data packet and we have received all three headers, we're + done.*/ + if(!(packtype&0x80)&&_info->frame_width>0&&_tc->vendor!=NULL&&*_setup!=NULL){ + return 0; + } + /*Check the codec string.*/ + oc_unpack_octets(_opb,buffer,6); + if(memcmp(buffer,"theora",6)!=0)return TH_ENOTFORMAT; + switch(packtype){ + /*Codec info header.*/ + case 0x80:{ + /*This should be the first packet, and we should not already be + initialized.*/ + if(!_op->b_o_s||_info->frame_width>0)return TH_EBADHEADER; + ret=oc_info_unpack(_opb,_info); + if(ret<0)th_info_clear(_info); + else ret=3; + }break; + /*Comment header.*/ + case 0x81:{ + if(_tc==NULL)return TH_EFAULT; + /*We shoud have already decoded the info header, and should not yet have + decoded the comment header.*/ + if(_info->frame_width==0||_tc->vendor!=NULL)return TH_EBADHEADER; + ret=oc_comment_unpack(_opb,_tc); + if(ret<0)th_comment_clear(_tc); + else ret=2; + }break; + /*Codec setup header.*/ + case 0x82:{ + oc_setup_info *setup; + if(_tc==NULL||_setup==NULL)return TH_EFAULT; + /*We should have already decoded the info header and the comment header, + and should not yet have decoded the setup header.*/ + if(_info->frame_width==0||_tc->vendor==NULL||*_setup!=NULL){ + return TH_EBADHEADER; + } + setup=(oc_setup_info *)_ogg_calloc(1,sizeof(*setup)); + if(setup==NULL)return TH_EFAULT; + ret=oc_setup_unpack(_opb,setup); + if(ret<0){ + oc_setup_clear(setup); + _ogg_free(setup); + } + else{ + *_setup=setup; + ret=1; + } + }break; + default:{ + /*We don't know what this header is.*/ + return TH_EBADHEADER; + }break; + } + return ret; +} + + +/*Decodes one header packet. + This should be called repeatedly with the packets at the beginning of the + stream until it returns 0.*/ +int th_decode_headerin(th_info *_info,th_comment *_tc, + th_setup_info **_setup,ogg_packet *_op){ + oc_pack_buf opb; + if(_op==NULL)return TH_EBADHEADER; + if(_info==NULL)return TH_EFAULT; + oc_pack_readinit(&opb,_op->packet,_op->bytes); + return oc_dec_headerin(&opb,_info,_tc,_setup,_op); +} + +void th_setup_free(th_setup_info *_setup){ + if(_setup!=NULL){ + oc_setup_clear(_setup); + _ogg_free(_setup); + } +} diff --git a/libs/libtheora-1.1/lib/decint.h b/libs/libtheora-1.1/lib/decint.h new file mode 100644 index 00000000..17de16c1 --- /dev/null +++ b/libs/libtheora-1.1/lib/decint.h @@ -0,0 +1,107 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: decint.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#if !defined(_decint_H) +# define _decint_H (1) +# include "theora/theoradec.h" +# include "internal.h" +# include "bitpack.h" + +typedef struct th_setup_info oc_setup_info; +typedef struct th_dec_ctx oc_dec_ctx; + +# include "huffdec.h" +# include "dequant.h" + +/*Constants for the packet-in state machine specific to the decoder.*/ + +/*Next packet to read: Data packet.*/ +#define OC_PACKET_DATA (0) + + + +struct th_setup_info{ + /*The Huffman codes.*/ + oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES]; + /*The quantization parameters.*/ + th_quant_info qinfo; +}; + + + +struct th_dec_ctx{ + /*Shared encoder/decoder state.*/ + oc_theora_state state; + /*Whether or not packets are ready to be emitted. + This takes on negative values while there are remaining header packets to + be emitted, reaches 0 when the codec is ready for input, and goes to 1 + when a frame has been processed and a data packet is ready.*/ + int packet_state; + /*Buffer in which to assemble packets.*/ + oc_pack_buf opb; + /*Huffman decode trees.*/ + oc_huff_node *huff_tables[TH_NHUFFMAN_TABLES]; + /*The index of the first token in each plane for each coefficient.*/ + ptrdiff_t ti0[3][64]; + /*The number of outstanding EOB runs at the start of each coefficient in each + plane.*/ + ptrdiff_t eob_runs[3][64]; + /*The DCT token lists.*/ + unsigned char *dct_tokens; + /*The extra bits associated with DCT tokens.*/ + unsigned char *extra_bits; + /*The number of dct tokens unpacked so far.*/ + int dct_tokens_count; + /*The out-of-loop post-processing level.*/ + int pp_level; + /*The DC scale used for out-of-loop deblocking.*/ + int pp_dc_scale[64]; + /*The sharpen modifier used for out-of-loop deringing.*/ + int pp_sharp_mod[64]; + /*The DC quantization index of each block.*/ + unsigned char *dc_qis; + /*The variance of each block.*/ + int *variances; + /*The storage for the post-processed frame buffer.*/ + unsigned char *pp_frame_data; + /*Whether or not the post-processsed frame buffer has space for chroma.*/ + int pp_frame_state; + /*The buffer used for the post-processed frame. + Note that this is _not_ guaranteed to have the same strides and offsets as + the reference frame buffers.*/ + th_ycbcr_buffer pp_frame_buf; + /*The striped decode callback function.*/ + th_stripe_callback stripe_cb; +# if defined(HAVE_CAIRO) + /*Output metrics for debugging.*/ + int telemetry; + int telemetry_mbmode; + int telemetry_mv; + int telemetry_qi; + int telemetry_bits; + int telemetry_frame_bytes; + int telemetry_coding_bytes; + int telemetry_mode_bytes; + int telemetry_mv_bytes; + int telemetry_qi_bytes; + int telemetry_dc_bytes; + unsigned char *telemetry_frame_data; +# endif +}; + +#endif diff --git a/libs/libtheora-1.1/lib/decode.c b/libs/libtheora-1.1/lib/decode.c new file mode 100644 index 00000000..41d02202 --- /dev/null +++ b/libs/libtheora-1.1/lib/decode.c @@ -0,0 +1,2943 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: decode.c 16581 2009-09-25 22:56:16Z gmaxwell $ + + ********************************************************************/ + +#include +#include +#include +#include "decint.h" +#if defined(OC_DUMP_IMAGES) +# include +# include "png.h" +#endif +#if defined(HAVE_CAIRO) +# include +#endif + + +/*No post-processing.*/ +#define OC_PP_LEVEL_DISABLED (0) +/*Keep track of DC qi for each block only.*/ +#define OC_PP_LEVEL_TRACKDCQI (1) +/*Deblock the luma plane.*/ +#define OC_PP_LEVEL_DEBLOCKY (2) +/*Dering the luma plane.*/ +#define OC_PP_LEVEL_DERINGY (3) +/*Stronger luma plane deringing.*/ +#define OC_PP_LEVEL_SDERINGY (4) +/*Deblock the chroma planes.*/ +#define OC_PP_LEVEL_DEBLOCKC (5) +/*Dering the chroma planes.*/ +#define OC_PP_LEVEL_DERINGC (6) +/*Stronger chroma plane deringing.*/ +#define OC_PP_LEVEL_SDERINGC (7) +/*Maximum valid post-processing level.*/ +#define OC_PP_LEVEL_MAX (7) + + + +/*The mode alphabets for the various mode coding schemes. + Scheme 0 uses a custom alphabet, which is not stored in this table.*/ +static const unsigned char OC_MODE_ALPHABETS[7][OC_NMODES]={ + /*Last MV dominates */ + { + OC_MODE_INTER_MV_LAST,OC_MODE_INTER_MV_LAST2,OC_MODE_INTER_MV, + OC_MODE_INTER_NOMV,OC_MODE_INTRA,OC_MODE_GOLDEN_NOMV,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + }, + { + OC_MODE_INTER_MV_LAST,OC_MODE_INTER_MV_LAST2,OC_MODE_INTER_NOMV, + OC_MODE_INTER_MV,OC_MODE_INTRA,OC_MODE_GOLDEN_NOMV,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + }, + { + OC_MODE_INTER_MV_LAST,OC_MODE_INTER_MV,OC_MODE_INTER_MV_LAST2, + OC_MODE_INTER_NOMV,OC_MODE_INTRA,OC_MODE_GOLDEN_NOMV,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + }, + { + OC_MODE_INTER_MV_LAST,OC_MODE_INTER_MV,OC_MODE_INTER_NOMV, + OC_MODE_INTER_MV_LAST2,OC_MODE_INTRA,OC_MODE_GOLDEN_NOMV, + OC_MODE_GOLDEN_MV,OC_MODE_INTER_MV_FOUR + }, + /*No MV dominates.*/ + { + OC_MODE_INTER_NOMV,OC_MODE_INTER_MV_LAST,OC_MODE_INTER_MV_LAST2, + OC_MODE_INTER_MV,OC_MODE_INTRA,OC_MODE_GOLDEN_NOMV,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + }, + { + OC_MODE_INTER_NOMV,OC_MODE_GOLDEN_NOMV,OC_MODE_INTER_MV_LAST, + OC_MODE_INTER_MV_LAST2,OC_MODE_INTER_MV,OC_MODE_INTRA,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + }, + /*Default ordering.*/ + { + OC_MODE_INTER_NOMV,OC_MODE_INTRA,OC_MODE_INTER_MV,OC_MODE_INTER_MV_LAST, + OC_MODE_INTER_MV_LAST2,OC_MODE_GOLDEN_NOMV,OC_MODE_GOLDEN_MV, + OC_MODE_INTER_MV_FOUR + } +}; + + +/*The original DCT tokens are extended and reordered during the construction of + the Huffman tables. + The extension means more bits can be read with fewer calls to the bitpacker + during the Huffman decoding process (at the cost of larger Huffman tables), + and fewer tokens require additional extra bits (reducing the average storage + per decoded token). + The revised ordering reveals essential information in the token value + itself; specifically, whether or not there are additional extra bits to read + and the parameter to which those extra bits are applied. + The token is used to fetch a code word from the OC_DCT_CODE_WORD table below. + The extra bits are added into code word at the bit position inferred from the + token value, giving the final code word from which all required parameters + are derived. + The number of EOBs and the leading zero run length can be extracted directly. + The coefficient magnitude is optionally negated before extraction, according + to a 'flip' bit.*/ + +/*The number of additional extra bits that are decoded with each of the + internal DCT tokens.*/ +static const unsigned char OC_INTERNAL_DCT_TOKEN_EXTRA_BITS[15]={ + 12,4,3,3,4,4,5,5,8,8,8,8,3,3,6 +}; + +/*Whether or not an internal token needs any additional extra bits.*/ +#define OC_DCT_TOKEN_NEEDS_MORE(token) \ + (token<(sizeof(OC_INTERNAL_DCT_TOKEN_EXTRA_BITS)/ \ + sizeof(*OC_INTERNAL_DCT_TOKEN_EXTRA_BITS))) + +/*This token (OC_DCT_REPEAT_RUN3_TOKEN) requires more than 8 extra bits.*/ +#define OC_DCT_TOKEN_FAT_EOB (0) + +/*The number of EOBs to use for an end-of-frame token. + Note: We want to set eobs to PTRDIFF_MAX here, but that requires C99, which + is not yet available everywhere; this should be equivalent.*/ +#define OC_DCT_EOB_FINISH (~(size_t)0>>1) + +/*The location of the (6) run legth bits in the code word. + These are placed at index 0 and given 8 bits (even though 6 would suffice) + because it may be faster to extract the lower byte on some platforms.*/ +#define OC_DCT_CW_RLEN_SHIFT (0) +/*The location of the (12) EOB bits in the code word.*/ +#define OC_DCT_CW_EOB_SHIFT (8) +/*The location of the (1) flip bit in the code word. + This must be right under the magnitude bits.*/ +#define OC_DCT_CW_FLIP_BIT (20) +/*The location of the (11) token magnitude bits in the code word. + These must be last, and rely on a sign-extending right shift.*/ +#define OC_DCT_CW_MAG_SHIFT (21) + +/*Pack the given fields into a code word.*/ +#define OC_DCT_CW_PACK(_eobs,_rlen,_mag,_flip) \ + ((_eobs)<state,_info,3); + if(ret<0)return ret; + ret=oc_huff_trees_copy(_dec->huff_tables, + (const oc_huff_node *const *)_setup->huff_tables); + if(ret<0){ + oc_state_clear(&_dec->state); + return ret; + } + /*For each fragment, allocate one byte for every DCT coefficient token, plus + one byte for extra-bits for each token, plus one more byte for the long + EOB run, just in case it's the very last token and has a run length of + one.*/ + _dec->dct_tokens=(unsigned char *)_ogg_malloc((64+64+1)* + _dec->state.nfrags*sizeof(_dec->dct_tokens[0])); + if(_dec->dct_tokens==NULL){ + oc_huff_trees_clear(_dec->huff_tables); + oc_state_clear(&_dec->state); + return TH_EFAULT; + } + for(qi=0;qi<64;qi++)for(pli=0;pli<3;pli++)for(qti=0;qti<2;qti++){ + _dec->state.dequant_tables[qi][pli][qti]= + _dec->state.dequant_table_data[qi][pli][qti]; + } + oc_dequant_tables_init(_dec->state.dequant_tables,_dec->pp_dc_scale, + &_setup->qinfo); + for(qi=0;qi<64;qi++){ + int qsum; + qsum=0; + for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){ + qsum+=_dec->state.dequant_tables[qti][pli][qi][12]+ + _dec->state.dequant_tables[qti][pli][qi][17]+ + _dec->state.dequant_tables[qti][pli][qi][18]+ + _dec->state.dequant_tables[qti][pli][qi][24]<<(pli==0); + } + _dec->pp_sharp_mod[qi]=-(qsum>>11); + } + memcpy(_dec->state.loop_filter_limits,_setup->qinfo.loop_filter_limits, + sizeof(_dec->state.loop_filter_limits)); + _dec->pp_level=OC_PP_LEVEL_DISABLED; + _dec->dc_qis=NULL; + _dec->variances=NULL; + _dec->pp_frame_data=NULL; + _dec->stripe_cb.ctx=NULL; + _dec->stripe_cb.stripe_decoded=NULL; +#if defined(HAVE_CAIRO) + _dec->telemetry=0; + _dec->telemetry_bits=0; + _dec->telemetry_qi=0; + _dec->telemetry_mbmode=0; + _dec->telemetry_mv=0; + _dec->telemetry_frame_data=NULL; +#endif + return 0; +} + +static void oc_dec_clear(oc_dec_ctx *_dec){ +#if defined(HAVE_CAIRO) + _ogg_free(_dec->telemetry_frame_data); +#endif + _ogg_free(_dec->pp_frame_data); + _ogg_free(_dec->variances); + _ogg_free(_dec->dc_qis); + _ogg_free(_dec->dct_tokens); + oc_huff_trees_clear(_dec->huff_tables); + oc_state_clear(&_dec->state); +} + + +static int oc_dec_frame_header_unpack(oc_dec_ctx *_dec){ + long val; + /*Check to make sure this is a data packet.*/ + val=oc_pack_read1(&_dec->opb); + if(val!=0)return TH_EBADPACKET; + /*Read in the frame type (I or P).*/ + val=oc_pack_read1(&_dec->opb); + _dec->state.frame_type=(int)val; + /*Read in the qi list.*/ + val=oc_pack_read(&_dec->opb,6); + _dec->state.qis[0]=(unsigned char)val; + val=oc_pack_read1(&_dec->opb); + if(!val)_dec->state.nqis=1; + else{ + val=oc_pack_read(&_dec->opb,6); + _dec->state.qis[1]=(unsigned char)val; + val=oc_pack_read1(&_dec->opb); + if(!val)_dec->state.nqis=2; + else{ + val=oc_pack_read(&_dec->opb,6); + _dec->state.qis[2]=(unsigned char)val; + _dec->state.nqis=3; + } + } + if(_dec->state.frame_type==OC_INTRA_FRAME){ + /*Keyframes have 3 unused configuration bits, holdovers from VP3 days. + Most of the other unused bits in the VP3 headers were eliminated. + I don't know why these remain.*/ + /*I wanted to eliminate wasted bits, but not all config wiggle room + --Monty.*/ + val=oc_pack_read(&_dec->opb,3); + if(val!=0)return TH_EIMPL; + } + return 0; +} + +/*Mark all fragments as coded and in OC_MODE_INTRA. + This also builds up the coded fragment list (in coded order), and clears the + uncoded fragment list. + It does not update the coded macro block list nor the super block flags, as + those are not used when decoding INTRA frames.*/ +static void oc_dec_mark_all_intra(oc_dec_ctx *_dec){ + const oc_sb_map *sb_maps; + const oc_sb_flags *sb_flags; + oc_fragment *frags; + ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t prev_ncoded_fragis; + unsigned nsbs; + unsigned sbi; + int pli; + coded_fragis=_dec->state.coded_fragis; + prev_ncoded_fragis=ncoded_fragis=0; + sb_maps=(const oc_sb_map *)_dec->state.sb_maps; + sb_flags=_dec->state.sb_flags; + frags=_dec->state.frags; + sbi=nsbs=0; + for(pli=0;pli<3;pli++){ + nsbs+=_dec->state.fplanes[pli].nsbs; + for(;sbi=0){ + frags[fragi].coded=1; + frags[fragi].mb_mode=OC_MODE_INTRA; + coded_fragis[ncoded_fragis++]=fragi; + } + } + } + } + _dec->state.ncoded_fragis[pli]=ncoded_fragis-prev_ncoded_fragis; + prev_ncoded_fragis=ncoded_fragis; + } + _dec->state.ntotal_coded_fragis=ncoded_fragis; +} + +/*Decodes the bit flags indicating whether each super block is partially coded + or not. + Return: The number of partially coded super blocks.*/ +static unsigned oc_dec_partial_sb_flags_unpack(oc_dec_ctx *_dec){ + oc_sb_flags *sb_flags; + unsigned nsbs; + unsigned sbi; + unsigned npartial; + unsigned run_count; + long val; + int flag; + val=oc_pack_read1(&_dec->opb); + flag=(int)val; + sb_flags=_dec->state.sb_flags; + nsbs=_dec->state.nsbs; + sbi=npartial=0; + while(sbiopb); + full_run=run_count>=4129; + do{ + sb_flags[sbi].coded_partially=flag; + sb_flags[sbi].coded_fully=0; + npartial+=flag; + sbi++; + } + while(--run_count>0&&sbiopb); + flag=(int)val; + } + else flag=!flag; + } + /*TODO: run_count should be 0 here. + If it's not, we should issue a warning of some kind.*/ + return npartial; +} + +/*Decodes the bit flags for whether or not each non-partially-coded super + block is fully coded or not. + This function should only be called if there is at least one + non-partially-coded super block. + Return: The number of partially coded super blocks.*/ +static void oc_dec_coded_sb_flags_unpack(oc_dec_ctx *_dec){ + oc_sb_flags *sb_flags; + unsigned nsbs; + unsigned sbi; + unsigned run_count; + long val; + int flag; + sb_flags=_dec->state.sb_flags; + nsbs=_dec->state.nsbs; + /*Skip partially coded super blocks.*/ + for(sbi=0;sb_flags[sbi].coded_partially;sbi++); + val=oc_pack_read1(&_dec->opb); + flag=(int)val; + do{ + int full_run; + run_count=oc_sb_run_unpack(&_dec->opb); + full_run=run_count>=4129; + for(;sbiopb); + flag=(int)val; + } + else flag=!flag; + } + while(sbistate.nsbs)oc_dec_coded_sb_flags_unpack(_dec); + if(npartial>0){ + val=oc_pack_read1(&_dec->opb); + flag=!(int)val; + } + else flag=0; + sb_maps=(const oc_sb_map *)_dec->state.sb_maps; + sb_flags=_dec->state.sb_flags; + frags=_dec->state.frags; + sbi=nsbs=run_count=0; + coded_fragis=_dec->state.coded_fragis; + uncoded_fragis=coded_fragis+_dec->state.nfrags; + prev_ncoded_fragis=ncoded_fragis=nuncoded_fragis=0; + for(pli=0;pli<3;pli++){ + nsbs+=_dec->state.fplanes[pli].nsbs; + for(;sbi=0){ + int coded; + if(sb_flags[sbi].coded_fully)coded=1; + else if(!sb_flags[sbi].coded_partially)coded=0; + else{ + if(run_count<=0){ + run_count=oc_block_run_unpack(&_dec->opb); + flag=!flag; + } + run_count--; + coded=flag; + } + if(coded)coded_fragis[ncoded_fragis++]=fragi; + else *(uncoded_fragis-++nuncoded_fragis)=fragi; + frags[fragi].coded=coded; + } + } + } + } + _dec->state.ncoded_fragis[pli]=ncoded_fragis-prev_ncoded_fragis; + prev_ncoded_fragis=ncoded_fragis; + } + _dec->state.ntotal_coded_fragis=ncoded_fragis; + /*TODO: run_count should be 0 here. + If it's not, we should issue a warning of some kind.*/ +} + + + +typedef int (*oc_mode_unpack_func)(oc_pack_buf *_opb); + +static int oc_vlc_mode_unpack(oc_pack_buf *_opb){ + long val; + int i; + for(i=0;i<7;i++){ + val=oc_pack_read1(_opb); + if(!val)break; + } + return i; +} + +static int oc_clc_mode_unpack(oc_pack_buf *_opb){ + long val; + val=oc_pack_read(_opb,3); + return (int)val; +} + +/*Unpacks the list of macro block modes for INTER frames.*/ +static void oc_dec_mb_modes_unpack(oc_dec_ctx *_dec){ + const oc_mb_map *mb_maps; + signed char *mb_modes; + const oc_fragment *frags; + const unsigned char *alphabet; + unsigned char scheme0_alphabet[8]; + oc_mode_unpack_func mode_unpack; + size_t nmbs; + size_t mbi; + long val; + int mode_scheme; + val=oc_pack_read(&_dec->opb,3); + mode_scheme=(int)val; + if(mode_scheme==0){ + int mi; + /*Just in case, initialize the modes to something. + If the bitstream doesn't contain each index exactly once, it's likely + corrupt and the rest of the packet is garbage anyway, but this way we + won't crash, and we'll decode SOMETHING.*/ + /*LOOP VECTORIZES*/ + for(mi=0;miopb,3); + scheme0_alphabet[val]=OC_MODE_ALPHABETS[6][mi]; + } + alphabet=scheme0_alphabet; + } + else alphabet=OC_MODE_ALPHABETS[mode_scheme-1]; + if(mode_scheme==7)mode_unpack=oc_clc_mode_unpack; + else mode_unpack=oc_vlc_mode_unpack; + mb_modes=_dec->state.mb_modes; + mb_maps=(const oc_mb_map *)_dec->state.mb_maps; + nmbs=_dec->state.nmbs; + frags=_dec->state.frags; + for(mbi=0;mbiopb)]; + /*There were none: INTER_NOMV is forced.*/ + else mb_modes[mbi]=OC_MODE_INTER_NOMV; + } + } +} + + + +typedef int (*oc_mv_comp_unpack_func)(oc_pack_buf *_opb); + +static int oc_vlc_mv_comp_unpack(oc_pack_buf *_opb){ + long bits; + int mask; + int mv; + bits=oc_pack_read(_opb,3); + switch(bits){ + case 0:return 0; + case 1:return 1; + case 2:return -1; + case 3: + case 4:{ + mv=(int)(bits-1); + bits=oc_pack_read1(_opb); + }break; + /*case 5: + case 6: + case 7:*/ + default:{ + mv=1<>1); + bits&=1; + }break; + } + mask=-(int)bits; + return mv+mask^mask; +} + +static int oc_clc_mv_comp_unpack(oc_pack_buf *_opb){ + long bits; + int mask; + int mv; + bits=oc_pack_read(_opb,6); + mv=(int)bits>>1; + mask=-((int)bits&1); + return mv+mask^mask; +} + +/*Unpacks the list of motion vectors for INTER frames, and propagtes the macro + block modes and motion vectors to the individual fragments.*/ +static void oc_dec_mv_unpack_and_frag_modes_fill(oc_dec_ctx *_dec){ + const oc_mb_map *mb_maps; + const signed char *mb_modes; + oc_set_chroma_mvs_func set_chroma_mvs; + oc_mv_comp_unpack_func mv_comp_unpack; + oc_fragment *frags; + oc_mv *frag_mvs; + const unsigned char *map_idxs; + int map_nidxs; + oc_mv last_mv[2]; + oc_mv cbmvs[4]; + size_t nmbs; + size_t mbi; + long val; + set_chroma_mvs=OC_SET_CHROMA_MVS_TABLE[_dec->state.info.pixel_fmt]; + val=oc_pack_read1(&_dec->opb); + mv_comp_unpack=val?oc_clc_mv_comp_unpack:oc_vlc_mv_comp_unpack; + map_idxs=OC_MB_MAP_IDXS[_dec->state.info.pixel_fmt]; + map_nidxs=OC_MB_MAP_NIDXS[_dec->state.info.pixel_fmt]; + memset(last_mv,0,sizeof(last_mv)); + frags=_dec->state.frags; + frag_mvs=_dec->state.frag_mvs; + mb_maps=(const oc_mb_map *)_dec->state.mb_maps; + mb_modes=_dec->state.mb_modes; + nmbs=_dec->state.nmbs; + for(mbi=0;mbi>2][mapi&3]; + if(frags[fragi].coded)coded[ncoded++]=mapi; + } + while(++mapiiopb); + lbmvs[bi][1]=(signed char)(*mv_comp_unpack)(&_dec->opb); + memcpy(frag_mvs[fragi],lbmvs[bi],sizeof(lbmvs[bi])); + } + else lbmvs[bi][0]=lbmvs[bi][1]=0; + } + if(codedi>0){ + memcpy(last_mv[1],last_mv[0],sizeof(last_mv[1])); + memcpy(last_mv[0],lbmvs[coded[codedi-1]],sizeof(last_mv[0])); + } + if(codedi>2][bi]; + frags[fragi].mb_mode=mb_mode; + memcpy(frag_mvs[fragi],cbmvs[bi],sizeof(cbmvs[bi])); + } + } + }break; + case OC_MODE_INTER_MV:{ + memcpy(last_mv[1],last_mv[0],sizeof(last_mv[1])); + mbmv[0]=last_mv[0][0]=(signed char)(*mv_comp_unpack)(&_dec->opb); + mbmv[1]=last_mv[0][1]=(signed char)(*mv_comp_unpack)(&_dec->opb); + }break; + case OC_MODE_INTER_MV_LAST:memcpy(mbmv,last_mv[0],sizeof(mbmv));break; + case OC_MODE_INTER_MV_LAST2:{ + memcpy(mbmv,last_mv[1],sizeof(mbmv)); + memcpy(last_mv[1],last_mv[0],sizeof(last_mv[1])); + memcpy(last_mv[0],mbmv,sizeof(last_mv[0])); + }break; + case OC_MODE_GOLDEN_MV:{ + mbmv[0]=(signed char)(*mv_comp_unpack)(&_dec->opb); + mbmv[1]=(signed char)(*mv_comp_unpack)(&_dec->opb); + }break; + default:memset(mbmv,0,sizeof(mbmv));break; + } + /*4MV mode fills in the fragments itself. + For all other modes we can use this common code.*/ + if(mb_mode!=OC_MODE_INTER_MV_FOUR){ + for(codedi=0;codedi>2][mapi&3]; + frags[fragi].mb_mode=mb_mode; + memcpy(frag_mvs[fragi],mbmv,sizeof(mbmv)); + } + } + } + } +} + +static void oc_dec_block_qis_unpack(oc_dec_ctx *_dec){ + oc_fragment *frags; + const ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t fragii; + ptrdiff_t fragi; + ncoded_fragis=_dec->state.ntotal_coded_fragis; + if(ncoded_fragis<=0)return; + frags=_dec->state.frags; + coded_fragis=_dec->state.coded_fragis; + if(_dec->state.nqis==1){ + /*If this frame has only a single qi value, then just use it for all coded + fragments.*/ + for(fragii=0;fragiiopb); + flag=(int)val; + nqi1=0; + fragii=0; + while(fragiiopb); + full_run=run_count>=4129; + do{ + frags[coded_fragis[fragii++]].qii=flag; + nqi1+=flag; + } + while(--run_count>0&&fragiiopb); + flag=(int)val; + } + else flag=!flag; + } + /*TODO: run_count should be 0 here. + If it's not, we should issue a warning of some kind.*/ + /*If we have 3 different qi's for this frame, and there was at least one + fragment with a non-zero qi, make the second pass.*/ + if(_dec->state.nqis==3&&nqi1>0){ + /*Skip qii==0 fragments.*/ + for(fragii=0;frags[coded_fragis[fragii]].qii==0;fragii++); + val=oc_pack_read1(&_dec->opb); + flag=(int)val; + do{ + int full_run; + run_count=oc_sb_run_unpack(&_dec->opb); + full_run=run_count>=4129; + for(;fragiiopb); + flag=(int)val; + } + else flag=!flag; + } + while(fragiidct_tokens; + frags=_dec->state.frags; + coded_fragis=_dec->state.coded_fragis; + ncoded_fragis=fragii=eobs=ti=0; + for(pli=0;pli<3;pli++){ + ptrdiff_t run_counts[64]; + ptrdiff_t eob_count; + ptrdiff_t eobi; + int rli; + ncoded_fragis+=_dec->state.ncoded_fragis[pli]; + memset(run_counts,0,sizeof(run_counts)); + _dec->eob_runs[pli][0]=eobs; + _dec->ti0[pli][0]=ti; + /*Continue any previous EOB run, if there was one.*/ + eobi=eobs; + if(ncoded_fragis-fragii0)frags[coded_fragis[fragii++]].dc=0; + while(fragiiopb, + _dec->huff_tables[_huff_idxs[pli+1>>1]]); + dct_tokens[ti++]=(unsigned char)token; + if(OC_DCT_TOKEN_NEEDS_MORE(token)){ + eb=(int)oc_pack_read(&_dec->opb, + OC_INTERNAL_DCT_TOKEN_EXTRA_BITS[token]); + dct_tokens[ti++]=(unsigned char)eb; + if(token==OC_DCT_TOKEN_FAT_EOB)dct_tokens[ti++]=(unsigned char)(eb>>8); + eb<<=OC_DCT_TOKEN_EB_POS(token); + } + else eb=0; + cw=OC_DCT_CODE_WORD[token]+eb; + eobs=cw>>OC_DCT_CW_EOB_SHIFT&0xFFF; + if(cw==OC_DCT_CW_FINISH)eobs=OC_DCT_EOB_FINISH; + if(eobs){ + eobi=OC_MINI(eobs,ncoded_fragis-fragii); + eob_count+=eobi; + eobs-=eobi; + while(eobi-->0)frags[coded_fragis[fragii++]].dc=0; + } + else{ + int coeff; + skip=(unsigned char)(cw>>OC_DCT_CW_RLEN_SHIFT); + cw^=-(cw&1<>OC_DCT_CW_MAG_SHIFT; + if(skip)coeff=0; + run_counts[skip]++; + frags[coded_fragis[fragii++]].dc=coeff; + } + } + /*Add the total EOB count to the longest run length.*/ + run_counts[63]+=eob_count; + /*And convert the run_counts array to a moment table.*/ + for(rli=63;rli-->0;)run_counts[rli]+=run_counts[rli+1]; + /*Finally, subtract off the number of coefficients that have been + accounted for by runs started in this coefficient.*/ + for(rli=64;rli-->0;)_ntoks_left[pli][rli]-=run_counts[rli]; + } + _dec->dct_tokens_count=ti; + return eobs; +} + +/*Unpacks the AC coefficient tokens. + This can completely discard coefficient values while unpacking, and so is + somewhat simpler than unpacking the DC coefficient tokens. + _huff_idx: The index of the Huffman table to use for each color plane. + _ntoks_left: The number of tokens left to be decoded in each color plane for + each coefficient. + This is updated as EOB tokens and zero run tokens are decoded. + _eobs: The length of any outstanding EOB run from previous + coefficients. + Return: The length of any outstanding EOB run.*/ +static int oc_dec_ac_coeff_unpack(oc_dec_ctx *_dec,int _zzi,int _huff_idxs[2], + ptrdiff_t _ntoks_left[3][64],ptrdiff_t _eobs){ + unsigned char *dct_tokens; + ptrdiff_t ti; + int pli; + dct_tokens=_dec->dct_tokens; + ti=_dec->dct_tokens_count; + for(pli=0;pli<3;pli++){ + ptrdiff_t run_counts[64]; + ptrdiff_t eob_count; + size_t ntoks_left; + size_t ntoks; + int rli; + _dec->eob_runs[pli][_zzi]=_eobs; + _dec->ti0[pli][_zzi]=ti; + ntoks_left=_ntoks_left[pli][_zzi]; + memset(run_counts,0,sizeof(run_counts)); + eob_count=0; + ntoks=0; + while(ntoks+_eobsopb, + _dec->huff_tables[_huff_idxs[pli+1>>1]]); + dct_tokens[ti++]=(unsigned char)token; + if(OC_DCT_TOKEN_NEEDS_MORE(token)){ + eb=(int)oc_pack_read(&_dec->opb, + OC_INTERNAL_DCT_TOKEN_EXTRA_BITS[token]); + dct_tokens[ti++]=(unsigned char)eb; + if(token==OC_DCT_TOKEN_FAT_EOB)dct_tokens[ti++]=(unsigned char)(eb>>8); + eb<<=OC_DCT_TOKEN_EB_POS(token); + } + else eb=0; + cw=OC_DCT_CODE_WORD[token]+eb; + skip=(unsigned char)(cw>>OC_DCT_CW_RLEN_SHIFT); + _eobs=cw>>OC_DCT_CW_EOB_SHIFT&0xFFF; + if(cw==OC_DCT_CW_FINISH)_eobs=OC_DCT_EOB_FINISH; + if(_eobs==0){ + run_counts[skip]++; + ntoks++; + } + } + /*Add the portion of the last EOB run actually used by this coefficient.*/ + eob_count+=ntoks_left-ntoks; + /*And remove it from the remaining EOB count.*/ + _eobs-=ntoks_left-ntoks; + /*Add the total EOB count to the longest run length.*/ + run_counts[63]+=eob_count; + /*And convert the run_counts array to a moment table.*/ + for(rli=63;rli-->0;)run_counts[rli]+=run_counts[rli+1]; + /*Finally, subtract off the number of coefficients that have been + accounted for by runs started in this coefficient.*/ + for(rli=64-_zzi;rli-->0;)_ntoks_left[pli][_zzi+rli]-=run_counts[rli]; + } + _dec->dct_tokens_count=ti; + return _eobs; +} + +/*Tokens describing the DCT coefficients that belong to each fragment are + stored in the bitstream grouped by coefficient, not by fragment. + + This means that we either decode all the tokens in order, building up a + separate coefficient list for each fragment as we go, and then go back and + do the iDCT on each fragment, or we have to create separate lists of tokens + for each coefficient, so that we can pull the next token required off the + head of the appropriate list when decoding a specific fragment. + + The former was VP3's choice, and it meant 2*w*h extra storage for all the + decoded coefficient values. + + We take the second option, which lets us store just one to three bytes per + token (generally far fewer than the number of coefficients, due to EOB + tokens and zero runs), and which requires us to only maintain a counter for + each of the 64 coefficients, instead of a counter for every fragment to + determine where the next token goes. + + We actually use 3 counters per coefficient, one for each color plane, so we + can decode all color planes simultaneously. + This lets color conversion, etc., be done as soon as a full MCU (one or + two super block rows) is decoded, while the image data is still in cache.*/ + +static void oc_dec_residual_tokens_unpack(oc_dec_ctx *_dec){ + static const unsigned char OC_HUFF_LIST_MAX[5]={1,6,15,28,64}; + ptrdiff_t ntoks_left[3][64]; + int huff_idxs[2]; + ptrdiff_t eobs; + long val; + int pli; + int zzi; + int hgi; + for(pli=0;pli<3;pli++)for(zzi=0;zzi<64;zzi++){ + ntoks_left[pli][zzi]=_dec->state.ncoded_fragis[pli]; + } + val=oc_pack_read(&_dec->opb,4); + huff_idxs[0]=(int)val; + val=oc_pack_read(&_dec->opb,4); + huff_idxs[1]=(int)val; + _dec->eob_runs[0][0]=0; + eobs=oc_dec_dc_coeff_unpack(_dec,huff_idxs,ntoks_left); +#if defined(HAVE_CAIRO) + _dec->telemetry_dc_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + val=oc_pack_read(&_dec->opb,4); + huff_idxs[0]=(int)val; + val=oc_pack_read(&_dec->opb,4); + huff_idxs[1]=(int)val; + zzi=1; + for(hgi=1;hgi<5;hgi++){ + huff_idxs[0]+=16; + huff_idxs[1]+=16; + for(;zzipp_level<=OC_PP_LEVEL_DISABLED){ + if(_dec->dc_qis!=NULL){ + _ogg_free(_dec->dc_qis); + _dec->dc_qis=NULL; + _ogg_free(_dec->variances); + _dec->variances=NULL; + _ogg_free(_dec->pp_frame_data); + _dec->pp_frame_data=NULL; + } + return 1; + } + if(_dec->dc_qis==NULL){ + /*If we haven't been tracking DC quantization indices, there's no point in + starting now.*/ + if(_dec->state.frame_type!=OC_INTRA_FRAME)return 1; + _dec->dc_qis=(unsigned char *)_ogg_malloc( + _dec->state.nfrags*sizeof(_dec->dc_qis[0])); + if(_dec->dc_qis==NULL)return 1; + memset(_dec->dc_qis,_dec->state.qis[0],_dec->state.nfrags); + } + else{ + unsigned char *dc_qis; + const ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t fragii; + unsigned char qi0; + /*Update the DC quantization index of each coded block.*/ + dc_qis=_dec->dc_qis; + coded_fragis=_dec->state.coded_fragis; + ncoded_fragis=_dec->state.ncoded_fragis[0]+ + _dec->state.ncoded_fragis[1]+_dec->state.ncoded_fragis[2]; + qi0=(unsigned char)_dec->state.qis[0]; + for(fragii=0;fragiipp_level<=OC_PP_LEVEL_TRACKDCQI){ + if(_dec->variances!=NULL){ + _ogg_free(_dec->variances); + _dec->variances=NULL; + _ogg_free(_dec->pp_frame_data); + _dec->pp_frame_data=NULL; + } + return 1; + } + if(_dec->variances==NULL){ + size_t frame_sz; + size_t c_sz; + int c_w; + int c_h; + frame_sz=_dec->state.info.frame_width*(size_t)_dec->state.info.frame_height; + c_w=_dec->state.info.frame_width>>!(_dec->state.info.pixel_fmt&1); + c_h=_dec->state.info.frame_height>>!(_dec->state.info.pixel_fmt&2); + c_sz=c_w*(size_t)c_h; + /*Allocate space for the chroma planes, even if we're not going to use + them; this simplifies allocation state management, though it may waste + memory on the few systems that don't overcommit pages.*/ + frame_sz+=c_sz<<1; + _dec->pp_frame_data=(unsigned char *)_ogg_malloc( + frame_sz*sizeof(_dec->pp_frame_data[0])); + _dec->variances=(int *)_ogg_malloc( + _dec->state.nfrags*sizeof(_dec->variances[0])); + if(_dec->variances==NULL||_dec->pp_frame_data==NULL){ + _ogg_free(_dec->pp_frame_data); + _dec->pp_frame_data=NULL; + _ogg_free(_dec->variances); + _dec->variances=NULL; + return 1; + } + /*Force an update of the PP buffer pointers.*/ + _dec->pp_frame_state=0; + } + /*Update the PP buffer pointers if necessary.*/ + if(_dec->pp_frame_state!=1+(_dec->pp_level>=OC_PP_LEVEL_DEBLOCKC)){ + if(_dec->pp_levelpp_frame_buf[0].width=_dec->state.info.frame_width; + _dec->pp_frame_buf[0].height=_dec->state.info.frame_height; + _dec->pp_frame_buf[0].stride=-_dec->pp_frame_buf[0].width; + _dec->pp_frame_buf[0].data=_dec->pp_frame_data+ + (1-_dec->pp_frame_buf[0].height)*(ptrdiff_t)_dec->pp_frame_buf[0].stride; + } + else{ + size_t y_sz; + size_t c_sz; + int c_w; + int c_h; + /*Otherwise, set up pointers to all three PP planes.*/ + y_sz=_dec->state.info.frame_width*(size_t)_dec->state.info.frame_height; + c_w=_dec->state.info.frame_width>>!(_dec->state.info.pixel_fmt&1); + c_h=_dec->state.info.frame_height>>!(_dec->state.info.pixel_fmt&2); + c_sz=c_w*(size_t)c_h; + _dec->pp_frame_buf[0].width=_dec->state.info.frame_width; + _dec->pp_frame_buf[0].height=_dec->state.info.frame_height; + _dec->pp_frame_buf[0].stride=_dec->pp_frame_buf[0].width; + _dec->pp_frame_buf[0].data=_dec->pp_frame_data; + _dec->pp_frame_buf[1].width=c_w; + _dec->pp_frame_buf[1].height=c_h; + _dec->pp_frame_buf[1].stride=_dec->pp_frame_buf[1].width; + _dec->pp_frame_buf[1].data=_dec->pp_frame_buf[0].data+y_sz; + _dec->pp_frame_buf[2].width=c_w; + _dec->pp_frame_buf[2].height=c_h; + _dec->pp_frame_buf[2].stride=_dec->pp_frame_buf[2].width; + _dec->pp_frame_buf[2].data=_dec->pp_frame_buf[1].data+c_sz; + oc_ycbcr_buffer_flip(_dec->pp_frame_buf,_dec->pp_frame_buf); + } + _dec->pp_frame_state=1+(_dec->pp_level>=OC_PP_LEVEL_DEBLOCKC); + } + /*If we're not processing chroma, copy the reference frame's chroma planes.*/ + if(_dec->pp_levelpp_frame_buf+1, + _dec->state.ref_frame_bufs[_dec->state.ref_frame_idx[OC_FRAME_SELF]]+1, + sizeof(_dec->pp_frame_buf[1])*2); + } + return 0; +} + + + +typedef struct{ + int bounding_values[256]; + ptrdiff_t ti[3][64]; + ptrdiff_t eob_runs[3][64]; + const ptrdiff_t *coded_fragis[3]; + const ptrdiff_t *uncoded_fragis[3]; + ptrdiff_t ncoded_fragis[3]; + ptrdiff_t nuncoded_fragis[3]; + const ogg_uint16_t *dequant[3][3][2]; + int fragy0[3]; + int fragy_end[3]; + int pred_last[3][3]; + int mcu_nvfrags; + int loop_filter; + int pp_level; +}oc_dec_pipeline_state; + + + +/*Initialize the main decoding pipeline.*/ +static void oc_dec_pipeline_init(oc_dec_ctx *_dec, + oc_dec_pipeline_state *_pipe){ + const ptrdiff_t *coded_fragis; + const ptrdiff_t *uncoded_fragis; + int pli; + int qii; + int qti; + /*If chroma is sub-sampled in the vertical direction, we have to decode two + super block rows of Y' for each super block row of Cb and Cr.*/ + _pipe->mcu_nvfrags=4<state.info.pixel_fmt&2); + /*Initialize the token and extra bits indices for each plane and + coefficient.*/ + memcpy(_pipe->ti,_dec->ti0,sizeof(_pipe->ti)); + /*Also copy over the initial the EOB run counts.*/ + memcpy(_pipe->eob_runs,_dec->eob_runs,sizeof(_pipe->eob_runs)); + /*Set up per-plane pointers to the coded and uncoded fragments lists.*/ + coded_fragis=_dec->state.coded_fragis; + uncoded_fragis=coded_fragis+_dec->state.nfrags; + for(pli=0;pli<3;pli++){ + ptrdiff_t ncoded_fragis; + _pipe->coded_fragis[pli]=coded_fragis; + _pipe->uncoded_fragis[pli]=uncoded_fragis; + ncoded_fragis=_dec->state.ncoded_fragis[pli]; + coded_fragis+=ncoded_fragis; + uncoded_fragis+=ncoded_fragis-_dec->state.fplanes[pli].nfrags; + } + /*Set up condensed quantizer tables.*/ + for(pli=0;pli<3;pli++){ + for(qii=0;qii<_dec->state.nqis;qii++){ + for(qti=0;qti<2;qti++){ + _pipe->dequant[pli][qii][qti]= + _dec->state.dequant_tables[_dec->state.qis[qii]][pli][qti]; + } + } + } + /*Set the previous DC predictor to 0 for all color planes and frame types.*/ + memset(_pipe->pred_last,0,sizeof(_pipe->pred_last)); + /*Initialize the bounding value array for the loop filter.*/ + _pipe->loop_filter=!oc_state_loop_filter_init(&_dec->state, + _pipe->bounding_values); + /*Initialize any buffers needed for post-processing. + We also save the current post-processing level, to guard against the user + changing it from a callback.*/ + if(!oc_dec_postprocess_init(_dec))_pipe->pp_level=_dec->pp_level; + /*If we don't have enough information to post-process, disable it, regardless + of the user-requested level.*/ + else{ + _pipe->pp_level=OC_PP_LEVEL_DISABLED; + memcpy(_dec->pp_frame_buf, + _dec->state.ref_frame_bufs[_dec->state.ref_frame_idx[OC_FRAME_SELF]], + sizeof(_dec->pp_frame_buf[0])*3); + } +} + +/*Undo the DC prediction in a single plane of an MCU (one or two super block + rows). + As a side effect, the number of coded and uncoded fragments in this plane of + the MCU is also computed.*/ +static void oc_dec_dc_unpredict_mcu_plane(oc_dec_ctx *_dec, + oc_dec_pipeline_state *_pipe,int _pli){ + const oc_fragment_plane *fplane; + oc_fragment *frags; + int *pred_last; + ptrdiff_t ncoded_fragis; + ptrdiff_t fragi; + int fragx; + int fragy; + int fragy0; + int fragy_end; + int nhfrags; + /*Compute the first and last fragment row of the current MCU for this + plane.*/ + fplane=_dec->state.fplanes+_pli; + fragy0=_pipe->fragy0[_pli]; + fragy_end=_pipe->fragy_end[_pli]; + nhfrags=fplane->nhfrags; + pred_last=_pipe->pred_last[_pli]; + frags=_dec->state.frags; + ncoded_fragis=0; + fragi=fplane->froffset+fragy0*(ptrdiff_t)nhfrags; + for(fragy=fragy0;fragy=nhfrags)ur_ref=-1; + else{ + ur_ref=u_frags[fragi+1].coded? + OC_FRAME_FOR_MODE(u_frags[fragi+1].mb_mode):-1; + } + if(frags[fragi].coded){ + int pred; + int ref; + ref=OC_FRAME_FOR_MODE(frags[fragi].mb_mode); + /*We break out a separate case based on which of our neighbors use + the same reference frames. + This is somewhat faster than trying to make a generic case which + handles all of them, since it reduces lots of poorly predicted + jumps to one switch statement, and also lets a number of the + multiplications be optimized out by strength reduction.*/ + switch((l_ref==ref)|(ul_ref==ref)<<1| + (u_ref==ref)<<2|(ur_ref==ref)<<3){ + default:pred=pred_last[ref];break; + case 1: + case 3:pred=frags[fragi-1].dc;break; + case 2:pred=u_frags[fragi-1].dc;break; + case 4: + case 6: + case 12:pred=u_frags[fragi].dc;break; + case 5:pred=(frags[fragi-1].dc+u_frags[fragi].dc)/2;break; + case 8:pred=u_frags[fragi+1].dc;break; + case 9: + case 11: + case 13:{ + pred=(75*frags[fragi-1].dc+53*u_frags[fragi+1].dc)/128; + }break; + case 10:pred=(u_frags[fragi-1].dc+u_frags[fragi+1].dc)/2;break; + case 14:{ + pred=(3*(u_frags[fragi-1].dc+u_frags[fragi+1].dc) + +10*u_frags[fragi].dc)/16; + }break; + case 7: + case 15:{ + int p0; + int p1; + int p2; + p0=frags[fragi-1].dc; + p1=u_frags[fragi-1].dc; + p2=u_frags[fragi].dc; + pred=(29*(p0+p2)-26*p1)/32; + if(abs(pred-p2)>128)pred=p2; + else if(abs(pred-p0)>128)pred=p0; + else if(abs(pred-p1)>128)pred=p1; + }break; + } + pred_last[ref]=frags[fragi].dc+=pred; + ncoded_fragis++; + l_ref=ref; + } + else l_ref=-1; + ul_ref=u_ref; + u_ref=ur_ref; + } + } + } + _pipe->ncoded_fragis[_pli]=ncoded_fragis; + /*Also save the number of uncoded fragments so we know how many to copy.*/ + _pipe->nuncoded_fragis[_pli]= + (fragy_end-fragy0)*(ptrdiff_t)nhfrags-ncoded_fragis; +} + +/*Reconstructs all coded fragments in a single MCU (one or two super block + rows). + This requires that each coded fragment have a proper macro block mode and + motion vector (if not in INTRA mode), and have it's DC value decoded, with + the DC prediction process reversed, and the number of coded and uncoded + fragments in this plane of the MCU be counted. + The token lists for each color plane and coefficient should also be filled + in, along with initial token offsets, extra bits offsets, and EOB run + counts.*/ +static void oc_dec_frags_recon_mcu_plane(oc_dec_ctx *_dec, + oc_dec_pipeline_state *_pipe,int _pli){ + unsigned char *dct_tokens; + const unsigned char *dct_fzig_zag; + ogg_uint16_t dc_quant[2]; + const oc_fragment *frags; + const ptrdiff_t *coded_fragis; + ptrdiff_t ncoded_fragis; + ptrdiff_t fragii; + ptrdiff_t *ti; + ptrdiff_t *eob_runs; + int qti; + dct_tokens=_dec->dct_tokens; + dct_fzig_zag=_dec->state.opt_data.dct_fzig_zag; + frags=_dec->state.frags; + coded_fragis=_pipe->coded_fragis[_pli]; + ncoded_fragis=_pipe->ncoded_fragis[_pli]; + ti=_pipe->ti[_pli]; + eob_runs=_pipe->eob_runs[_pli]; + for(qti=0;qti<2;qti++)dc_quant[qti]=_pipe->dequant[_pli][0][qti][0]; + for(fragii=0;fragiidequant[_pli][frags[fragi].qii][qti]; + /*Decode the AC coefficients.*/ + for(zzi=0;zzi<64;){ + int token; + last_zzi=zzi; + if(eob_runs[zzi]){ + eob_runs[zzi]--; + break; + } + else{ + ptrdiff_t eob; + int cw; + int rlen; + int coeff; + int lti; + lti=ti[zzi]; + token=dct_tokens[lti++]; + cw=OC_DCT_CODE_WORD[token]; + /*These parts could be done branchless, but the branches are fairly + predictable and the C code translates into more than a few + instructions, so it's worth it to avoid them.*/ + if(OC_DCT_TOKEN_NEEDS_MORE(token)){ + cw+=dct_tokens[lti++]<>OC_DCT_CW_EOB_SHIFT&0xFFF; + if(token==OC_DCT_TOKEN_FAT_EOB){ + eob+=dct_tokens[lti++]<<8; + if(eob==0)eob=OC_DCT_EOB_FINISH; + } + rlen=(unsigned char)(cw>>OC_DCT_CW_RLEN_SHIFT); + cw^=-(cw&1<>OC_DCT_CW_MAG_SHIFT; + eob_runs[zzi]=eob; + ti[zzi]=lti; + zzi+=rlen; + dct_coeffs[dct_fzig_zag[zzi]]=(ogg_int16_t)(coeff*(int)ac_quant[zzi]); + zzi+=!eob; + } + } + /*TODO: zzi should be exactly 64 here. + If it's not, we should report some kind of warning.*/ + zzi=OC_MINI(zzi,64); + dct_coeffs[0]=(ogg_int16_t)frags[fragi].dc; + /*last_zzi is always initialized. + If your compiler thinks otherwise, it is dumb.*/ + oc_state_frag_recon(&_dec->state,fragi,_pli, + dct_coeffs,last_zzi,dc_quant[qti]); + } + _pipe->coded_fragis[_pli]+=ncoded_fragis; + /*Right now the reconstructed MCU has only the coded blocks in it.*/ + /*TODO: We make the decision here to always copy the uncoded blocks into it + from the reference frame. + We could also copy the coded blocks back over the reference frame, if we + wait for an additional MCU to be decoded, which might be faster if only a + small number of blocks are coded. + However, this introduces more latency, creating a larger cache footprint. + It's unknown which decision is better, but this one results in simpler + code, and the hard case (high bitrate, high resolution) is handled + correctly.*/ + /*Copy the uncoded blocks from the previous reference frame.*/ + _pipe->uncoded_fragis[_pli]-=_pipe->nuncoded_fragis[_pli]; + oc_state_frag_copy_list(&_dec->state,_pipe->uncoded_fragis[_pli], + _pipe->nuncoded_fragis[_pli],OC_FRAME_SELF,OC_FRAME_PREV,_pli); +} + +/*Filter a horizontal block edge.*/ +static void oc_filter_hedge(unsigned char *_dst,int _dst_ystride, + const unsigned char *_src,int _src_ystride,int _qstep,int _flimit, + int *_variance0,int *_variance1){ + unsigned char *rdst; + const unsigned char *rsrc; + unsigned char *cdst; + const unsigned char *csrc; + int r[10]; + int sum0; + int sum1; + int bx; + int by; + rdst=_dst; + rsrc=_src; + for(bx=0;bx<8;bx++){ + cdst=rdst; + csrc=rsrc; + for(by=0;by<10;by++){ + r[by]=*csrc; + csrc+=_src_ystride; + } + sum0=sum1=0; + for(by=0;by<4;by++){ + sum0+=abs(r[by+1]-r[by]); + sum1+=abs(r[by+5]-r[by+6]); + } + *_variance0+=OC_MINI(255,sum0); + *_variance1+=OC_MINI(255,sum1); + if(sum0<_flimit&&sum1<_flimit&&r[5]-r[4]<_qstep&&r[4]-r[5]<_qstep){ + *cdst=(unsigned char)(r[0]*3+r[1]*2+r[2]+r[3]+r[4]+4>>3); + cdst+=_dst_ystride; + *cdst=(unsigned char)(r[0]*2+r[1]+r[2]*2+r[3]+r[4]+r[5]+4>>3); + cdst+=_dst_ystride; + for(by=0;by<4;by++){ + *cdst=(unsigned char)(r[by]+r[by+1]+r[by+2]+r[by+3]*2+ + r[by+4]+r[by+5]+r[by+6]+4>>3); + cdst+=_dst_ystride; + } + *cdst=(unsigned char)(r[4]+r[5]+r[6]+r[7]*2+r[8]+r[9]*2+4>>3); + cdst+=_dst_ystride; + *cdst=(unsigned char)(r[5]+r[6]+r[7]+r[8]*2+r[9]*3+4>>3); + } + else{ + for(by=1;by<=8;by++){ + *cdst=(unsigned char)r[by]; + cdst+=_dst_ystride; + } + } + rdst++; + rsrc++; + } +} + +/*Filter a vertical block edge.*/ +static void oc_filter_vedge(unsigned char *_dst,int _dst_ystride, + int _qstep,int _flimit,int *_variances){ + unsigned char *rdst; + const unsigned char *rsrc; + unsigned char *cdst; + int r[10]; + int sum0; + int sum1; + int bx; + int by; + cdst=_dst; + for(by=0;by<8;by++){ + rsrc=cdst-1; + rdst=cdst; + for(bx=0;bx<10;bx++)r[bx]=*rsrc++; + sum0=sum1=0; + for(bx=0;bx<4;bx++){ + sum0+=abs(r[bx+1]-r[bx]); + sum1+=abs(r[bx+5]-r[bx+6]); + } + _variances[0]+=OC_MINI(255,sum0); + _variances[1]+=OC_MINI(255,sum1); + if(sum0<_flimit&&sum1<_flimit&&r[5]-r[4]<_qstep&&r[4]-r[5]<_qstep){ + *rdst++=(unsigned char)(r[0]*3+r[1]*2+r[2]+r[3]+r[4]+4>>3); + *rdst++=(unsigned char)(r[0]*2+r[1]+r[2]*2+r[3]+r[4]+r[5]+4>>3); + for(bx=0;bx<4;bx++){ + *rdst++=(unsigned char)(r[bx]+r[bx+1]+r[bx+2]+r[bx+3]*2+ + r[bx+4]+r[bx+5]+r[bx+6]+4>>3); + } + *rdst++=(unsigned char)(r[4]+r[5]+r[6]+r[7]*2+r[8]+r[9]*2+4>>3); + *rdst=(unsigned char)(r[5]+r[6]+r[7]+r[8]*2+r[9]*3+4>>3); + } + cdst+=_dst_ystride; + } +} + +static void oc_dec_deblock_frag_rows(oc_dec_ctx *_dec, + th_img_plane *_dst,th_img_plane *_src,int _pli,int _fragy0, + int _fragy_end){ + oc_fragment_plane *fplane; + int *variance; + unsigned char *dc_qi; + unsigned char *dst; + const unsigned char *src; + ptrdiff_t froffset; + int dst_ystride; + int src_ystride; + int nhfrags; + int width; + int notstart; + int notdone; + int flimit; + int qstep; + int y_end; + int y; + int x; + _dst+=_pli; + _src+=_pli; + fplane=_dec->state.fplanes+_pli; + nhfrags=fplane->nhfrags; + froffset=fplane->froffset+_fragy0*(ptrdiff_t)nhfrags; + variance=_dec->variances+froffset; + dc_qi=_dec->dc_qis+froffset; + notstart=_fragy0>0; + notdone=_fragy_endnvfrags; + /*We want to clear an extra row of variances, except at the end.*/ + memset(variance+(nhfrags&-notstart),0, + (_fragy_end+notdone-_fragy0-notstart)*(nhfrags*sizeof(variance[0]))); + /*Except for the first time, we want to point to the middle of the row.*/ + y=(_fragy0<<3)+(notstart<<2); + dst_ystride=_dst->stride; + src_ystride=_src->stride; + dst=_dst->data+y*(ptrdiff_t)dst_ystride; + src=_src->data+y*(ptrdiff_t)src_ystride; + width=_dst->width; + for(;y<4;y++){ + memcpy(dst,src,width*sizeof(dst[0])); + dst+=dst_ystride; + src+=src_ystride; + } + /*We also want to skip the last row in the frame for this loop.*/ + y_end=_fragy_end-!notdone<<3; + for(;ypp_dc_scale[*dc_qi]; + flimit=(qstep*3)>>2; + oc_filter_hedge(dst,dst_ystride,src-src_ystride,src_ystride, + qstep,flimit,variance,variance+nhfrags); + variance++; + dc_qi++; + for(x=8;xpp_dc_scale[*dc_qi]; + flimit=(qstep*3)>>2; + oc_filter_hedge(dst+x,dst_ystride,src+x-src_ystride,src_ystride, + qstep,flimit,variance,variance+nhfrags); + oc_filter_vedge(dst+x-(dst_ystride<<2)-4,dst_ystride, + qstep,flimit,variance-1); + variance++; + dc_qi++; + } + dst+=dst_ystride<<3; + src+=src_ystride<<3; + } + /*And finally, handle the last row in the frame, if it's in the range.*/ + if(!notdone){ + int height; + height=_dst->height; + for(;ypp_dc_scale[*dc_qi++]; + flimit=(qstep*3)>>2; + oc_filter_vedge(dst+x-(dst_ystride<<3)-4,dst_ystride, + qstep,flimit,variance++); + } + } +} + +static void oc_dering_block(unsigned char *_idata,int _ystride,int _b, + int _dc_scale,int _sharp_mod,int _strong){ + static const unsigned char OC_MOD_MAX[2]={24,32}; + static const unsigned char OC_MOD_SHIFT[2]={1,0}; + const unsigned char *psrc; + const unsigned char *src; + const unsigned char *nsrc; + unsigned char *dst; + int vmod[72]; + int hmod[72]; + int mod_hi; + int by; + int bx; + mod_hi=OC_MINI(3*_dc_scale,OC_MOD_MAX[_strong]); + dst=_idata; + src=dst; + psrc=src-(_ystride&-!(_b&4)); + for(by=0;by<9;by++){ + for(bx=0;bx<8;bx++){ + int mod; + mod=32+_dc_scale-(abs(src[bx]-psrc[bx])<>7); + for(bx=1;bx<7;bx++){ + a=128; + b=64; + w=hmod[(bx<<3)+by]; + a-=w; + b+=w*src[bx-1]; + w=vmod[(by<<3)+bx]; + a-=w; + b+=w*psrc[bx]; + w=vmod[(by+1<<3)+bx]; + a-=w; + b+=w*nsrc[bx]; + w=hmod[(bx+1<<3)+by]; + a-=w; + b+=w*src[bx+1]; + dst[bx]=OC_CLAMP255(a*src[bx]+b>>7); + } + a=128; + b=64; + w=hmod[(7<<3)+by]; + a-=w; + b+=w*src[6]; + w=vmod[(by<<3)+7]; + a-=w; + b+=w*psrc[7]; + w=vmod[(by+1<<3)+7]; + a-=w; + b+=w*nsrc[7]; + w=hmod[(8<<3)+by]; + a-=w; + b+=w*src[7+!(_b&2)]; + dst[7]=OC_CLAMP255(a*src[7]+b>>7); + dst+=_ystride; + psrc=src; + src=nsrc; + nsrc+=_ystride&-(!(_b&8)|by<6); + } +} + +#define OC_DERING_THRESH1 (384) +#define OC_DERING_THRESH2 (4*OC_DERING_THRESH1) +#define OC_DERING_THRESH3 (5*OC_DERING_THRESH1) +#define OC_DERING_THRESH4 (10*OC_DERING_THRESH1) + +static void oc_dec_dering_frag_rows(oc_dec_ctx *_dec,th_img_plane *_img, + int _pli,int _fragy0,int _fragy_end){ + th_img_plane *iplane; + oc_fragment_plane *fplane; + oc_fragment *frag; + int *variance; + unsigned char *idata; + ptrdiff_t froffset; + int ystride; + int nhfrags; + int sthresh; + int strong; + int y_end; + int width; + int height; + int y; + int x; + iplane=_img+_pli; + fplane=_dec->state.fplanes+_pli; + nhfrags=fplane->nhfrags; + froffset=fplane->froffset+_fragy0*(ptrdiff_t)nhfrags; + variance=_dec->variances+froffset; + frag=_dec->state.frags+froffset; + strong=_dec->pp_level>=(_pli?OC_PP_LEVEL_SDERINGC:OC_PP_LEVEL_SDERINGY); + sthresh=_pli?OC_DERING_THRESH4:OC_DERING_THRESH3; + y=_fragy0<<3; + ystride=iplane->stride; + idata=iplane->data+y*(ptrdiff_t)ystride; + y_end=_fragy_end<<3; + width=iplane->width; + height=iplane->height; + for(;ystate.qis[frag->qii]; + var=*variance; + b=(x<=0)|(x+8>=width)<<1|(y<=0)<<2|(y+8>=height)<<3; + if(strong&&var>sthresh){ + oc_dering_block(idata+x,ystride,b, + _dec->pp_dc_scale[qi],_dec->pp_sharp_mod[qi],1); + if(_pli||!(b&1)&&*(variance-1)>OC_DERING_THRESH4|| + !(b&2)&&variance[1]>OC_DERING_THRESH4|| + !(b&4)&&*(variance-nhfrags)>OC_DERING_THRESH4|| + !(b&8)&&variance[nhfrags]>OC_DERING_THRESH4){ + oc_dering_block(idata+x,ystride,b, + _dec->pp_dc_scale[qi],_dec->pp_sharp_mod[qi],1); + oc_dering_block(idata+x,ystride,b, + _dec->pp_dc_scale[qi],_dec->pp_sharp_mod[qi],1); + } + } + else if(var>OC_DERING_THRESH2){ + oc_dering_block(idata+x,ystride,b, + _dec->pp_dc_scale[qi],_dec->pp_sharp_mod[qi],1); + } + else if(var>OC_DERING_THRESH1){ + oc_dering_block(idata+x,ystride,b, + _dec->pp_dc_scale[qi],_dec->pp_sharp_mod[qi],0); + } + frag++; + variance++; + } + idata+=ystride<<3; + } +} + + + +th_dec_ctx *th_decode_alloc(const th_info *_info,const th_setup_info *_setup){ + oc_dec_ctx *dec; + if(_info==NULL||_setup==NULL)return NULL; + dec=_ogg_malloc(sizeof(*dec)); + if(dec==NULL||oc_dec_init(dec,_info,_setup)<0){ + _ogg_free(dec); + return NULL; + } + dec->state.curframe_num=0; + return dec; +} + +void th_decode_free(th_dec_ctx *_dec){ + if(_dec!=NULL){ + oc_dec_clear(_dec); + _ogg_free(_dec); + } +} + +int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf, + size_t _buf_sz){ + switch(_req){ + case TH_DECCTL_GET_PPLEVEL_MAX:{ + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + (*(int *)_buf)=OC_PP_LEVEL_MAX; + return 0; + }break; + case TH_DECCTL_SET_PPLEVEL:{ + int pp_level; + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + pp_level=*(int *)_buf; + if(pp_level<0||pp_level>OC_PP_LEVEL_MAX)return TH_EINVAL; + _dec->pp_level=pp_level; + return 0; + }break; + case TH_DECCTL_SET_GRANPOS:{ + ogg_int64_t granpos; + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(ogg_int64_t))return TH_EINVAL; + granpos=*(ogg_int64_t *)_buf; + if(granpos<0)return TH_EINVAL; + _dec->state.granpos=granpos; + _dec->state.keyframe_num=(granpos>>_dec->state.info.keyframe_granule_shift) + -_dec->state.granpos_bias; + _dec->state.curframe_num=_dec->state.keyframe_num + +(granpos&(1<<_dec->state.info.keyframe_granule_shift)-1); + return 0; + }break; + case TH_DECCTL_SET_STRIPE_CB:{ + th_stripe_callback *cb; + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(th_stripe_callback))return TH_EINVAL; + cb=(th_stripe_callback *)_buf; + _dec->stripe_cb.ctx=cb->ctx; + _dec->stripe_cb.stripe_decoded=cb->stripe_decoded; + return 0; + }break; +#ifdef HAVE_CAIRO + case TH_DECCTL_SET_TELEMETRY_MBMODE:{ + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + _dec->telemetry=1; + _dec->telemetry_mbmode=*(int *)_buf; + return 0; + }break; + case TH_DECCTL_SET_TELEMETRY_MV:{ + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + _dec->telemetry=1; + _dec->telemetry_mv=*(int *)_buf; + return 0; + }break; + case TH_DECCTL_SET_TELEMETRY_QI:{ + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + _dec->telemetry=1; + _dec->telemetry_qi=*(int *)_buf; + return 0; + }break; + case TH_DECCTL_SET_TELEMETRY_BITS:{ + if(_dec==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + _dec->telemetry=1; + _dec->telemetry_bits=*(int *)_buf; + return 0; + }break; +#endif + default:return TH_EIMPL; + } +} + +/*We're decoding an INTER frame, but have no initialized reference + buffers (i.e., decoding did not start on a key frame). + We initialize them to a solid gray here.*/ +static void oc_dec_init_dummy_frame(th_dec_ctx *_dec){ + th_info *info; + size_t yplane_sz; + size_t cplane_sz; + int yhstride; + int yheight; + int chstride; + int cheight; + _dec->state.ref_frame_idx[OC_FRAME_GOLD]=0; + _dec->state.ref_frame_idx[OC_FRAME_PREV]=0; + _dec->state.ref_frame_idx[OC_FRAME_SELF]=1; + info=&_dec->state.info; + yhstride=info->frame_width+2*OC_UMV_PADDING; + yheight=info->frame_height+2*OC_UMV_PADDING; + chstride=yhstride>>!(info->pixel_fmt&1); + cheight=yheight>>!(info->pixel_fmt&2); + yplane_sz=yhstride*(size_t)yheight; + cplane_sz=chstride*(size_t)cheight; + memset(_dec->state.ref_frame_data[0],0x80,yplane_sz+2*cplane_sz); +} + +int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op, + ogg_int64_t *_granpos){ + int ret; + if(_dec==NULL||_op==NULL)return TH_EFAULT; + /*A completely empty packet indicates a dropped frame and is treated exactly + like an inter frame with no coded blocks. + Only proceed if we have a non-empty packet.*/ + if(_op->bytes!=0){ + oc_dec_pipeline_state pipe; + th_ycbcr_buffer stripe_buf; + int stripe_fragy; + int refi; + int pli; + int notstart; + int notdone; + oc_pack_readinit(&_dec->opb,_op->packet,_op->bytes); +#if defined(HAVE_CAIRO) + _dec->telemetry_frame_bytes=_op->bytes; +#endif + ret=oc_dec_frame_header_unpack(_dec); + if(ret<0)return ret; + /*Select a free buffer to use for the reconstructed version of this + frame.*/ + if(_dec->state.frame_type!=OC_INTRA_FRAME&& + (_dec->state.ref_frame_idx[OC_FRAME_GOLD]<0|| + _dec->state.ref_frame_idx[OC_FRAME_PREV]<0)){ + /*No reference frames yet!*/ + oc_dec_init_dummy_frame(_dec); + refi=_dec->state.ref_frame_idx[OC_FRAME_SELF]; + } + else{ + for(refi=0;refi==_dec->state.ref_frame_idx[OC_FRAME_GOLD]|| + refi==_dec->state.ref_frame_idx[OC_FRAME_PREV];refi++); + _dec->state.ref_frame_idx[OC_FRAME_SELF]=refi; + } + if(_dec->state.frame_type==OC_INTRA_FRAME){ + oc_dec_mark_all_intra(_dec); + _dec->state.keyframe_num=_dec->state.curframe_num; +#if defined(HAVE_CAIRO) + _dec->telemetry_coding_bytes= + _dec->telemetry_mode_bytes= + _dec->telemetry_mv_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + } + else{ + oc_dec_coded_flags_unpack(_dec); +#if defined(HAVE_CAIRO) + _dec->telemetry_coding_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + oc_dec_mb_modes_unpack(_dec); +#if defined(HAVE_CAIRO) + _dec->telemetry_mode_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + oc_dec_mv_unpack_and_frag_modes_fill(_dec); +#if defined(HAVE_CAIRO) + _dec->telemetry_mv_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + } + oc_dec_block_qis_unpack(_dec); +#if defined(HAVE_CAIRO) + _dec->telemetry_qi_bytes=oc_pack_bytes_left(&_dec->opb); +#endif + oc_dec_residual_tokens_unpack(_dec); + /*Update granule position. + This must be done before the striped decode callbacks so that the + application knows what to do with the frame data.*/ + _dec->state.granpos=(_dec->state.keyframe_num+_dec->state.granpos_bias<< + _dec->state.info.keyframe_granule_shift) + +(_dec->state.curframe_num-_dec->state.keyframe_num); + _dec->state.curframe_num++; + if(_granpos!=NULL)*_granpos=_dec->state.granpos; + /*All of the rest of the operations -- DC prediction reversal, + reconstructing coded fragments, copying uncoded fragments, loop + filtering, extending borders, and out-of-loop post-processing -- should + be pipelined. + I.e., DC prediction reversal, reconstruction, and uncoded fragment + copying are done for one or two super block rows, then loop filtering is + run as far as it can, then bordering copying, then post-processing. + For 4:2:0 video a Minimum Codable Unit or MCU contains two luma super + block rows, and one chroma. + Otherwise, an MCU consists of one super block row from each plane. + Inside each MCU, we perform all of the steps on one color plane before + moving on to the next. + After reconstruction, the additional filtering stages introduce a delay + since they need some pixels from the next fragment row. + Thus the actual number of decoded rows available is slightly smaller for + the first MCU, and slightly larger for the last. + + This entire process allows us to operate on the data while it is still in + cache, resulting in big performance improvements. + An application callback allows further application processing (blitting + to video memory, color conversion, etc.) to also use the data while it's + in cache.*/ + oc_dec_pipeline_init(_dec,&pipe); + oc_ycbcr_buffer_flip(stripe_buf,_dec->pp_frame_buf); + notstart=0; + notdone=1; + for(stripe_fragy=0;notdone;stripe_fragy+=pipe.mcu_nvfrags){ + int avail_fragy0; + int avail_fragy_end; + avail_fragy0=avail_fragy_end=_dec->state.fplanes[0].nvfrags; + notdone=stripe_fragy+pipe.mcu_nvfragsstate.fplanes+pli; + /*Compute the first and last fragment row of the current MCU for this + plane.*/ + frag_shift=pli!=0&&!(_dec->state.info.pixel_fmt&2); + pipe.fragy0[pli]=stripe_fragy>>frag_shift; + pipe.fragy_end[pli]=OC_MINI(fplane->nvfrags, + pipe.fragy0[pli]+(pipe.mcu_nvfrags>>frag_shift)); + oc_dec_dc_unpredict_mcu_plane(_dec,&pipe,pli); + oc_dec_frags_recon_mcu_plane(_dec,&pipe,pli); + sdelay=edelay=0; + if(pipe.loop_filter){ + sdelay+=notstart; + edelay+=notdone; + oc_state_loop_filter_frag_rows(&_dec->state,pipe.bounding_values, + refi,pli,pipe.fragy0[pli]-sdelay,pipe.fragy_end[pli]-edelay); + } + /*To fill the borders, we have an additional two pixel delay, since a + fragment in the next row could filter its top edge, using two pixels + from a fragment in this row. + But there's no reason to delay a full fragment between the two.*/ + oc_state_borders_fill_rows(&_dec->state,refi,pli, + (pipe.fragy0[pli]-sdelay<<3)-(sdelay<<1), + (pipe.fragy_end[pli]-edelay<<3)-(edelay<<1)); + /*Out-of-loop post-processing.*/ + pp_offset=3*(pli!=0); + if(pipe.pp_level>=OC_PP_LEVEL_DEBLOCKY+pp_offset){ + /*Perform de-blocking in one plane.*/ + sdelay+=notstart; + edelay+=notdone; + oc_dec_deblock_frag_rows(_dec,_dec->pp_frame_buf, + _dec->state.ref_frame_bufs[refi],pli, + pipe.fragy0[pli]-sdelay,pipe.fragy_end[pli]-edelay); + if(pipe.pp_level>=OC_PP_LEVEL_DERINGY+pp_offset){ + /*Perform de-ringing in one plane.*/ + sdelay+=notstart; + edelay+=notdone; + oc_dec_dering_frag_rows(_dec,_dec->pp_frame_buf,pli, + pipe.fragy0[pli]-sdelay,pipe.fragy_end[pli]-edelay); + } + } + /*If no post-processing is done, we still need to delay a row for the + loop filter, thanks to the strange filtering order VP3 chose.*/ + else if(pipe.loop_filter){ + sdelay+=notstart; + edelay+=notdone; + } + /*Compute the intersection of the available rows in all planes. + If chroma is sub-sampled, the effect of each of its delays is + doubled, but luma might have more post-processing filters enabled + than chroma, so we don't know up front which one is the limiting + factor.*/ + avail_fragy0=OC_MINI(avail_fragy0,pipe.fragy0[pli]-sdelay<stripe_cb.stripe_decoded!=NULL){ + /*The callback might want to use the FPU, so let's make sure they can. + We violate all kinds of ABI restrictions by not doing this until + now, but none of them actually matter since we don't use floating + point ourselves.*/ + oc_restore_fpu(&_dec->state); + /*Make the callback, ensuring we flip the sense of the "start" and + "end" of the available region upside down.*/ + (*_dec->stripe_cb.stripe_decoded)(_dec->stripe_cb.ctx,stripe_buf, + _dec->state.fplanes[0].nvfrags-avail_fragy_end, + _dec->state.fplanes[0].nvfrags-avail_fragy0); + } + notstart=1; + } + /*Finish filling in the reference frame borders.*/ + for(pli=0;pli<3;pli++)oc_state_borders_fill_caps(&_dec->state,refi,pli); + /*Update the reference frame indices.*/ + if(_dec->state.frame_type==OC_INTRA_FRAME){ + /*The new frame becomes both the previous and gold reference frames.*/ + _dec->state.ref_frame_idx[OC_FRAME_GOLD]= + _dec->state.ref_frame_idx[OC_FRAME_PREV]= + _dec->state.ref_frame_idx[OC_FRAME_SELF]; + } + else{ + /*Otherwise, just replace the previous reference frame.*/ + _dec->state.ref_frame_idx[OC_FRAME_PREV]= + _dec->state.ref_frame_idx[OC_FRAME_SELF]; + } + /*Restore the FPU before dump_frame, since that _does_ use the FPU (for PNG + gamma values, if nothing else).*/ + oc_restore_fpu(&_dec->state); +#if defined(OC_DUMP_IMAGES) + /*Don't dump images for dropped frames.*/ + oc_state_dump_frame(&_dec->state,OC_FRAME_SELF,"dec"); +#endif + return 0; + } + else{ + if(_dec->state.ref_frame_idx[OC_FRAME_GOLD]<0|| + _dec->state.ref_frame_idx[OC_FRAME_PREV]<0){ + int refi; + /*No reference frames yet!*/ + oc_dec_init_dummy_frame(_dec); + refi=_dec->state.ref_frame_idx[OC_FRAME_PREV]; + _dec->state.ref_frame_idx[OC_FRAME_SELF]=refi; + memcpy(_dec->pp_frame_buf,_dec->state.ref_frame_bufs[refi], + sizeof(_dec->pp_frame_buf[0])*3); + } + /*Just update the granule position and return.*/ + _dec->state.granpos=(_dec->state.keyframe_num+_dec->state.granpos_bias<< + _dec->state.info.keyframe_granule_shift) + +(_dec->state.curframe_num-_dec->state.keyframe_num); + _dec->state.curframe_num++; + if(_granpos!=NULL)*_granpos=_dec->state.granpos; + return TH_DUPFRAME; + } +} + +int th_decode_ycbcr_out(th_dec_ctx *_dec,th_ycbcr_buffer _ycbcr){ + if(_dec==NULL||_ycbcr==NULL)return TH_EFAULT; + oc_ycbcr_buffer_flip(_ycbcr,_dec->pp_frame_buf); +#if defined(HAVE_CAIRO) + /*If telemetry ioctls are active, we need to draw to the output buffer. + Stuff the plane into cairo.*/ + if(_dec->telemetry){ + cairo_surface_t *cs; + unsigned char *data; + unsigned char *y_row; + unsigned char *u_row; + unsigned char *v_row; + unsigned char *rgb_row; + int cstride; + int w; + int h; + int x; + int y; + int hdec; + int vdec; + w=_ycbcr[0].width; + h=_ycbcr[0].height; + hdec=!(_dec->state.info.pixel_fmt&1); + vdec=!(_dec->state.info.pixel_fmt&2); + /*Lazy data buffer init. + We could try to re-use the post-processing buffer, which would save + memory, but complicate the allocation logic there. + I don't think anyone cares about memory usage when using telemetry; it is + not meant for embedded devices.*/ + if(_dec->telemetry_frame_data==NULL){ + _dec->telemetry_frame_data=_ogg_malloc( + (w*h+2*(w>>hdec)*(h>>vdec))*sizeof(*_dec->telemetry_frame_data)); + if(_dec->telemetry_frame_data==NULL)return 0; + } + cs=cairo_image_surface_create(CAIRO_FORMAT_RGB24,w,h); + /*Sadly, no YUV support in Cairo (yet); convert into the RGB buffer.*/ + data=cairo_image_surface_get_data(cs); + if(data==NULL){ + cairo_surface_destroy(cs); + return 0; + } + cstride=cairo_image_surface_get_stride(cs); + y_row=_ycbcr[0].data; + u_row=_ycbcr[1].data; + v_row=_ycbcr[2].data; + rgb_row=data; + for(y=0;y>hdec]-363703744)/1635200; + g=(3827562*y_row[x]-1287801*u_row[x>>hdec] + -2672387*v_row[x>>hdec]+447306710)/3287200; + b=(952000*y_row[x]+1649289*u_row[x>>hdec]-225932192)/817600; + rgb_row[4*x+0]=OC_CLAMP255(b); + rgb_row[4*x+1]=OC_CLAMP255(g); + rgb_row[4*x+2]=OC_CLAMP255(r); + } + y_row+=_ycbcr[0].stride; + u_row+=_ycbcr[1].stride&-((y&1)|!vdec); + v_row+=_ycbcr[2].stride&-((y&1)|!vdec); + rgb_row+=cstride; + } + /*Draw coded identifier for each macroblock (stored in Hilbert order).*/ + { + cairo_t *c; + const oc_fragment *frags; + oc_mv *frag_mvs; + const signed char *mb_modes; + oc_mb_map *mb_maps; + size_t nmbs; + size_t mbi; + int row2; + int col2; + int qim[3]={0,0,0}; + if(_dec->state.nqis==2){ + int bqi; + bqi=_dec->state.qis[0]; + if(_dec->state.qis[1]>bqi)qim[1]=1; + if(_dec->state.qis[1]state.nqis==3){ + int bqi; + int cqi; + int dqi; + bqi=_dec->state.qis[0]; + cqi=_dec->state.qis[1]; + dqi=_dec->state.qis[2]; + if(cqi>bqi&&dqi>bqi){ + if(dqi>cqi){ + qim[1]=1; + qim[2]=2; + } + else{ + qim[1]=2; + qim[2]=1; + } + } + else if(cqistate.frags; + frag_mvs=_dec->state.frag_mvs; + mb_modes=_dec->state.mb_modes; + mb_maps=_dec->state.mb_maps; + nmbs=_dec->state.nmbs; + row2=0; + col2=0; + for(mbi=0;mbi>1)&1))*16-16; + x=(col2>>1)*16; + cairo_set_line_width(c,1.); + /*Keyframe (all intra) red box.*/ + if(_dec->state.frame_type==OC_INTRA_FRAME){ + if(_dec->telemetry_mbmode&0x02){ + cairo_set_source_rgba(c,1.,0,0,.5); + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,1.,0,0,.25); + cairo_fill(c); + } + } + else{ + const signed char *frag_mv; + ptrdiff_t fragi; + for(bi=0;bi<4;bi++){ + fragi=mb_maps[mbi][0][bi]; + if(fragi>=0&&frags[fragi].coded){ + frag_mv=frag_mvs[fragi]; + break; + } + } + if(bi<4){ + switch(mb_modes[mbi]){ + case OC_MODE_INTRA:{ + if(_dec->telemetry_mbmode&0x02){ + cairo_set_source_rgba(c,1.,0,0,.5); + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,1.,0,0,.25); + cairo_fill(c); + } + }break; + case OC_MODE_INTER_NOMV:{ + if(_dec->telemetry_mbmode&0x01){ + cairo_set_source_rgba(c,0,0,1.,.5); + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,0,0,1.,.25); + cairo_fill(c); + } + }break; + case OC_MODE_INTER_MV:{ + if(_dec->telemetry_mbmode&0x04){ + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_set_source_rgba(c,0,1.,0,.5); + cairo_stroke(c); + } + if(_dec->telemetry_mv&0x04){ + cairo_move_to(c,x+8+frag_mv[0],y+8-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+8+frag_mv[0]*.66,y+8-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+8+frag_mv[0]*.33,y+8-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+8,y+8); + cairo_stroke(c); + } + }break; + case OC_MODE_INTER_MV_LAST:{ + if(_dec->telemetry_mbmode&0x08){ + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_set_source_rgba(c,0,1.,0,.5); + cairo_move_to(c,x+13.5,y+2.5); + cairo_line_to(c,x+2.5,y+8); + cairo_line_to(c,x+13.5,y+13.5); + cairo_stroke(c); + } + if(_dec->telemetry_mv&0x08){ + cairo_move_to(c,x+8+frag_mv[0],y+8-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+8+frag_mv[0]*.66,y+8-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+8+frag_mv[0]*.33,y+8-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+8,y+8); + cairo_stroke(c); + } + }break; + case OC_MODE_INTER_MV_LAST2:{ + if(_dec->telemetry_mbmode&0x10){ + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_set_source_rgba(c,0,1.,0,.5); + cairo_move_to(c,x+8,y+2.5); + cairo_line_to(c,x+2.5,y+8); + cairo_line_to(c,x+8,y+13.5); + cairo_move_to(c,x+13.5,y+2.5); + cairo_line_to(c,x+8,y+8); + cairo_line_to(c,x+13.5,y+13.5); + cairo_stroke(c); + } + if(_dec->telemetry_mv&0x10){ + cairo_move_to(c,x+8+frag_mv[0],y+8-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+8+frag_mv[0]*.66,y+8-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+8+frag_mv[0]*.33,y+8-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+8,y+8); + cairo_stroke(c); + } + }break; + case OC_MODE_GOLDEN_NOMV:{ + if(_dec->telemetry_mbmode&0x20){ + cairo_set_source_rgba(c,1.,1.,0,.5); + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,1.,1.,0,.25); + cairo_fill(c); + } + }break; + case OC_MODE_GOLDEN_MV:{ + if(_dec->telemetry_mbmode&0x40){ + cairo_rectangle(c,x+2.5,y+2.5,11,11); + cairo_set_source_rgba(c,1.,1.,0,.5); + cairo_stroke(c); + } + if(_dec->telemetry_mv&0x40){ + cairo_move_to(c,x+8+frag_mv[0],y+8-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+8+frag_mv[0]*.66,y+8-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+8+frag_mv[0]*.33,y+8-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+8,y+8); + cairo_stroke(c); + } + }break; + case OC_MODE_INTER_MV_FOUR:{ + if(_dec->telemetry_mbmode&0x80){ + cairo_rectangle(c,x+2.5,y+2.5,4,4); + cairo_rectangle(c,x+9.5,y+2.5,4,4); + cairo_rectangle(c,x+2.5,y+9.5,4,4); + cairo_rectangle(c,x+9.5,y+9.5,4,4); + cairo_set_source_rgba(c,0,1.,0,.5); + cairo_stroke(c); + } + /*4mv is odd, coded in raster order.*/ + fragi=mb_maps[mbi][0][0]; + if(frags[fragi].coded&&_dec->telemetry_mv&0x80){ + frag_mv=frag_mvs[fragi]; + cairo_move_to(c,x+4+frag_mv[0],y+12-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+4+frag_mv[0]*.66,y+12-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+4+frag_mv[0]*.33,y+12-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+4,y+12); + cairo_stroke(c); + } + fragi=mb_maps[mbi][0][1]; + if(frags[fragi].coded&&_dec->telemetry_mv&0x80){ + frag_mv=frag_mvs[fragi]; + cairo_move_to(c,x+12+frag_mv[0],y+12-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+12+frag_mv[0]*.66,y+12-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+12+frag_mv[0]*.33,y+12-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+12,y+12); + cairo_stroke(c); + } + fragi=mb_maps[mbi][0][2]; + if(frags[fragi].coded&&_dec->telemetry_mv&0x80){ + frag_mv=frag_mvs[fragi]; + cairo_move_to(c,x+4+frag_mv[0],y+4-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+4+frag_mv[0]*.66,y+4-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+4+frag_mv[0]*.33,y+4-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+4,y+4); + cairo_stroke(c); + } + fragi=mb_maps[mbi][0][3]; + if(frags[fragi].coded&&_dec->telemetry_mv&0x80){ + frag_mv=frag_mvs[fragi]; + cairo_move_to(c,x+12+frag_mv[0],y+4-frag_mv[1]); + cairo_set_source_rgba(c,1.,1.,1.,.9); + cairo_set_line_width(c,3.); + cairo_line_to(c,x+12+frag_mv[0]*.66,y+4-frag_mv[1]*.66); + cairo_stroke_preserve(c); + cairo_set_line_width(c,2.); + cairo_line_to(c,x+12+frag_mv[0]*.33,y+4-frag_mv[1]*.33); + cairo_stroke_preserve(c); + cairo_set_line_width(c,1.); + cairo_line_to(c,x+12,y+4); + cairo_stroke(c); + } + }break; + } + } + } + /*qii illustration.*/ + if(_dec->telemetry_qi&0x2){ + cairo_set_line_cap(c,CAIRO_LINE_CAP_SQUARE); + for(bi=0;bi<4;bi++){ + ptrdiff_t fragi; + int qiv; + int xp; + int yp; + xp=x+(bi&1)*8; + yp=y+8-(bi&2)*4; + fragi=mb_maps[mbi][0][bi]; + if(fragi>=0&&frags[fragi].coded){ + qiv=qim[frags[fragi].qii]; + cairo_set_line_width(c,3.); + cairo_set_source_rgba(c,0.,0.,0.,.5); + switch(qiv){ + /*Double plus:*/ + case 2:{ + if((bi&1)^((bi&2)>>1)){ + cairo_move_to(c,xp+2.5,yp+1.5); + cairo_line_to(c,xp+2.5,yp+3.5); + cairo_move_to(c,xp+1.5,yp+2.5); + cairo_line_to(c,xp+3.5,yp+2.5); + cairo_move_to(c,xp+5.5,yp+4.5); + cairo_line_to(c,xp+5.5,yp+6.5); + cairo_move_to(c,xp+4.5,yp+5.5); + cairo_line_to(c,xp+6.5,yp+5.5); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,0.,1.,1.,1.); + } + else{ + cairo_move_to(c,xp+5.5,yp+1.5); + cairo_line_to(c,xp+5.5,yp+3.5); + cairo_move_to(c,xp+4.5,yp+2.5); + cairo_line_to(c,xp+6.5,yp+2.5); + cairo_move_to(c,xp+2.5,yp+4.5); + cairo_line_to(c,xp+2.5,yp+6.5); + cairo_move_to(c,xp+1.5,yp+5.5); + cairo_line_to(c,xp+3.5,yp+5.5); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,0.,1.,1.,1.); + } + }break; + /*Double minus:*/ + case -2:{ + cairo_move_to(c,xp+2.5,yp+2.5); + cairo_line_to(c,xp+5.5,yp+2.5); + cairo_move_to(c,xp+2.5,yp+5.5); + cairo_line_to(c,xp+5.5,yp+5.5); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,1.,1.,1.,1.); + }break; + /*Plus:*/ + case 1:{ + if(bi&2==0)yp-=2; + if(bi&1==0)xp-=2; + cairo_move_to(c,xp+4.5,yp+2.5); + cairo_line_to(c,xp+4.5,yp+6.5); + cairo_move_to(c,xp+2.5,yp+4.5); + cairo_line_to(c,xp+6.5,yp+4.5); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,.1,1.,.3,1.); + break; + } + /*Fall through.*/ + /*Minus:*/ + case -1:{ + cairo_move_to(c,xp+2.5,yp+4.5); + cairo_line_to(c,xp+6.5,yp+4.5); + cairo_stroke_preserve(c); + cairo_set_source_rgba(c,1.,.3,.1,1.); + }break; + default:continue; + } + cairo_set_line_width(c,1.); + cairo_stroke(c); + } + } + } + col2++; + if((col2>>1)>=_dec->state.nhmbs){ + col2=0; + row2+=2; + } + } + /*Bit usage indicator[s]:*/ + if(_dec->telemetry_bits){ + int widths[6]; + int fpsn; + int fpsd; + int mult; + int fullw; + int padw; + int i; + fpsn=_dec->state.info.fps_numerator; + fpsd=_dec->state.info.fps_denominator; + mult=(_dec->telemetry_bits>=0xFF?1:_dec->telemetry_bits); + fullw=250.f*h*fpsd*mult/fpsn; + padw=w-24; + /*Header and coded block bits.*/ + if(_dec->telemetry_frame_bytes<0|| + _dec->telemetry_frame_bytes==OC_LOTS_OF_BITS){ + _dec->telemetry_frame_bytes=0; + } + if(_dec->telemetry_coding_bytes<0|| + _dec->telemetry_coding_bytes>_dec->telemetry_frame_bytes){ + _dec->telemetry_coding_bytes=0; + } + if(_dec->telemetry_mode_bytes<0|| + _dec->telemetry_mode_bytes>_dec->telemetry_frame_bytes){ + _dec->telemetry_mode_bytes=0; + } + if(_dec->telemetry_mv_bytes<0|| + _dec->telemetry_mv_bytes>_dec->telemetry_frame_bytes){ + _dec->telemetry_mv_bytes=0; + } + if(_dec->telemetry_qi_bytes<0|| + _dec->telemetry_qi_bytes>_dec->telemetry_frame_bytes){ + _dec->telemetry_qi_bytes=0; + } + if(_dec->telemetry_dc_bytes<0|| + _dec->telemetry_dc_bytes>_dec->telemetry_frame_bytes){ + _dec->telemetry_dc_bytes=0; + } + widths[0]=padw*(_dec->telemetry_frame_bytes-_dec->telemetry_coding_bytes)/fullw; + widths[1]=padw*(_dec->telemetry_coding_bytes-_dec->telemetry_mode_bytes)/fullw; + widths[2]=padw*(_dec->telemetry_mode_bytes-_dec->telemetry_mv_bytes)/fullw; + widths[3]=padw*(_dec->telemetry_mv_bytes-_dec->telemetry_qi_bytes)/fullw; + widths[4]=padw*(_dec->telemetry_qi_bytes-_dec->telemetry_dc_bytes)/fullw; + widths[5]=padw*(_dec->telemetry_dc_bytes)/fullw; + for(i=0;i<6;i++)if(widths[i]>w)widths[i]=w; + cairo_set_source_rgba(c,.0,.0,.0,.6); + cairo_rectangle(c,10,h-33,widths[0]+1,5); + cairo_rectangle(c,10,h-29,widths[1]+1,5); + cairo_rectangle(c,10,h-25,widths[2]+1,5); + cairo_rectangle(c,10,h-21,widths[3]+1,5); + cairo_rectangle(c,10,h-17,widths[4]+1,5); + cairo_rectangle(c,10,h-13,widths[5]+1,5); + cairo_fill(c); + cairo_set_source_rgb(c,1,0,0); + cairo_rectangle(c,10.5,h-32.5,widths[0],4); + cairo_fill(c); + cairo_set_source_rgb(c,0,1,0); + cairo_rectangle(c,10.5,h-28.5,widths[1],4); + cairo_fill(c); + cairo_set_source_rgb(c,0,0,1); + cairo_rectangle(c,10.5,h-24.5,widths[2],4); + cairo_fill(c); + cairo_set_source_rgb(c,.6,.4,.0); + cairo_rectangle(c,10.5,h-20.5,widths[3],4); + cairo_fill(c); + cairo_set_source_rgb(c,.3,.3,.3); + cairo_rectangle(c,10.5,h-16.5,widths[4],4); + cairo_fill(c); + cairo_set_source_rgb(c,.5,.5,.8); + cairo_rectangle(c,10.5,h-12.5,widths[5],4); + cairo_fill(c); + } + /*Master qi indicator[s]:*/ + if(_dec->telemetry_qi&0x1){ + cairo_text_extents_t extents; + char buffer[10]; + int p; + int y; + p=0; + y=h-7.5; + if(_dec->state.qis[0]>=10)buffer[p++]=48+_dec->state.qis[0]/10; + buffer[p++]=48+_dec->state.qis[0]%10; + if(_dec->state.nqis>=2){ + buffer[p++]=' '; + if(_dec->state.qis[1]>=10)buffer[p++]=48+_dec->state.qis[1]/10; + buffer[p++]=48+_dec->state.qis[1]%10; + } + if(_dec->state.nqis==3){ + buffer[p++]=' '; + if(_dec->state.qis[2]>=10)buffer[p++]=48+_dec->state.qis[2]/10; + buffer[p++]=48+_dec->state.qis[2]%10; + } + buffer[p++]='\0'; + cairo_select_font_face(c,"sans", + CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD); + cairo_set_font_size(c,18); + cairo_text_extents(c,buffer,&extents); + cairo_set_source_rgb(c,1,1,1); + cairo_move_to(c,w-extents.x_advance-10,y); + cairo_show_text(c,buffer); + cairo_set_source_rgb(c,0,0,0); + cairo_move_to(c,w-extents.x_advance-10,y); + cairo_text_path(c,buffer); + cairo_set_line_width(c,.8); + cairo_set_line_join(c,CAIRO_LINE_JOIN_ROUND); + cairo_stroke(c); + } + cairo_destroy(c); + } + /*Out of the Cairo plane into the telemetry YUV buffer.*/ + _ycbcr[0].data=_dec->telemetry_frame_data; + _ycbcr[0].stride=_ycbcr[0].width; + _ycbcr[1].data=_ycbcr[0].data+h*_ycbcr[0].stride; + _ycbcr[1].stride=_ycbcr[1].width; + _ycbcr[2].data=_ycbcr[1].data+(h>>vdec)*_ycbcr[1].stride; + _ycbcr[2].stride=_ycbcr[2].width; + y_row=_ycbcr[0].data; + u_row=_ycbcr[1].data; + v_row=_ycbcr[2].data; + rgb_row=data; + /*This is one of the few places it's worth handling chroma on a + case-by-case basis.*/ + switch(_dec->state.info.pixel_fmt){ + case TH_PF_420:{ + for(y=0;y>1]=OC_CLAMP255(u); + v_row[x>>1]=OC_CLAMP255(v); + } + y_row+=_ycbcr[0].stride<<1; + u_row+=_ycbcr[1].stride; + v_row+=_ycbcr[2].stride; + rgb_row+=cstride<<1; + } + }break; + case TH_PF_422:{ + for(y=0;y>1]=OC_CLAMP255(u); + v_row[x>>1]=OC_CLAMP255(v); + } + y_row+=_ycbcr[0].stride; + u_row+=_ycbcr[1].stride; + v_row+=_ycbcr[2].stride; + rgb_row+=cstride; + } + }break; + /*case TH_PF_444:*/ + default:{ + for(y=0;y +#include +#include +#include "dequant.h" +#include "decint.h" + +int oc_quant_params_unpack(oc_pack_buf *_opb,th_quant_info *_qinfo){ + th_quant_base *base_mats; + long val; + int nbase_mats; + int sizes[64]; + int indices[64]; + int nbits; + int bmi; + int ci; + int qti; + int pli; + int qri; + int qi; + int i; + val=oc_pack_read(_opb,3); + nbits=(int)val; + for(qi=0;qi<64;qi++){ + val=oc_pack_read(_opb,nbits); + _qinfo->loop_filter_limits[qi]=(unsigned char)val; + } + val=oc_pack_read(_opb,4); + nbits=(int)val+1; + for(qi=0;qi<64;qi++){ + val=oc_pack_read(_opb,nbits); + _qinfo->ac_scale[qi]=(ogg_uint16_t)val; + } + val=oc_pack_read(_opb,4); + nbits=(int)val+1; + for(qi=0;qi<64;qi++){ + val=oc_pack_read(_opb,nbits); + _qinfo->dc_scale[qi]=(ogg_uint16_t)val; + } + val=oc_pack_read(_opb,9); + nbase_mats=(int)val+1; + base_mats=_ogg_malloc(nbase_mats*sizeof(base_mats[0])); + if(base_mats==NULL)return TH_EFAULT; + for(bmi=0;bmiqi_ranges[qti]+pli; + if(i>0){ + val=oc_pack_read1(_opb); + if(!val){ + int qtj; + int plj; + if(qti>0){ + val=oc_pack_read1(_opb); + if(val){ + qtj=qti-1; + plj=pli; + } + else{ + qtj=(i-1)/3; + plj=(i-1)%3; + } + } + else{ + qtj=(i-1)/3; + plj=(i-1)%3; + } + *qranges=*(_qinfo->qi_ranges[qtj]+plj); + continue; + } + } + val=oc_pack_read(_opb,nbits); + indices[0]=(int)val; + for(qi=qri=0;qi<63;){ + val=oc_pack_read(_opb,oc_ilog(62-qi)); + sizes[qri]=(int)val+1; + qi+=(int)val+1; + val=oc_pack_read(_opb,nbits); + indices[++qri]=(int)val; + } + /*Note: The caller is responsible for cleaning up any partially + constructed qinfo.*/ + if(qi>63){ + _ogg_free(base_mats); + return TH_EBADHEADER; + } + qranges->nranges=qri; + qranges->sizes=qrsizes=(int *)_ogg_malloc(qri*sizeof(qrsizes[0])); + if(qranges->sizes==NULL){ + /*Note: The caller is responsible for cleaning up any partially + constructed qinfo.*/ + _ogg_free(base_mats); + return TH_EFAULT; + } + memcpy(qrsizes,sizes,qri*sizeof(qrsizes[0])); + qrbms=(th_quant_base *)_ogg_malloc((qri+1)*sizeof(qrbms[0])); + if(qrbms==NULL){ + /*Note: The caller is responsible for cleaning up any partially + constructed qinfo.*/ + _ogg_free(base_mats); + return TH_EFAULT; + } + qranges->base_matrices=(const th_quant_base *)qrbms; + do{ + bmi=indices[qri]; + /*Note: The caller is responsible for cleaning up any partially + constructed qinfo.*/ + if(bmi>=nbase_mats){ + _ogg_free(base_mats); + return TH_EBADHEADER; + } + memcpy(qrbms[qri],base_mats[bmi],sizeof(qrbms[qri])); + } + while(qri-->0); + } + _ogg_free(base_mats); + return 0; +} + +void oc_quant_params_clear(th_quant_info *_qinfo){ + int i; + for(i=6;i-->0;){ + int qti; + int pli; + qti=i/3; + pli=i%3; + /*Clear any duplicate pointer references.*/ + if(i>0){ + int qtj; + int plj; + qtj=(i-1)/3; + plj=(i-1)%3; + if(_qinfo->qi_ranges[qti][pli].sizes== + _qinfo->qi_ranges[qtj][plj].sizes){ + _qinfo->qi_ranges[qti][pli].sizes=NULL; + } + if(_qinfo->qi_ranges[qti][pli].base_matrices== + _qinfo->qi_ranges[qtj][plj].base_matrices){ + _qinfo->qi_ranges[qti][pli].base_matrices=NULL; + } + } + if(qti>0){ + if(_qinfo->qi_ranges[1][pli].sizes== + _qinfo->qi_ranges[0][pli].sizes){ + _qinfo->qi_ranges[1][pli].sizes=NULL; + } + if(_qinfo->qi_ranges[1][pli].base_matrices== + _qinfo->qi_ranges[0][pli].base_matrices){ + _qinfo->qi_ranges[1][pli].base_matrices=NULL; + } + } + /*Now free all the non-duplicate storage.*/ + _ogg_free((void *)_qinfo->qi_ranges[qti][pli].sizes); + _ogg_free((void *)_qinfo->qi_ranges[qti][pli].base_matrices); + } +} diff --git a/libs/libtheora-1.1/lib/dequant.h b/libs/libtheora-1.1/lib/dequant.h new file mode 100644 index 00000000..4e0c5c71 --- /dev/null +++ b/libs/libtheora-1.1/lib/dequant.h @@ -0,0 +1,27 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: dequant.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_dequant_H) +# define _dequant_H (1) +# include "quant.h" +# include "bitpack.h" + +int oc_quant_params_unpack(oc_pack_buf *_opb, + th_quant_info *_qinfo); +void oc_quant_params_clear(th_quant_info *_qinfo); + +#endif diff --git a/libs/libtheora-1.1/lib/encapiwrapper.c b/libs/libtheora-1.1/lib/encapiwrapper.c new file mode 100644 index 00000000..874f1244 --- /dev/null +++ b/libs/libtheora-1.1/lib/encapiwrapper.c @@ -0,0 +1,168 @@ +#include +#include +#include +#include "apiwrapper.h" +#include "encint.h" +#include "theora/theoraenc.h" + + + +static void th_enc_api_clear(th_api_wrapper *_api){ + if(_api->encode)th_encode_free(_api->encode); + memset(_api,0,sizeof(*_api)); +} + +static void theora_encode_clear(theora_state *_te){ + if(_te->i!=NULL)theora_info_clear(_te->i); + memset(_te,0,sizeof(*_te)); +} + +static int theora_encode_control(theora_state *_te,int _req, + void *_buf,size_t _buf_sz){ + return th_encode_ctl(((th_api_wrapper *)_te->i->codec_setup)->encode, + _req,_buf,_buf_sz); +} + +static ogg_int64_t theora_encode_granule_frame(theora_state *_te, + ogg_int64_t _gp){ + return th_granule_frame(((th_api_wrapper *)_te->i->codec_setup)->encode,_gp); +} + +static double theora_encode_granule_time(theora_state *_te,ogg_int64_t _gp){ + return th_granule_time(((th_api_wrapper *)_te->i->codec_setup)->encode,_gp); +} + +static const oc_state_dispatch_vtable OC_ENC_DISPATCH_VTBL={ + (oc_state_clear_func)theora_encode_clear, + (oc_state_control_func)theora_encode_control, + (oc_state_granule_frame_func)theora_encode_granule_frame, + (oc_state_granule_time_func)theora_encode_granule_time, +}; + +int theora_encode_init(theora_state *_te,theora_info *_ci){ + th_api_info *apiinfo; + th_info info; + ogg_uint32_t keyframe_frequency_force; + /*Allocate our own combined API wrapper/theora_info struct. + We put them both in one malloc'd block so that when the API wrapper is + freed, the info struct goes with it. + This avoids having to figure out whether or not we need to free the info + struct in either theora_info_clear() or theora_clear().*/ + apiinfo=(th_api_info *)_ogg_malloc(sizeof(*apiinfo)); + if(apiinfo==NULL)return TH_EFAULT; + /*Make our own copy of the info struct, since its lifetime should be + independent of the one we were passed in.*/ + *&apiinfo->info=*_ci; + oc_theora_info2th_info(&info,_ci); + apiinfo->api.encode=th_encode_alloc(&info); + if(apiinfo->api.encode==NULL){ + _ogg_free(apiinfo); + return OC_EINVAL; + } + apiinfo->api.clear=(oc_setup_clear_func)th_enc_api_clear; + /*Provide entry points for ABI compatibility with old decoder shared libs.*/ + _te->internal_encode=(void *)&OC_ENC_DISPATCH_VTBL; + _te->internal_decode=NULL; + _te->granulepos=0; + _te->i=&apiinfo->info; + _te->i->codec_setup=&apiinfo->api; + /*Set the precise requested keyframe frequency.*/ + keyframe_frequency_force=_ci->keyframe_auto_p? + _ci->keyframe_frequency_force:_ci->keyframe_frequency; + th_encode_ctl(apiinfo->api.encode, + TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, + &keyframe_frequency_force,sizeof(keyframe_frequency_force)); + /*TODO: Additional codec setup using the extra fields in theora_info.*/ + return 0; +} + +int theora_encode_YUVin(theora_state *_te,yuv_buffer *_yuv){ + th_api_wrapper *api; + th_ycbcr_buffer buf; + int ret; + api=(th_api_wrapper *)_te->i->codec_setup; + buf[0].width=_yuv->y_width; + buf[0].height=_yuv->y_height; + buf[0].stride=_yuv->y_stride; + buf[0].data=_yuv->y; + buf[1].width=_yuv->uv_width; + buf[1].height=_yuv->uv_height; + buf[1].stride=_yuv->uv_stride; + buf[1].data=_yuv->u; + buf[2].width=_yuv->uv_width; + buf[2].height=_yuv->uv_height; + buf[2].stride=_yuv->uv_stride; + buf[2].data=_yuv->v; + ret=th_encode_ycbcr_in(api->encode,buf); + if(ret<0)return ret; + _te->granulepos=api->encode->state.granpos; + return ret; +} + +int theora_encode_packetout(theora_state *_te,int _last_p,ogg_packet *_op){ + th_api_wrapper *api; + api=(th_api_wrapper *)_te->i->codec_setup; + return th_encode_packetout(api->encode,_last_p,_op); +} + +int theora_encode_header(theora_state *_te,ogg_packet *_op){ + oc_enc_ctx *enc; + th_api_wrapper *api; + int ret; + api=(th_api_wrapper *)_te->i->codec_setup; + enc=api->encode; + /*If we've already started encoding, fail.*/ + if(enc->packet_state>OC_PACKET_EMPTY||enc->state.granpos!=0){ + return TH_EINVAL; + } + /*Reset the state to make sure we output an info packet.*/ + enc->packet_state=OC_PACKET_INFO_HDR; + ret=th_encode_flushheader(api->encode,NULL,_op); + return ret>=0?0:ret; +} + +int theora_encode_comment(theora_comment *_tc,ogg_packet *_op){ + oggpack_buffer opb; + void *buf; + int packet_state; + int ret; + packet_state=OC_PACKET_COMMENT_HDR; + oggpackB_writeinit(&opb); + ret=oc_state_flushheader(NULL,&packet_state,&opb,NULL,NULL, + th_version_string(),(th_comment *)_tc,_op); + if(ret>=0){ + /*The oggpack_buffer's lifetime ends with this function, so we have to + copy out the packet contents. + Presumably the application knows it is supposed to free this. + This part works nothing like the Vorbis API, and the documentation on it + has been wrong for some time, claiming libtheora owned the memory.*/ + buf=_ogg_malloc(_op->bytes); + if(buf==NULL){ + _op->packet=NULL; + ret=TH_EFAULT; + } + else{ + memcpy(buf,_op->packet,_op->bytes); + _op->packet=buf; + ret=0; + } + } + oggpack_writeclear(&opb); + return ret; +} + +int theora_encode_tables(theora_state *_te,ogg_packet *_op){ + oc_enc_ctx *enc; + th_api_wrapper *api; + int ret; + api=(th_api_wrapper *)_te->i->codec_setup; + enc=api->encode; + /*If we've already started encoding, fail.*/ + if(enc->packet_state>OC_PACKET_EMPTY||enc->state.granpos!=0){ + return TH_EINVAL; + } + /*Reset the state to make sure we output a setup packet.*/ + enc->packet_state=OC_PACKET_SETUP_HDR; + ret=th_encode_flushheader(api->encode,NULL,_op); + return ret>=0?0:ret; +} diff --git a/libs/libtheora-1.1/lib/encfrag.c b/libs/libtheora-1.1/lib/encfrag.c new file mode 100644 index 00000000..e3a6a572 --- /dev/null +++ b/libs/libtheora-1.1/lib/encfrag.c @@ -0,0 +1,388 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: encfrag.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include +#include "encint.h" + + +void oc_enc_frag_sub(const oc_enc_ctx *_enc,ogg_int16_t _diff[64], + const unsigned char *_src,const unsigned char *_ref,int _ystride){ + (*_enc->opt_vtable.frag_sub)(_diff,_src,_ref,_ystride); +} + +void oc_enc_frag_sub_c(ogg_int16_t _diff[64],const unsigned char *_src, + const unsigned char *_ref,int _ystride){ + int i; + for(i=0;i<8;i++){ + int j; + for(j=0;j<8;j++)_diff[i*8+j]=(ogg_int16_t)(_src[j]-_ref[j]); + _src+=_ystride; + _ref+=_ystride; + } +} + +void oc_enc_frag_sub_128(const oc_enc_ctx *_enc,ogg_int16_t _diff[64], + const unsigned char *_src,int _ystride){ + (*_enc->opt_vtable.frag_sub_128)(_diff,_src,_ystride); +} + +void oc_enc_frag_sub_128_c(ogg_int16_t *_diff, + const unsigned char *_src,int _ystride){ + int i; + for(i=0;i<8;i++){ + int j; + for(j=0;j<8;j++)_diff[i*8+j]=(ogg_int16_t)(_src[j]-128); + _src+=_ystride; + } +} + +unsigned oc_enc_frag_sad(const oc_enc_ctx *_enc,const unsigned char *_x, + const unsigned char *_y,int _ystride){ + return (*_enc->opt_vtable.frag_sad)(_x,_y,_ystride); +} + +unsigned oc_enc_frag_sad_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride){ + unsigned sad; + int i; + sad=0; + for(i=8;i-->0;){ + int j; + for(j=0;j<8;j++)sad+=abs(_src[j]-_ref[j]); + _src+=_ystride; + _ref+=_ystride; + } + return sad; +} + +unsigned oc_enc_frag_sad_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref,int _ystride, + unsigned _thresh){ + return (*_enc->opt_vtable.frag_sad_thresh)(_src,_ref,_ystride,_thresh); +} + +unsigned oc_enc_frag_sad_thresh_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + unsigned sad; + int i; + sad=0; + for(i=8;i-->0;){ + int j; + for(j=0;j<8;j++)sad+=abs(_src[j]-_ref[j]); + if(sad>_thresh)break; + _src+=_ystride; + _ref+=_ystride; + } + return sad; +} + +unsigned oc_enc_frag_sad2_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref1, + const unsigned char *_ref2,int _ystride,unsigned _thresh){ + return (*_enc->opt_vtable.frag_sad2_thresh)(_src,_ref1,_ref2,_ystride, + _thresh); +} + +unsigned oc_enc_frag_sad2_thresh_c(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + unsigned sad; + int i; + sad=0; + for(i=8;i-->0;){ + int j; + for(j=0;j<8;j++)sad+=abs(_src[j]-(_ref1[j]+_ref2[j]>>1)); + if(sad>_thresh)break; + _src+=_ystride; + _ref1+=_ystride; + _ref2+=_ystride; + } + return sad; +} + +static void oc_diff_hadamard(ogg_int16_t _buf[64],const unsigned char *_src, + const unsigned char *_ref,int _ystride){ + int i; + for(i=0;i<8;i++){ + int t0; + int t1; + int t2; + int t3; + int t4; + int t5; + int t6; + int t7; + int r; + /*Hadamard stage 1:*/ + t0=_src[0]-_ref[0]+_src[4]-_ref[4]; + t4=_src[0]-_ref[0]-_src[4]+_ref[4]; + t1=_src[1]-_ref[1]+_src[5]-_ref[5]; + t5=_src[1]-_ref[1]-_src[5]+_ref[5]; + t2=_src[2]-_ref[2]+_src[6]-_ref[6]; + t6=_src[2]-_ref[2]-_src[6]+_ref[6]; + t3=_src[3]-_ref[3]+_src[7]-_ref[7]; + t7=_src[3]-_ref[3]-_src[7]+_ref[7]; + /*Hadamard stage 2:*/ + r=t0; + t0+=t2; + t2=r-t2; + r=t1; + t1+=t3; + t3=r-t3; + r=t4; + t4+=t6; + t6=r-t6; + r=t5; + t5+=t7; + t7=r-t7; + /*Hadamard stage 3:*/ + _buf[0*8+i]=(ogg_int16_t)(t0+t1); + _buf[1*8+i]=(ogg_int16_t)(t0-t1); + _buf[2*8+i]=(ogg_int16_t)(t2+t3); + _buf[3*8+i]=(ogg_int16_t)(t2-t3); + _buf[4*8+i]=(ogg_int16_t)(t4+t5); + _buf[5*8+i]=(ogg_int16_t)(t4-t5); + _buf[6*8+i]=(ogg_int16_t)(t6+t7); + _buf[7*8+i]=(ogg_int16_t)(t6-t7); + _src+=_ystride; + _ref+=_ystride; + } +} + +static void oc_diff_hadamard2(ogg_int16_t _buf[64],const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride){ + int i; + for(i=0;i<8;i++){ + int t0; + int t1; + int t2; + int t3; + int t4; + int t5; + int t6; + int t7; + int r; + /*Hadamard stage 1:*/ + r=_ref1[0]+_ref2[0]>>1; + t4=_ref1[4]+_ref2[4]>>1; + t0=_src[0]-r+_src[4]-t4; + t4=_src[0]-r-_src[4]+t4; + r=_ref1[1]+_ref2[1]>>1; + t5=_ref1[5]+_ref2[5]>>1; + t1=_src[1]-r+_src[5]-t5; + t5=_src[1]-r-_src[5]+t5; + r=_ref1[2]+_ref2[2]>>1; + t6=_ref1[6]+_ref2[6]>>1; + t2=_src[2]-r+_src[6]-t6; + t6=_src[2]-r-_src[6]+t6; + r=_ref1[3]+_ref2[3]>>1; + t7=_ref1[7]+_ref2[7]>>1; + t3=_src[3]-r+_src[7]-t7; + t7=_src[3]-r-_src[7]+t7; + /*Hadamard stage 2:*/ + r=t0; + t0+=t2; + t2=r-t2; + r=t1; + t1+=t3; + t3=r-t3; + r=t4; + t4+=t6; + t6=r-t6; + r=t5; + t5+=t7; + t7=r-t7; + /*Hadamard stage 3:*/ + _buf[0*8+i]=(ogg_int16_t)(t0+t1); + _buf[1*8+i]=(ogg_int16_t)(t0-t1); + _buf[2*8+i]=(ogg_int16_t)(t2+t3); + _buf[3*8+i]=(ogg_int16_t)(t2-t3); + _buf[4*8+i]=(ogg_int16_t)(t4+t5); + _buf[5*8+i]=(ogg_int16_t)(t4-t5); + _buf[6*8+i]=(ogg_int16_t)(t6+t7); + _buf[7*8+i]=(ogg_int16_t)(t6-t7); + _src+=_ystride; + _ref1+=_ystride; + _ref2+=_ystride; + } +} + +static void oc_intra_hadamard(ogg_int16_t _buf[64],const unsigned char *_src, + int _ystride){ + int i; + for(i=0;i<8;i++){ + int t0; + int t1; + int t2; + int t3; + int t4; + int t5; + int t6; + int t7; + int r; + /*Hadamard stage 1:*/ + t0=_src[0]+_src[4]; + t4=_src[0]-_src[4]; + t1=_src[1]+_src[5]; + t5=_src[1]-_src[5]; + t2=_src[2]+_src[6]; + t6=_src[2]-_src[6]; + t3=_src[3]+_src[7]; + t7=_src[3]-_src[7]; + /*Hadamard stage 2:*/ + r=t0; + t0+=t2; + t2=r-t2; + r=t1; + t1+=t3; + t3=r-t3; + r=t4; + t4+=t6; + t6=r-t6; + r=t5; + t5+=t7; + t7=r-t7; + /*Hadamard stage 3:*/ + _buf[0*8+i]=(ogg_int16_t)(t0+t1); + _buf[1*8+i]=(ogg_int16_t)(t0-t1); + _buf[2*8+i]=(ogg_int16_t)(t2+t3); + _buf[3*8+i]=(ogg_int16_t)(t2-t3); + _buf[4*8+i]=(ogg_int16_t)(t4+t5); + _buf[5*8+i]=(ogg_int16_t)(t4-t5); + _buf[6*8+i]=(ogg_int16_t)(t6+t7); + _buf[7*8+i]=(ogg_int16_t)(t6-t7); + _src+=_ystride; + } +} + +unsigned oc_hadamard_sad_thresh(const ogg_int16_t _buf[64],unsigned _thresh){ + unsigned sad; + int t0; + int t1; + int t2; + int t3; + int t4; + int t5; + int t6; + int t7; + int r; + int i; + sad=0; + for(i=0;i<8;i++){ + /*Hadamard stage 1:*/ + t0=_buf[i*8+0]+_buf[i*8+4]; + t4=_buf[i*8+0]-_buf[i*8+4]; + t1=_buf[i*8+1]+_buf[i*8+5]; + t5=_buf[i*8+1]-_buf[i*8+5]; + t2=_buf[i*8+2]+_buf[i*8+6]; + t6=_buf[i*8+2]-_buf[i*8+6]; + t3=_buf[i*8+3]+_buf[i*8+7]; + t7=_buf[i*8+3]-_buf[i*8+7]; + /*Hadamard stage 2:*/ + r=t0; + t0+=t2; + t2=r-t2; + r=t1; + t1+=t3; + t3=r-t3; + r=t4; + t4+=t6; + t6=r-t6; + r=t5; + t5+=t7; + t7=r-t7; + /*Hadamard stage 3:*/ + r=abs(t0+t1); + r+=abs(t0-t1); + r+=abs(t2+t3); + r+=abs(t2-t3); + r+=abs(t4+t5); + r+=abs(t4-t5); + r+=abs(t6+t7); + r+=abs(t6-t7); + sad+=r; + if(sad>_thresh)break; + } + return sad; +} + +unsigned oc_enc_frag_satd_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref,int _ystride, + unsigned _thresh){ + return (*_enc->opt_vtable.frag_satd_thresh)(_src,_ref,_ystride,_thresh); +} + +unsigned oc_enc_frag_satd_thresh_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + ogg_int16_t buf[64]; + oc_diff_hadamard(buf,_src,_ref,_ystride); + return oc_hadamard_sad_thresh(buf,_thresh); +} + +unsigned oc_enc_frag_satd2_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref1, + const unsigned char *_ref2,int _ystride,unsigned _thresh){ + return (*_enc->opt_vtable.frag_satd2_thresh)(_src,_ref1,_ref2,_ystride, + _thresh); +} + +unsigned oc_enc_frag_satd2_thresh_c(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + ogg_int16_t buf[64]; + oc_diff_hadamard2(buf,_src,_ref1,_ref2,_ystride); + return oc_hadamard_sad_thresh(buf,_thresh); +} + +unsigned oc_enc_frag_intra_satd(const oc_enc_ctx *_enc, + const unsigned char *_src,int _ystride){ + return (*_enc->opt_vtable.frag_intra_satd)(_src,_ystride); +} + +unsigned oc_enc_frag_intra_satd_c(const unsigned char *_src,int _ystride){ + ogg_int16_t buf[64]; + oc_intra_hadamard(buf,_src,_ystride); + return oc_hadamard_sad_thresh(buf,UINT_MAX) + -abs(buf[0]+buf[1]+buf[2]+buf[3]+buf[4]+buf[5]+buf[6]+buf[7]); +} + +void oc_enc_frag_copy2(const oc_enc_ctx *_enc,unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride){ + (*_enc->opt_vtable.frag_copy2)(_dst,_src1,_src2,_ystride); +} + +void oc_enc_frag_copy2_c(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride){ + int i; + int j; + for(i=8;i-->0;){ + for(j=0;j<8;j++)_dst[j]=_src1[j]+_src2[j]>>1; + _dst+=_ystride; + _src1+=_ystride; + _src2+=_ystride; + } +} + +void oc_enc_frag_recon_intra(const oc_enc_ctx *_enc, + unsigned char *_dst,int _ystride,const ogg_int16_t _residue[64]){ + (*_enc->opt_vtable.frag_recon_intra)(_dst,_ystride,_residue); +} + +void oc_enc_frag_recon_inter(const oc_enc_ctx *_enc,unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){ + (*_enc->opt_vtable.frag_recon_inter)(_dst,_src,_ystride,_residue); +} diff --git a/libs/libtheora-1.1/lib/encinfo.c b/libs/libtheora-1.1/lib/encinfo.c new file mode 100644 index 00000000..0f4f5276 --- /dev/null +++ b/libs/libtheora-1.1/lib/encinfo.c @@ -0,0 +1,121 @@ +#include +#include +#include "internal.h" +#include "enquant.h" +#include "huffenc.h" + + + +/*Packs a series of octets from a given byte array into the pack buffer. + _opb: The pack buffer to store the octets in. + _buf: The byte array containing the bytes to pack. + _len: The number of octets to pack.*/ +static void oc_pack_octets(oggpack_buffer *_opb,const char *_buf,int _len){ + int i; + for(i=0;i<_len;i++)oggpackB_write(_opb,_buf[i],8); +} + + + +int oc_state_flushheader(oc_theora_state *_state,int *_packet_state, + oggpack_buffer *_opb,const th_quant_info *_qinfo, + const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS], + const char *_vendor,th_comment *_tc,ogg_packet *_op){ + unsigned char *packet; + int b_o_s; + if(_op==NULL)return TH_EFAULT; + switch(*_packet_state){ + /*Codec info header.*/ + case OC_PACKET_INFO_HDR:{ + if(_state==NULL)return TH_EFAULT; + oggpackB_reset(_opb); + /*Mark this packet as the info header.*/ + oggpackB_write(_opb,0x80,8); + /*Write the codec string.*/ + oc_pack_octets(_opb,"theora",6); + /*Write the codec bitstream version.*/ + oggpackB_write(_opb,TH_VERSION_MAJOR,8); + oggpackB_write(_opb,TH_VERSION_MINOR,8); + oggpackB_write(_opb,TH_VERSION_SUB,8); + /*Describe the encoded frame.*/ + oggpackB_write(_opb,_state->info.frame_width>>4,16); + oggpackB_write(_opb,_state->info.frame_height>>4,16); + oggpackB_write(_opb,_state->info.pic_width,24); + oggpackB_write(_opb,_state->info.pic_height,24); + oggpackB_write(_opb,_state->info.pic_x,8); + oggpackB_write(_opb,_state->info.pic_y,8); + oggpackB_write(_opb,_state->info.fps_numerator,32); + oggpackB_write(_opb,_state->info.fps_denominator,32); + oggpackB_write(_opb,_state->info.aspect_numerator,24); + oggpackB_write(_opb,_state->info.aspect_denominator,24); + oggpackB_write(_opb,_state->info.colorspace,8); + oggpackB_write(_opb,_state->info.target_bitrate,24); + oggpackB_write(_opb,_state->info.quality,6); + oggpackB_write(_opb,_state->info.keyframe_granule_shift,5); + oggpackB_write(_opb,_state->info.pixel_fmt,2); + /*Spare configuration bits.*/ + oggpackB_write(_opb,0,3); + b_o_s=1; + }break; + /*Comment header.*/ + case OC_PACKET_COMMENT_HDR:{ + int vendor_len; + int i; + if(_tc==NULL)return TH_EFAULT; + vendor_len=strlen(_vendor); + oggpackB_reset(_opb); + /*Mark this packet as the comment header.*/ + oggpackB_write(_opb,0x81,8); + /*Write the codec string.*/ + oc_pack_octets(_opb,"theora",6); + /*Write the vendor string.*/ + oggpack_write(_opb,vendor_len,32); + oc_pack_octets(_opb,_vendor,vendor_len); + oggpack_write(_opb,_tc->comments,32); + for(i=0;i<_tc->comments;i++){ + if(_tc->user_comments[i]!=NULL){ + oggpack_write(_opb,_tc->comment_lengths[i],32); + oc_pack_octets(_opb,_tc->user_comments[i],_tc->comment_lengths[i]); + } + else oggpack_write(_opb,0,32); + } + b_o_s=0; + }break; + /*Codec setup header.*/ + case OC_PACKET_SETUP_HDR:{ + int ret; + oggpackB_reset(_opb); + /*Mark this packet as the setup header.*/ + oggpackB_write(_opb,0x82,8); + /*Write the codec string.*/ + oc_pack_octets(_opb,"theora",6); + /*Write the quantizer tables.*/ + oc_quant_params_pack(_opb,_qinfo); + /*Write the huffman codes.*/ + ret=oc_huff_codes_pack(_opb,_codes); + /*This should never happen, because we validate the tables when they + are set. + If you see, it's a good chance memory is being corrupted.*/ + if(ret<0)return ret; + b_o_s=0; + }break; + /*No more headers to emit.*/ + default:return 0; + } + /*This is kind of fugly: we hand the user a buffer which they do not own. + We will overwrite it when the next packet is output, so the user better be + done with it by then. + Vorbis is little better: it hands back buffers that it will free the next + time the headers are requested, or when the encoder is cleared. + Hopefully libogg2 will make this much cleaner.*/ + packet=oggpackB_get_buffer(_opb); + /*If there's no packet, malloc failed while writing.*/ + if(packet==NULL)return TH_EFAULT; + _op->packet=packet; + _op->bytes=oggpackB_bytes(_opb); + _op->b_o_s=b_o_s; + _op->e_o_s=0; + _op->granulepos=0; + _op->packetno=*_packet_state+3; + return ++(*_packet_state)+3; +} diff --git a/libs/libtheora-1.1/lib/encint.h b/libs/libtheora-1.1/lib/encint.h new file mode 100644 index 00000000..23fb520d --- /dev/null +++ b/libs/libtheora-1.1/lib/encint.h @@ -0,0 +1,490 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: encint.h 16753 2009-12-19 00:52:46Z tterribe $ + + ********************************************************************/ +#if !defined(_encint_H) +# define _encint_H (1) +# include "theora/theoraenc.h" +# include "internal.h" +# include "ocintrin.h" +# include "mathops.h" +# include "enquant.h" +# include "huffenc.h" +/*# define OC_COLLECT_METRICS*/ + + + +typedef oc_mv oc_mv2[2]; + +typedef struct oc_enc_opt_vtable oc_enc_opt_vtable; +typedef struct oc_mb_enc_info oc_mb_enc_info; +typedef struct oc_mode_scheme_chooser oc_mode_scheme_chooser; +typedef struct oc_iir_filter oc_iir_filter; +typedef struct oc_frame_metrics oc_frame_metrics; +typedef struct oc_rc_state oc_rc_state; +typedef struct th_enc_ctx oc_enc_ctx; +typedef struct oc_token_checkpoint oc_token_checkpoint; + + + +/*Constants for the packet-out state machine specific to the encoder.*/ + +/*Next packet to emit: Data packet, but none are ready yet.*/ +#define OC_PACKET_EMPTY (0) +/*Next packet to emit: Data packet, and one is ready.*/ +#define OC_PACKET_READY (1) + +/*All features enabled.*/ +#define OC_SP_LEVEL_SLOW (0) +/*Enable early skip.*/ +#define OC_SP_LEVEL_EARLY_SKIP (1) +/*Disable motion compensation.*/ +#define OC_SP_LEVEL_NOMC (2) +/*Maximum valid speed level.*/ +#define OC_SP_LEVEL_MAX (2) + + +/*The bits used for each of the MB mode codebooks.*/ +extern const unsigned char OC_MODE_BITS[2][OC_NMODES]; + +/*The bits used for each of the MV codebooks.*/ +extern const unsigned char OC_MV_BITS[2][64]; + +/*The minimum value that can be stored in a SB run for each codeword. + The last entry is the upper bound on the length of a single SB run.*/ +extern const ogg_uint16_t OC_SB_RUN_VAL_MIN[8]; +/*The bits used for each SB run codeword.*/ +extern const unsigned char OC_SB_RUN_CODE_NBITS[7]; + +/*The bits used for each block run length (starting with 1).*/ +extern const unsigned char OC_BLOCK_RUN_CODE_NBITS[30]; + + + +/*Encoder specific functions with accelerated variants.*/ +struct oc_enc_opt_vtable{ + unsigned (*frag_sad)(const unsigned char *_src, + const unsigned char *_ref,int _ystride); + unsigned (*frag_sad_thresh)(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); + unsigned (*frag_sad2_thresh)(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); + unsigned (*frag_satd_thresh)(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); + unsigned (*frag_satd2_thresh)(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); + unsigned (*frag_intra_satd)(const unsigned char *_src,int _ystride); + void (*frag_sub)(ogg_int16_t _diff[64],const unsigned char *_src, + const unsigned char *_ref,int _ystride); + void (*frag_sub_128)(ogg_int16_t _diff[64], + const unsigned char *_src,int _ystride); + void (*frag_copy2)(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride); + void (*frag_recon_intra)(unsigned char *_dst,int _ystride, + const ogg_int16_t _residue[64]); + void (*frag_recon_inter)(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]); + void (*fdct8x8)(ogg_int16_t _y[64],const ogg_int16_t _x[64]); +}; + + +void oc_enc_vtable_init(oc_enc_ctx *_enc); + + + +/*Encoder-specific macroblock information.*/ +struct oc_mb_enc_info{ + /*Neighboring macro blocks that have MVs available from the current frame.*/ + unsigned cneighbors[4]; + /*Neighboring macro blocks to use for MVs from the previous frame.*/ + unsigned pneighbors[4]; + /*The number of current-frame neighbors.*/ + unsigned char ncneighbors; + /*The number of previous-frame neighbors.*/ + unsigned char npneighbors; + /*Flags indicating which MB modes have been refined.*/ + unsigned char refined; + /*Motion vectors for a macro block for the current frame and the + previous two frames. + Each is a set of 2 vectors against OC_FRAME_GOLD and OC_FRAME_PREV, which + can be used to estimate constant velocity and constant acceleration + predictors. + Uninitialized MVs are (0,0).*/ + oc_mv2 analysis_mv[3]; + /*Current unrefined analysis MVs.*/ + oc_mv unref_mv[2]; + /*Unrefined block MVs.*/ + oc_mv block_mv[4]; + /*Refined block MVs.*/ + oc_mv ref_mv[4]; + /*Minimum motion estimation error from the analysis stage.*/ + ogg_uint16_t error[2]; + /*MB error for half-pel refinement for each frame type.*/ + unsigned satd[2]; + /*Block error for half-pel refinement.*/ + unsigned block_satd[4]; +}; + + + +/*State machine to estimate the opportunity cost of coding a MB mode.*/ +struct oc_mode_scheme_chooser{ + /*Pointers to the a list containing the index of each mode in the mode + alphabet used by each scheme. + The first entry points to the dynamic scheme0_ranks, while the remaining 7 + point to the constant entries stored in OC_MODE_SCHEMES.*/ + const unsigned char *mode_ranks[8]; + /*The ranks for each mode when coded with scheme 0. + These are optimized so that the more frequent modes have lower ranks.*/ + unsigned char scheme0_ranks[OC_NMODES]; + /*The list of modes, sorted in descending order of frequency, that + corresponds to the ranks above.*/ + unsigned char scheme0_list[OC_NMODES]; + /*The number of times each mode has been chosen so far.*/ + int mode_counts[OC_NMODES]; + /*The list of mode coding schemes, sorted in ascending order of bit cost.*/ + unsigned char scheme_list[8]; + /*The number of bits used by each mode coding scheme.*/ + ptrdiff_t scheme_bits[8]; +}; + + +void oc_mode_scheme_chooser_init(oc_mode_scheme_chooser *_chooser); + + + +/*A 2nd order low-pass Bessel follower. + We use this for rate control because it has fast reaction time, but is + critically damped.*/ +struct oc_iir_filter{ + ogg_int32_t c[2]; + ogg_int64_t g; + ogg_int32_t x[2]; + ogg_int32_t y[2]; +}; + + + +/*The 2-pass metrics associated with a single frame.*/ +struct oc_frame_metrics{ + /*The log base 2 of the scale factor for this frame in Q24 format.*/ + ogg_int32_t log_scale; + /*The number of application-requested duplicates of this frame.*/ + unsigned dup_count:31; + /*The frame type from pass 1.*/ + unsigned frame_type:1; +}; + + + +/*Rate control state information.*/ +struct oc_rc_state{ + /*The target average bits per frame.*/ + ogg_int64_t bits_per_frame; + /*The current buffer fullness (bits available to be used).*/ + ogg_int64_t fullness; + /*The target buffer fullness. + This is where we'd like to be by the last keyframe the appears in the next + buf_delay frames.*/ + ogg_int64_t target; + /*The maximum buffer fullness (total size of the buffer).*/ + ogg_int64_t max; + /*The log of the number of pixels in a frame in Q57 format.*/ + ogg_int64_t log_npixels; + /*The exponent used in the rate model in Q8 format.*/ + unsigned exp[2]; + /*The number of frames to distribute the buffer usage over.*/ + int buf_delay; + /*The total drop count from the previous frame. + This includes duplicates explicitly requested via the + TH_ENCCTL_SET_DUP_COUNT API as well as frames we chose to drop ourselves.*/ + ogg_uint32_t prev_drop_count; + /*The log of an estimated scale factor used to obtain the real framerate, for + VFR sources or, e.g., 12 fps content doubled to 24 fps, etc.*/ + ogg_int64_t log_drop_scale; + /*The log of estimated scale factor for the rate model in Q57 format.*/ + ogg_int64_t log_scale[2]; + /*The log of the target quantizer level in Q57 format.*/ + ogg_int64_t log_qtarget; + /*Will we drop frames to meet bitrate target?*/ + unsigned char drop_frames; + /*Do we respect the maximum buffer fullness?*/ + unsigned char cap_overflow; + /*Can the reservoir go negative?*/ + unsigned char cap_underflow; + /*Second-order lowpass filters to track scale and VFR.*/ + oc_iir_filter scalefilter[2]; + int inter_count; + int inter_delay; + int inter_delay_target; + oc_iir_filter vfrfilter; + /*Two-pass mode state. + 0 => 1-pass encoding. + 1 => 1st pass of 2-pass encoding. + 2 => 2nd pass of 2-pass encoding.*/ + int twopass; + /*Buffer for current frame metrics.*/ + unsigned char twopass_buffer[48]; + /*The number of bytes in the frame metrics buffer. + When 2-pass encoding is enabled, this is set to 0 after each frame is + submitted, and must be non-zero before the next frame will be accepted.*/ + int twopass_buffer_bytes; + int twopass_buffer_fill; + /*Whether or not to force the next frame to be a keyframe.*/ + unsigned char twopass_force_kf; + /*The metrics for the previous frame.*/ + oc_frame_metrics prev_metrics; + /*The metrics for the current frame.*/ + oc_frame_metrics cur_metrics; + /*The buffered metrics for future frames.*/ + oc_frame_metrics *frame_metrics; + int nframe_metrics; + int cframe_metrics; + /*The index of the current frame in the circular metric buffer.*/ + int frame_metrics_head; + /*The frame count of each type (keyframes, delta frames, and dup frames); + 32 bits limits us to 2.268 years at 60 fps.*/ + ogg_uint32_t frames_total[3]; + /*The number of frames of each type yet to be processed.*/ + ogg_uint32_t frames_left[3]; + /*The sum of the scale values for each frame type.*/ + ogg_int64_t scale_sum[2]; + /*The start of the window over which the current scale sums are taken.*/ + int scale_window0; + /*The end of the window over which the current scale sums are taken.*/ + int scale_window_end; + /*The frame count of each type in the current 2-pass window; this does not + include dup frames.*/ + int nframes[3]; + /*The total accumulated estimation bias.*/ + ogg_int64_t rate_bias; +}; + + +void oc_rc_state_init(oc_rc_state *_rc,oc_enc_ctx *_enc); +void oc_rc_state_clear(oc_rc_state *_rc); + +void oc_enc_rc_resize(oc_enc_ctx *_enc); +int oc_enc_select_qi(oc_enc_ctx *_enc,int _qti,int _clamp); +void oc_enc_calc_lambda(oc_enc_ctx *_enc,int _frame_type); +int oc_enc_update_rc_state(oc_enc_ctx *_enc, + long _bits,int _qti,int _qi,int _trial,int _droppable); +int oc_enc_rc_2pass_out(oc_enc_ctx *_enc,unsigned char **_buf); +int oc_enc_rc_2pass_in(oc_enc_ctx *_enc,unsigned char *_buf,size_t _bytes); + + + +/*The internal encoder state.*/ +struct th_enc_ctx{ + /*Shared encoder/decoder state.*/ + oc_theora_state state; + /*Buffer in which to assemble packets.*/ + oggpack_buffer opb; + /*Encoder-specific macroblock information.*/ + oc_mb_enc_info *mb_info; + /*DC coefficients after prediction.*/ + ogg_int16_t *frag_dc; + /*The list of coded macro blocks, in coded order.*/ + unsigned *coded_mbis; + /*The number of coded macro blocks.*/ + size_t ncoded_mbis; + /*Whether or not packets are ready to be emitted. + This takes on negative values while there are remaining header packets to + be emitted, reaches 0 when the codec is ready for input, and becomes + positive when a frame has been processed and data packets are ready.*/ + int packet_state; + /*The maximum distance between keyframes.*/ + ogg_uint32_t keyframe_frequency_force; + /*The number of duplicates to produce for the next frame.*/ + ogg_uint32_t dup_count; + /*The number of duplicates remaining to be emitted for the current frame.*/ + ogg_uint32_t nqueued_dups; + /*The number of duplicates emitted for the last frame.*/ + ogg_uint32_t prev_dup_count; + /*The current speed level.*/ + int sp_level; + /*Whether or not VP3 compatibility mode has been enabled.*/ + unsigned char vp3_compatible; + /*Whether or not any INTER frames have been coded.*/ + unsigned char coded_inter_frame; + /*Whether or not previous frame was dropped.*/ + unsigned char prevframe_dropped; + /*Stores most recently chosen Huffman tables for each frame type, DC and AC + coefficients, and luma and chroma tokens. + The actual Huffman table used for a given coefficient depends not only on + the choice made here, but also its index in the zig-zag ordering.*/ + unsigned char huff_idxs[2][2][2]; + /*Current count of bits used by each MV coding mode.*/ + size_t mv_bits[2]; + /*The mode scheme chooser for estimating mode coding costs.*/ + oc_mode_scheme_chooser chooser; + /*The number of vertical super blocks in an MCU.*/ + int mcu_nvsbs; + /*The SSD error for skipping each fragment in the current MCU.*/ + unsigned *mcu_skip_ssd; + /*The DCT token lists for each coefficient and each plane.*/ + unsigned char **dct_tokens[3]; + /*The extra bits associated with each DCT token.*/ + ogg_uint16_t **extra_bits[3]; + /*The number of DCT tokens for each coefficient for each plane.*/ + ptrdiff_t ndct_tokens[3][64]; + /*Pending EOB runs for each coefficient for each plane.*/ + ogg_uint16_t eob_run[3][64]; + /*The offset of the first DCT token for each coefficient for each plane.*/ + unsigned char dct_token_offs[3][64]; + /*The last DC coefficient for each plane and reference frame.*/ + int dc_pred_last[3][3]; +#if defined(OC_COLLECT_METRICS) + /*Fragment SATD statistics for MB mode estimation metrics.*/ + unsigned *frag_satd; + /*Fragment SSD statistics for MB mode estimation metrics.*/ + unsigned *frag_ssd; +#endif + /*The R-D optimization parameter.*/ + int lambda; + /*The huffman tables in use.*/ + th_huff_code huff_codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]; + /*The quantization parameters in use.*/ + th_quant_info qinfo; + oc_iquant *enquant_tables[64][3][2]; + oc_iquant_table enquant_table_data[64][3][2]; + /*An "average" quantizer for each quantizer type (INTRA or INTER) and qi + value. + This is used to paramterize the rate control decisions. + They are kept in the log domain to simplify later processing. + Keep in mind these are DCT domain quantizers, and so are scaled by an + additional factor of 4 from the pixel domain.*/ + ogg_int64_t log_qavg[2][64]; + /*The buffer state used to drive rate control.*/ + oc_rc_state rc; + /*Table for encoder acceleration functions.*/ + oc_enc_opt_vtable opt_vtable; +}; + + +void oc_enc_analyze_intra(oc_enc_ctx *_enc,int _recode); +int oc_enc_analyze_inter(oc_enc_ctx *_enc,int _allow_keyframe,int _recode); +#if defined(OC_COLLECT_METRICS) +void oc_enc_mode_metrics_collect(oc_enc_ctx *_enc); +void oc_enc_mode_metrics_dump(oc_enc_ctx *_enc); +#endif + + + +/*Perform fullpel motion search for a single MB against both reference frames.*/ +void oc_mcenc_search(oc_enc_ctx *_enc,int _mbi); +/*Refine a MB MV for one frame.*/ +void oc_mcenc_refine1mv(oc_enc_ctx *_enc,int _mbi,int _frame); +/*Refine the block MVs.*/ +void oc_mcenc_refine4mv(oc_enc_ctx *_enc,int _mbi); + + + +/*Used to rollback a tokenlog transaction when we retroactively decide to skip + a fragment. + A checkpoint is taken right before each token is added.*/ +struct oc_token_checkpoint{ + /*The color plane the token was added to.*/ + unsigned char pli; + /*The zig-zag index the token was added to.*/ + unsigned char zzi; + /*The outstanding EOB run count before the token was added.*/ + ogg_uint16_t eob_run; + /*The token count before the token was added.*/ + ptrdiff_t ndct_tokens; +}; + + + +void oc_enc_tokenize_start(oc_enc_ctx *_enc); +int oc_enc_tokenize_ac(oc_enc_ctx *_enc,int _pli,ptrdiff_t _fragi, + ogg_int16_t *_qdct,const ogg_uint16_t *_dequant,const ogg_int16_t *_dct, + int _zzi,oc_token_checkpoint **_stack,int _acmin); +void oc_enc_tokenlog_rollback(oc_enc_ctx *_enc, + const oc_token_checkpoint *_stack,int _n); +void oc_enc_pred_dc_frag_rows(oc_enc_ctx *_enc, + int _pli,int _fragy0,int _frag_yend); +void oc_enc_tokenize_dc_frag_list(oc_enc_ctx *_enc,int _pli, + const ptrdiff_t *_coded_fragis,ptrdiff_t _ncoded_fragis, + int _prev_ndct_tokens1,int _prev_eob_run1); +void oc_enc_tokenize_finish(oc_enc_ctx *_enc); + + + +/*Utility routine to encode one of the header packets.*/ +int oc_state_flushheader(oc_theora_state *_state,int *_packet_state, + oggpack_buffer *_opb,const th_quant_info *_qinfo, + const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS], + const char *_vendor,th_comment *_tc,ogg_packet *_op); + + + +/*Encoder-specific accelerated functions.*/ +void oc_enc_frag_sub(const oc_enc_ctx *_enc,ogg_int16_t _diff[64], + const unsigned char *_src,const unsigned char *_ref,int _ystride); +void oc_enc_frag_sub_128(const oc_enc_ctx *_enc,ogg_int16_t _diff[64], + const unsigned char *_src,int _ystride); +unsigned oc_enc_frag_sad(const oc_enc_ctx *_enc,const unsigned char *_src, + const unsigned char *_ref,int _ystride); +unsigned oc_enc_frag_sad_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_sad2_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref1, + const unsigned char *_ref2,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_satd_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_satd2_thresh(const oc_enc_ctx *_enc, + const unsigned char *_src,const unsigned char *_ref1, + const unsigned char *_ref2,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_intra_satd(const oc_enc_ctx *_enc, + const unsigned char *_src,int _ystride); +void oc_enc_frag_copy2(const oc_enc_ctx *_enc,unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride); +void oc_enc_frag_recon_intra(const oc_enc_ctx *_enc, + unsigned char *_dst,int _ystride,const ogg_int16_t _residue[64]); +void oc_enc_frag_recon_inter(const oc_enc_ctx *_enc,unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]); +void oc_enc_fdct8x8(const oc_enc_ctx *_enc,ogg_int16_t _y[64], + const ogg_int16_t _x[64]); + +/*Default pure-C implementations.*/ +void oc_enc_vtable_init_c(oc_enc_ctx *_enc); + +void oc_enc_frag_sub_c(ogg_int16_t _diff[64], + const unsigned char *_src,const unsigned char *_ref,int _ystride); +void oc_enc_frag_sub_128_c(ogg_int16_t _diff[64], + const unsigned char *_src,int _ystride); +void oc_enc_frag_copy2_c(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride); +unsigned oc_enc_frag_sad_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride); +unsigned oc_enc_frag_sad_thresh_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_sad2_thresh_c(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_satd_thresh_c(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_satd2_thresh_c(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_intra_satd_c(const unsigned char *_src,int _ystride); +void oc_enc_fdct8x8_c(ogg_int16_t _y[64],const ogg_int16_t _x[64]); + +#endif diff --git a/libs/libtheora-1.1/lib/encode.c b/libs/libtheora-1.1/lib/encode.c new file mode 100644 index 00000000..a2c3c04c --- /dev/null +++ b/libs/libtheora-1.1/lib/encode.c @@ -0,0 +1,1627 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: encode.c 16744 2009-11-30 07:57:27Z tterribe $ + + ********************************************************************/ +#include +#include +#include "encint.h" +#if defined(OC_X86_ASM) +# include "x86/x86enc.h" +#endif + + + +/*The default quantization parameters used by VP3.1.*/ +static const int OC_VP31_RANGE_SIZES[1]={63}; +static const th_quant_base OC_VP31_BASES_INTRA_Y[2]={ + { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 58, 68,109,103, 77, + 24, 35, 55, 64, 81,104,113, 92, + 49, 64, 78, 87,103,121,120,101, + 72, 92, 95, 98,112,100,103, 99 + }, + { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 58, 68,109,103, 77, + 24, 35, 55, 64, 81,104,113, 92, + 49, 64, 78, 87,103,121,120,101, + 72, 92, 95, 98,112,100,103, 99 + } +}; +static const th_quant_base OC_VP31_BASES_INTRA_C[2]={ + { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + }, + { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + } +}; +static const th_quant_base OC_VP31_BASES_INTER[2]={ + { + 16, 16, 16, 20, 24, 28, 32, 40, + 16, 16, 20, 24, 28, 32, 40, 48, + 16, 20, 24, 28, 32, 40, 48, 64, + 20, 24, 28, 32, 40, 48, 64, 64, + 24, 28, 32, 40, 48, 64, 64, 64, + 28, 32, 40, 48, 64, 64, 64, 96, + 32, 40, 48, 64, 64, 64, 96,128, + 40, 48, 64, 64, 64, 96,128,128 + }, + { + 16, 16, 16, 20, 24, 28, 32, 40, + 16, 16, 20, 24, 28, 32, 40, 48, + 16, 20, 24, 28, 32, 40, 48, 64, + 20, 24, 28, 32, 40, 48, 64, 64, + 24, 28, 32, 40, 48, 64, 64, 64, + 28, 32, 40, 48, 64, 64, 64, 96, + 32, 40, 48, 64, 64, 64, 96,128, + 40, 48, 64, 64, 64, 96,128,128 + } +}; + +const th_quant_info TH_VP31_QUANT_INFO={ + { + 220,200,190,180,170,170,160,160, + 150,150,140,140,130,130,120,120, + 110,110,100,100, 90, 90, 90, 80, + 80, 80, 70, 70, 70, 60, 60, 60, + 60, 50, 50, 50, 50, 40, 40, 40, + 40, 40, 30, 30, 30, 30, 30, 30, + 30, 20, 20, 20, 20, 20, 20, 20, + 20, 10, 10, 10, 10, 10, 10, 10 + }, + { + 500,450,400,370,340,310,285,265, + 245,225,210,195,185,180,170,160, + 150,145,135,130,125,115,110,107, + 100, 96, 93, 89, 85, 82, 75, 74, + 70, 68, 64, 60, 57, 56, 52, 50, + 49, 45, 44, 43, 40, 38, 37, 35, + 33, 32, 30, 29, 28, 25, 24, 22, + 21, 19, 18, 17, 15, 13, 12, 10 + }, + { + 30,25,20,20,15,15,14,14, + 13,13,12,12,11,11,10,10, + 9, 9, 8, 8, 7, 7, 7, 7, + 6, 6, 6, 6, 5, 5, 5, 5, + 4, 4, 4, 4, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + { + { + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTRA_Y}, + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTRA_C}, + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTRA_C} + }, + { + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTER}, + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTER}, + {1,OC_VP31_RANGE_SIZES,OC_VP31_BASES_INTER} + } + } +}; + +/*The current default quantization parameters.*/ +static const int OC_DEF_QRANGE_SIZES[3]={32,16,15}; +static const th_quant_base OC_DEF_BASES_INTRA_Y[4]={ + { + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + }, + { + 15, 12, 12, 15, 18, 20, 20, 21, + 13, 13, 14, 17, 18, 21, 21, 20, + 14, 14, 15, 18, 20, 21, 21, 21, + 14, 16, 17, 19, 20, 21, 21, 21, + 16, 17, 20, 21, 21, 21, 21, 21, + 18, 19, 20, 21, 21, 21, 21, 21, + 20, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21 + }, + { + 16, 12, 11, 16, 20, 25, 27, 28, + 13, 13, 14, 18, 21, 28, 28, 27, + 14, 13, 16, 20, 25, 28, 28, 28, + 14, 16, 19, 22, 27, 29, 29, 28, + 17, 19, 25, 28, 28, 30, 30, 29, + 20, 24, 27, 28, 29, 30, 30, 29, + 27, 28, 29, 29, 30, 30, 30, 30, + 29, 29, 29, 29, 30, 30, 30, 29 + }, + { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 58, 68,109,103, 77, + 24, 35, 55, 64, 81,104,113, 92, + 49, 64, 78, 87,103,121,120,101, + 72, 92, 95, 98,112,100,103, 99 + } +}; +static const th_quant_base OC_DEF_BASES_INTRA_C[4]={ + { + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19 + }, + { + 18, 18, 21, 25, 26, 26, 26, 26, + 18, 20, 22, 26, 26, 26, 26, 26, + 21, 22, 25, 26, 26, 26, 26, 26, + 25, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26 + }, + { + 17, 18, 22, 31, 36, 36, 36, 36, + 18, 20, 24, 34, 36, 36, 36, 36, + 22, 24, 33, 36, 36, 36, 36, 36, + 31, 34, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36 + }, + { + 17, 18, 24, 47, 99, 99, 99, 99, + 18, 21, 26, 66, 99, 99, 99, 99, + 24, 26, 56, 99, 99, 99, 99, 99, + 47, 66, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99 + } +}; +static const th_quant_base OC_DEF_BASES_INTER[4]={ + { + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21 + }, + { + 18, 18, 18, 21, 23, 24, 25, 27, + 18, 18, 21, 23, 24, 25, 27, 28, + 18, 21, 23, 24, 25, 27, 28, 29, + 21, 23, 24, 25, 27, 28, 29, 29, + 23, 24, 25, 27, 28, 29, 29, 29, + 24, 25, 27, 28, 29, 29, 29, 30, + 25, 27, 28, 29, 29, 29, 30, 30, + 27, 28, 29, 29, 29, 30, 30, 30 + }, + { + 17, 17, 17, 20, 23, 26, 28, 32, + 17, 17, 20, 23, 26, 28, 32, 34, + 17, 20, 23, 26, 28, 32, 34, 37, + 20, 23, 26, 28, 32, 34, 37, 37, + 23, 26, 28, 32, 34, 37, 37, 37, + 26, 28, 32, 34, 37, 37, 37, 41, + 28, 32, 34, 37, 37, 37, 41, 42, + 32, 34, 37, 37, 37, 41, 42, 42 + }, + { + 16, 16, 16, 20, 24, 28, 32, 40, + 16, 16, 20, 24, 28, 32, 40, 48, + 16, 20, 24, 28, 32, 40, 48, 64, + 20, 24, 28, 32, 40, 48, 64, 64, + 24, 28, 32, 40, 48, 64, 64, 64, + 28, 32, 40, 48, 64, 64, 64, 96, + 32, 40, 48, 64, 64, 64, 96,128, + 40, 48, 64, 64, 64, 96,128,128 + } +}; + +const th_quant_info TH_DEF_QUANT_INFO={ + { + 365,348,333,316,300,287,277,265, + 252,240,229,219,206,197,189,180, + 171,168,160,153,146,139,132,127, + 121,115,110,107,101, 97, 94, 89, + 85, 83, 78, 73, 72, 67, 66, 62, + 60, 59, 56, 53, 52, 48, 47, 43, + 42, 40, 36, 35, 34, 33, 31, 30, + 28, 25, 24, 22, 20, 17, 14, 10 + }, + { + 365,348,333,316,300,287,277,265, + 252,240,229,219,206,197,189,180, + 171,168,160,153,146,139,132,127, + 121,115,110,107,101, 97, 94, 89, + 85, 83, 78, 73, 72, 67, 66, 62, + 60, 59, 56, 53, 52, 48, 47, 43, + 42, 40, 36, 35, 34, 33, 31, 30, + 28, 25, 24, 22, 20, 17, 14, 10 + }, + { + 30,25,20,20,15,15,14,14, + 13,13,12,12,11,11,10,10, + 9, 9, 8, 8, 7, 7, 7, 7, + 6, 6, 6, 6, 5, 5, 5, 5, + 4, 4, 4, 4, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + }, + { + { + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTRA_Y}, + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTRA_C}, + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTRA_C} + }, + { + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTER}, + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTER}, + {3,OC_DEF_QRANGE_SIZES,OC_DEF_BASES_INTER} + } + } +}; + + + +/*The Huffman codes used for macro block modes.*/ + +const unsigned char OC_MODE_BITS[2][OC_NMODES]={ + /*Codebook 0: a maximally skewed prefix code.*/ + {1,2,3,4,5,6,7,7}, + /*Codebook 1: a fixed-length code.*/ + {3,3,3,3,3,3,3,3} +}; + +static const unsigned char OC_MODE_CODES[2][OC_NMODES]={ + /*Codebook 0: a maximally skewed prefix code.*/ + {0x00,0x02,0x06,0x0E,0x1E,0x3E,0x7E,0x7F}, + /*Codebook 1: a fixed-length code.*/ + {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07} +}; + + +/*The Huffman codes used for motion vectors.*/ + +const unsigned char OC_MV_BITS[2][64]={ + /*Codebook 0: VLC code.*/ + { + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,7,7,7,7,7,7,7,7,6,6,6,6,4,4,3, + 3, + 3,4,4,6,6,6,6,7,7,7,7,7,7,7,7,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 + }, + /*Codebook 1: (5 bit magnitude, 1 bit sign). + This wastes a code word (0x01, negative zero), or a bit (0x00, positive + zero, requires only 5 bits to uniquely decode), but is hopefully not used + very often.*/ + { + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 + } +}; + +static const unsigned char OC_MV_CODES[2][64]={ + /*Codebook 0: VLC code.*/ + { + 0xFF,0xFD,0xFB,0xF9,0xF7,0xF5,0xF3, + 0xF1,0xEF,0xED,0xEB,0xE9,0xE7,0xE5,0xE3, + 0xE1,0x6F,0x6D,0x6B,0x69,0x67,0x65,0x63, + 0x61,0x2F,0x2D,0x2B,0x29,0x09,0x07,0x02, + 0x00, + 0x01,0x06,0x08,0x28,0x2A,0x2C,0x2E,0x60, + 0x62,0x64,0x66,0x68,0x6A,0x6C,0x6E,0xE0, + 0xE2,0xE4,0xE6,0xE8,0xEA,0xEC,0xEE,0xF0, + 0xF2,0xF4,0xF6,0xF8,0xFA,0xFC,0xFE + }, + /*Codebook 1: (5 bit magnitude, 1 bit sign).*/ + { + 0x3F,0x3D,0x3B,0x39,0x37,0x35,0x33, + 0x31,0x2F,0x2D,0x2B,0x29,0x27,0x25,0x23, + 0x21,0x1F,0x1D,0x1B,0x19,0x17,0x15,0x13, + 0x11,0x0F,0x0D,0x0B,0x09,0x07,0x05,0x03, + 0x00, + 0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10, + 0x12,0x14,0x16,0x18,0x1A,0x1C,0x1E,0x20, + 0x22,0x24,0x26,0x28,0x2A,0x2C,0x2E,0x30, + 0x32,0x34,0x36,0x38,0x3A,0x3C,0x3E + } +}; + + + +/*Super block run coding scheme: + Codeword Run Length + 0 1 + 10x 2-3 + 110x 4-5 + 1110xx 6-9 + 11110xxx 10-17 + 111110xxxx 18-33 + 111111xxxxxxxxxxxx 34-4129*/ +const ogg_uint16_t OC_SB_RUN_VAL_MIN[8]={1,2,4,6,10,18,34,4130}; +static const unsigned OC_SB_RUN_CODE_PREFIX[7]={ + 0,4,0xC,0x38,0xF0,0x3E0,0x3F000 +}; +const unsigned char OC_SB_RUN_CODE_NBITS[7]={1,3,4,6,8,10,18}; + + +/*Writes the bit pattern for the run length of a super block run to the given + oggpack_buffer. + _opb: The buffer to write to. + _run_count: The length of the run, which must be positive. + _flag: The current flag. + _done: Whether or not more flags are to be encoded.*/ +static void oc_sb_run_pack(oggpack_buffer *_opb,ptrdiff_t _run_count, + int _flag,int _done){ + int i; + if(_run_count>=4129){ + do{ + oggpackB_write(_opb,0x3FFFF,18); + _run_count-=4129; + if(_run_count>0)oggpackB_write(_opb,_flag,1); + else if(!_done)oggpackB_write(_opb,!_flag,1); + } + while(_run_count>=4129); + if(_run_count<=0)return; + } + for(i=0;_run_count>=OC_SB_RUN_VAL_MIN[i+1];i++); + oggpackB_write(_opb,OC_SB_RUN_CODE_PREFIX[i]+_run_count-OC_SB_RUN_VAL_MIN[i], + OC_SB_RUN_CODE_NBITS[i]); +} + + + +/*Block run coding scheme: + Codeword Run Length + 0x 1-2 + 10x 3-4 + 110x 5-6 + 1110xx 7-10 + 11110xx 11-14 + 11111xxxx 15-30*/ +const unsigned char OC_BLOCK_RUN_CODE_NBITS[30]={ + 2,2,3,3,4,4,6,6,6,6,7,7,7,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 +}; +static const ogg_uint16_t OC_BLOCK_RUN_CODE_PATTERN[30]={ + 0x000,0x001,0x004,0x005,0x00C,0x00D,0x038, + 0x039,0x03A,0x03B,0x078,0x079,0x07A,0x07B,0x1F0, + 0x1F1,0x1F2,0x1F3,0x1F4,0x1F5,0x1F6,0x1F7,0x1F8, + 0x1F9,0x1FA,0x1FB,0x1FC,0x1FD,0x1FE,0x1FF +}; + + +/*Writes the bit pattern for the run length of a block run to the given + oggpack_buffer. + _opb: The buffer to write to. + _run_count: The length of the run. + This must be positive, and no more than 30.*/ +static void oc_block_run_pack(oggpack_buffer *_opb,int _run_count){ + oggpackB_write(_opb,OC_BLOCK_RUN_CODE_PATTERN[_run_count-1], + OC_BLOCK_RUN_CODE_NBITS[_run_count-1]); +} + + + +static void oc_enc_frame_header_pack(oc_enc_ctx *_enc){ + /*Mark this as a data packet.*/ + oggpackB_write(&_enc->opb,0,1); + /*Output the frame type (key frame or delta frame).*/ + oggpackB_write(&_enc->opb,_enc->state.frame_type,1); + /*Write out the current qi list.*/ + oggpackB_write(&_enc->opb,_enc->state.qis[0],6); + if(_enc->state.nqis>1){ + oggpackB_write(&_enc->opb,1,1); + oggpackB_write(&_enc->opb,_enc->state.qis[1],6); + if(_enc->state.nqis>2){ + oggpackB_write(&_enc->opb,1,1); + oggpackB_write(&_enc->opb,_enc->state.qis[2],6); + } + else oggpackB_write(&_enc->opb,0,1); + } + else oggpackB_write(&_enc->opb,0,1); + if(_enc->state.frame_type==OC_INTRA_FRAME){ + /*Key frames have 3 unused configuration bits, holdovers from the VP3 days. + Most of the other unused bits in the VP3 headers were eliminated. + Monty kept these to leave us some wiggle room for future expansion, + though a single bit in all frames would have been far more useful.*/ + oggpackB_write(&_enc->opb,0,3); + } +} + +/*Writes the bit flags for whether or not each super block is partially coded + or not. + These flags are run-length encoded, with the flag value alternating between + each run. + Return: The number partially coded SBs.*/ +static unsigned oc_enc_partial_sb_flags_pack(oc_enc_ctx *_enc){ + const oc_sb_flags *sb_flags; + unsigned nsbs; + unsigned sbi; + unsigned npartial; + int flag; + sb_flags=_enc->state.sb_flags; + nsbs=_enc->state.nsbs; + flag=sb_flags[0].coded_partially; + oggpackB_write(&_enc->opb,flag,1); + sbi=npartial=0; + do{ + unsigned run_count; + for(run_count=0;sbiopb,run_count,flag,sbi>=nsbs); + flag=!flag; + } + while(sbistate.sb_flags; + nsbs=_enc->state.nsbs; + /*Skip partially coded super blocks; their flags have already been coded.*/ + for(sbi=0;sb_flags[sbi].coded_partially;sbi++); + flag=sb_flags[sbi].coded_fully; + oggpackB_write(&_enc->opb,flag,1); + do{ + unsigned run_count; + for(run_count=0;sbiopb,run_count,flag,sbi>=nsbs); + flag=!flag; + } + while(sbistate.nsbs)oc_enc_coded_sb_flags_pack(_enc); + sb_maps=(const oc_sb_map *)_enc->state.sb_maps; + sb_flags=_enc->state.sb_flags; + nsbs=_enc->state.nsbs; + frags=_enc->state.frags; + for(sbi=0;sbiopb,flag,1); + run_count=0; + nsbs=sbi=0; + for(pli=0;pli<3;pli++){ + nsbs+=_enc->state.fplanes[pli].nsbs; + for(;sbi=0){ + if(frags[fragi].coded!=flag){ + oc_block_run_pack(&_enc->opb,run_count); + flag=!flag; + run_count=1; + } + else run_count++; + } + } + } + } + } + } + /*Flush any trailing block coded run.*/ + if(run_count>0)oc_block_run_pack(&_enc->opb,run_count); + } +} + +static void oc_enc_mb_modes_pack(oc_enc_ctx *_enc){ + const unsigned char *mode_codes; + const unsigned char *mode_bits; + const unsigned char *mode_ranks; + unsigned *coded_mbis; + size_t ncoded_mbis; + const signed char *mb_modes; + unsigned mbii; + int scheme; + int mb_mode; + scheme=_enc->chooser.scheme_list[0]; + /*Encode the best scheme.*/ + oggpackB_write(&_enc->opb,scheme,3); + /*If the chosen scheme is scheme 0, send the mode frequency ordering.*/ + if(scheme==0){ + for(mb_mode=0;mb_modeopb,_enc->chooser.scheme0_ranks[mb_mode],3); + } + } + mode_ranks=_enc->chooser.mode_ranks[scheme]; + mode_bits=OC_MODE_BITS[scheme+1>>3]; + mode_codes=OC_MODE_CODES[scheme+1>>3]; + coded_mbis=_enc->coded_mbis; + ncoded_mbis=_enc->ncoded_mbis; + mb_modes=_enc->state.mb_modes; + for(mbii=0;mbiiopb,mode_codes[rank],mode_bits[rank]); + } +} + +static void oc_enc_mv_pack(oc_enc_ctx *_enc,int _mv_scheme,int _dx,int _dy){ + oggpackB_write(&_enc->opb, + OC_MV_CODES[_mv_scheme][_dx+31],OC_MV_BITS[_mv_scheme][_dx+31]); + oggpackB_write(&_enc->opb, + OC_MV_CODES[_mv_scheme][_dy+31],OC_MV_BITS[_mv_scheme][_dy+31]); +} + +static void oc_enc_mvs_pack(oc_enc_ctx *_enc){ + const unsigned *coded_mbis; + size_t ncoded_mbis; + const oc_mb_map *mb_maps; + const signed char *mb_modes; + const oc_fragment *frags; + const oc_mv *frag_mvs; + unsigned mbii; + int mv_scheme; + /*Choose the coding scheme.*/ + mv_scheme=_enc->mv_bits[1]<_enc->mv_bits[0]; + oggpackB_write(&_enc->opb,mv_scheme,1); + /*Encode the motion vectors. + Macro blocks are iterated in Hilbert scan order, but the MVs within the + macro block are coded in raster order.*/ + coded_mbis=_enc->coded_mbis; + ncoded_mbis=_enc->ncoded_mbis; + mb_modes=_enc->state.mb_modes; + mb_maps=(const oc_mb_map *)_enc->state.mb_maps; + frags=_enc->state.frags; + frag_mvs=(const oc_mv *)_enc->state.frag_mvs; + for(mbii=0;mbiistate.nqis<=1)return; + ncoded_fragis=_enc->state.ntotal_coded_fragis; + if(ncoded_fragis<=0)return; + coded_fragis=_enc->state.coded_fragis; + frags=_enc->state.frags; + flag=!!frags[coded_fragis[0]].qii; + oggpackB_write(&_enc->opb,flag,1); + nqi0=0; + for(fragii=0;fragiiopb,run_count,flag,fragii>=ncoded_fragis); + flag=!flag; + } + if(_enc->state.nqis<3||nqi0>=ncoded_fragis)return; + for(fragii=0;!frags[coded_fragis[fragii]].qii;fragii++); + flag=frags[coded_fragis[fragii]].qii-1; + oggpackB_write(&_enc->opb,flag,1); + while(fragiiopb,run_count,flag,fragii>=ncoded_fragis); + flag=!flag; + } +} + +/*Counts the tokens of each type used for the given range of coefficient + indices in zig-zag order. + _zzi_start: The first zig-zag index to include. + _zzi_end: The first zig-zag index to not include. + _token_counts_y: Returns the token counts for the Y' plane. + _token_counts_c: Returns the token counts for the Cb and Cr planes.*/ +static void oc_enc_count_tokens(oc_enc_ctx *_enc,int _zzi_start,int _zzi_end, + ptrdiff_t _token_counts_y[32],ptrdiff_t _token_counts_c[32]){ + const unsigned char *dct_tokens; + ptrdiff_t ndct_tokens; + int pli; + int zzi; + ptrdiff_t ti; + memset(_token_counts_y,0,32*sizeof(*_token_counts_y)); + memset(_token_counts_c,0,32*sizeof(*_token_counts_c)); + for(zzi=_zzi_start;zzi<_zzi_end;zzi++){ + dct_tokens=_enc->dct_tokens[0][zzi]; + ndct_tokens=_enc->ndct_tokens[0][zzi]; + for(ti=_enc->dct_token_offs[0][zzi];tidct_tokens[pli][zzi]; + ndct_tokens=_enc->ndct_tokens[pli][zzi]; + for(ti=_enc->dct_token_offs[pli][zzi];tihuff_codes[huffi+huff_offs][token].nbits; + } + } +} + +/*Returns the Huffman index using the fewest number of bits.*/ +static int oc_select_huff_idx(size_t _bit_counts[16]){ + int best_huffi; + int huffi; + best_huffi=0; + for(huffi=1;huffi<16;huffi++)if(_bit_counts[huffi]<_bit_counts[best_huffi]){ + best_huffi=huffi; + } + return best_huffi; +} + +static void oc_enc_huff_group_pack(oc_enc_ctx *_enc, + int _zzi_start,int _zzi_end,const int _huff_idxs[2]){ + int zzi; + for(zzi=_zzi_start;zzi<_zzi_end;zzi++){ + int pli; + for(pli=0;pli<3;pli++){ + const unsigned char *dct_tokens; + const ogg_uint16_t *extra_bits; + ptrdiff_t ndct_tokens; + const th_huff_code *huff_codes; + ptrdiff_t ti; + dct_tokens=_enc->dct_tokens[pli][zzi]; + extra_bits=_enc->extra_bits[pli][zzi]; + ndct_tokens=_enc->ndct_tokens[pli][zzi]; + huff_codes=_enc->huff_codes[_huff_idxs[pli+1>>1]]; + for(ti=_enc->dct_token_offs[pli][zzi];tiopb,huff_codes[token].pattern, + huff_codes[token].nbits); + neb=OC_DCT_TOKEN_EXTRA_BITS[token]; + if(neb)oggpackB_write(&_enc->opb,extra_bits[ti],neb); + } + } + } +} + +static void oc_enc_residual_tokens_pack(oc_enc_ctx *_enc){ + static const unsigned char OC_HUFF_GROUP_MIN[6]={0,1,6,15,28,64}; + static const unsigned char *OC_HUFF_GROUP_MAX=OC_HUFF_GROUP_MIN+1; + ptrdiff_t token_counts_y[32]; + ptrdiff_t token_counts_c[32]; + size_t bits_y[16]; + size_t bits_c[16]; + int huff_idxs[2]; + int frame_type; + int hgi; + frame_type=_enc->state.frame_type; + /*Choose which Huffman tables to use for the DC token list.*/ + oc_enc_count_tokens(_enc,0,1,token_counts_y,token_counts_c); + memset(bits_y,0,sizeof(bits_y)); + memset(bits_c,0,sizeof(bits_c)); + oc_enc_count_bits(_enc,0,token_counts_y,bits_y); + oc_enc_count_bits(_enc,0,token_counts_c,bits_c); + huff_idxs[0]=oc_select_huff_idx(bits_y); + huff_idxs[1]=oc_select_huff_idx(bits_c); + /*Write the DC token list with the chosen tables.*/ + oggpackB_write(&_enc->opb,huff_idxs[0],4); + oggpackB_write(&_enc->opb,huff_idxs[1],4); + _enc->huff_idxs[frame_type][0][0]=(unsigned char)huff_idxs[0]; + _enc->huff_idxs[frame_type][0][1]=(unsigned char)huff_idxs[1]; + oc_enc_huff_group_pack(_enc,0,1,huff_idxs); + /*Choose which Huffman tables to use for the AC token lists.*/ + memset(bits_y,0,sizeof(bits_y)); + memset(bits_c,0,sizeof(bits_c)); + for(hgi=1;hgi<5;hgi++){ + oc_enc_count_tokens(_enc,OC_HUFF_GROUP_MIN[hgi],OC_HUFF_GROUP_MAX[hgi], + token_counts_y,token_counts_c); + oc_enc_count_bits(_enc,hgi,token_counts_y,bits_y); + oc_enc_count_bits(_enc,hgi,token_counts_c,bits_c); + } + huff_idxs[0]=oc_select_huff_idx(bits_y); + huff_idxs[1]=oc_select_huff_idx(bits_c); + /*Write the AC token lists using the chosen tables.*/ + oggpackB_write(&_enc->opb,huff_idxs[0],4); + oggpackB_write(&_enc->opb,huff_idxs[1],4); + _enc->huff_idxs[frame_type][1][0]=(unsigned char)huff_idxs[0]; + _enc->huff_idxs[frame_type][1][1]=(unsigned char)huff_idxs[1]; + for(hgi=1;hgi<5;hgi++){ + huff_idxs[0]+=16; + huff_idxs[1]+=16; + oc_enc_huff_group_pack(_enc, + OC_HUFF_GROUP_MIN[hgi],OC_HUFF_GROUP_MAX[hgi],huff_idxs); + } +} + +static void oc_enc_frame_pack(oc_enc_ctx *_enc){ + oggpackB_reset(&_enc->opb); + /*Only proceed if we have some coded blocks. + If there are no coded blocks, we can drop this frame simply by emitting a + 0 byte packet.*/ + if(_enc->state.ntotal_coded_fragis>0){ + oc_enc_frame_header_pack(_enc); + if(_enc->state.frame_type==OC_INTER_FRAME){ + /*Coded block flags, MB modes, and MVs are only needed for delta frames.*/ + oc_enc_coded_flags_pack(_enc); + oc_enc_mb_modes_pack(_enc); + oc_enc_mvs_pack(_enc); + } + oc_enc_block_qis_pack(_enc); + oc_enc_tokenize_finish(_enc); + oc_enc_residual_tokens_pack(_enc); + } + /*Success: Mark the packet as ready to be flushed.*/ + _enc->packet_state=OC_PACKET_READY; +#if defined(OC_COLLECT_METRICS) + oc_enc_mode_metrics_collect(_enc); +#endif +} + + +void oc_enc_vtable_init_c(oc_enc_ctx *_enc){ + /*The implementations prefixed with oc_enc_ are encoder-specific. + The rest we re-use from the decoder.*/ + _enc->opt_vtable.frag_sad=oc_enc_frag_sad_c; + _enc->opt_vtable.frag_sad_thresh=oc_enc_frag_sad_thresh_c; + _enc->opt_vtable.frag_sad2_thresh=oc_enc_frag_sad2_thresh_c; + _enc->opt_vtable.frag_satd_thresh=oc_enc_frag_satd_thresh_c; + _enc->opt_vtable.frag_satd2_thresh=oc_enc_frag_satd2_thresh_c; + _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_c; + _enc->opt_vtable.frag_sub=oc_enc_frag_sub_c; + _enc->opt_vtable.frag_sub_128=oc_enc_frag_sub_128_c; + _enc->opt_vtable.frag_copy2=oc_enc_frag_copy2_c; + _enc->opt_vtable.frag_recon_intra=oc_frag_recon_intra_c; + _enc->opt_vtable.frag_recon_inter=oc_frag_recon_inter_c; + _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_c; +} + +/*Initialize the macro block neighbor lists for MC analysis. + This assumes that the entire mb_info memory region has been initialized with + zeros.*/ +static void oc_enc_mb_info_init(oc_enc_ctx *_enc){ + oc_mb_enc_info *embs; + const signed char *mb_modes; + unsigned nhsbs; + unsigned nvsbs; + unsigned nhmbs; + unsigned nvmbs; + unsigned sby; + mb_modes=_enc->state.mb_modes; + embs=_enc->mb_info; + nhsbs=_enc->state.fplanes[0].nhsbs; + nvsbs=_enc->state.fplanes[0].nvsbs; + nhmbs=_enc->state.nhmbs; + nvmbs=_enc->state.nvmbs; + for(sby=0;sby>1); + mby=2*sby+(quadi+1>>1&1); + /*Fill in the neighbors with current motion vectors available.*/ + for(ni=0;ni=nhmbs||nmby<0||nmby>=nvmbs)continue; + nmbi=(nmby&~1)*nhmbs+((nmbx&~1)<<1)+OC_MB_MAP[nmby&1][nmbx&1]; + if(mb_modes[nmbi]==OC_MODE_INVALID)continue; + embs[mbi].cneighbors[embs[mbi].ncneighbors++]=nmbi; + } + /*Fill in the neighbors with previous motion vectors available.*/ + for(ni=0;ni<4;ni++){ + nmbx=mbx+PDX[ni]; + nmby=mby+PDY[ni]; + if(nmbx<0||nmbx>=nhmbs||nmby<0||nmby>=nvmbs)continue; + nmbi=(nmby&~1)*nhmbs+((nmbx&~1)<<1)+OC_MB_MAP[nmby&1][nmbx&1]; + if(mb_modes[nmbi]==OC_MODE_INVALID)continue; + embs[mbi].pneighbors[embs[mbi].npneighbors++]=nmbi; + } + } + } + } +} + +static int oc_enc_set_huffman_codes(oc_enc_ctx *_enc, + const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){ + int ret; + if(_enc==NULL)return TH_EFAULT; + if(_enc->packet_state>OC_PACKET_SETUP_HDR)return TH_EINVAL; + if(_codes==NULL)_codes=TH_VP31_HUFF_CODES; + /*Validate the codes.*/ + oggpackB_reset(&_enc->opb); + ret=oc_huff_codes_pack(&_enc->opb,_codes); + if(ret<0)return ret; + memcpy(_enc->huff_codes,_codes,sizeof(_enc->huff_codes)); + return 0; +} + +/*Sets the quantization parameters to use. + This may only be called before the setup header is written. + If it is called multiple times, only the last call has any effect. + _qinfo: The quantization parameters. + These are described in more detail in theoraenc.h. + This can be NULL, in which case the default quantization parameters + will be used.*/ +static int oc_enc_set_quant_params(oc_enc_ctx *_enc, + const th_quant_info *_qinfo){ + int qi; + int pli; + int qti; + if(_enc==NULL)return TH_EFAULT; + if(_enc->packet_state>OC_PACKET_SETUP_HDR)return TH_EINVAL; + if(_qinfo==NULL)_qinfo=&TH_DEF_QUANT_INFO; + /*TODO: Analyze for packing purposes instead of just doing a shallow copy.*/ + memcpy(&_enc->qinfo,_qinfo,sizeof(_enc->qinfo)); + for(qi=0;qi<64;qi++)for(pli=0;pli<3;pli++)for(qti=0;qti<2;qti++){ + _enc->state.dequant_tables[qi][pli][qti]= + _enc->state.dequant_table_data[qi][pli][qti]; + _enc->enquant_tables[qi][pli][qti]=_enc->enquant_table_data[qi][pli][qti]; + } + oc_enquant_tables_init(_enc->state.dequant_tables, + _enc->enquant_tables,_qinfo); + memcpy(_enc->state.loop_filter_limits,_qinfo->loop_filter_limits, + sizeof(_enc->state.loop_filter_limits)); + oc_enquant_qavg_init(_enc->log_qavg,_enc->state.dequant_tables, + _enc->state.info.pixel_fmt); + return 0; +} + +static void oc_enc_clear(oc_enc_ctx *_enc); + +static int oc_enc_init(oc_enc_ctx *_enc,const th_info *_info){ + th_info info; + size_t mcu_nmbs; + ptrdiff_t mcu_nfrags; + int hdec; + int vdec; + int ret; + int pli; + /*Clean up the requested settings.*/ + memcpy(&info,_info,sizeof(info)); + info.version_major=TH_VERSION_MAJOR; + info.version_minor=TH_VERSION_MINOR; + info.version_subminor=TH_VERSION_SUB; + if(info.quality>63)info.quality=63; + if(info.quality<0)info.quality=32; + if(info.target_bitrate<0)info.target_bitrate=0; + /*Initialize the shared encoder/decoder state.*/ + ret=oc_state_init(&_enc->state,&info,4); + if(ret<0)return ret; + _enc->mb_info=_ogg_calloc(_enc->state.nmbs,sizeof(*_enc->mb_info)); + _enc->frag_dc=_ogg_calloc(_enc->state.nfrags,sizeof(*_enc->frag_dc)); + _enc->coded_mbis= + (unsigned *)_ogg_malloc(_enc->state.nmbs*sizeof(*_enc->coded_mbis)); + hdec=!(_enc->state.info.pixel_fmt&1); + vdec=!(_enc->state.info.pixel_fmt&2); + /*If chroma is sub-sampled in the vertical direction, we have to encode two + super block rows of Y' for each super block row of Cb and Cr.*/ + _enc->mcu_nvsbs=1<mcu_nvsbs*_enc->state.fplanes[0].nhsbs*(size_t)4; + mcu_nfrags=4*mcu_nmbs+(8*mcu_nmbs>>hdec+vdec); + _enc->mcu_skip_ssd=(unsigned *)_ogg_malloc( + mcu_nfrags*sizeof(*_enc->mcu_skip_ssd)); + for(pli=0;pli<3;pli++){ + _enc->dct_tokens[pli]=(unsigned char **)oc_malloc_2d(64, + _enc->state.fplanes[pli].nfrags,sizeof(**_enc->dct_tokens)); + _enc->extra_bits[pli]=(ogg_uint16_t **)oc_malloc_2d(64, + _enc->state.fplanes[pli].nfrags,sizeof(**_enc->extra_bits)); + } +#if defined(OC_COLLECT_METRICS) + _enc->frag_satd=_ogg_calloc(_enc->state.nfrags,sizeof(*_enc->frag_satd)); + _enc->frag_ssd=_ogg_calloc(_enc->state.nfrags,sizeof(*_enc->frag_ssd)); +#endif +#if defined(OC_X86_ASM) + oc_enc_vtable_init_x86(_enc); +#else + oc_enc_vtable_init_c(_enc); +#endif + _enc->keyframe_frequency_force=1<<_enc->state.info.keyframe_granule_shift; + _enc->state.qis[0]=_enc->state.info.quality; + _enc->state.nqis=1; + oc_rc_state_init(&_enc->rc,_enc); + oggpackB_writeinit(&_enc->opb); + if(_enc->mb_info==NULL||_enc->frag_dc==NULL||_enc->coded_mbis==NULL|| + _enc->mcu_skip_ssd==NULL||_enc->dct_tokens[0]==NULL|| + _enc->dct_tokens[1]==NULL||_enc->dct_tokens[2]==NULL|| + _enc->extra_bits[0]==NULL||_enc->extra_bits[1]==NULL|| + _enc->extra_bits[2]==NULL +#if defined(OC_COLLECT_METRICS) + ||_enc->frag_satd==NULL||_enc->frag_ssd==NULL +#endif + ){ + oc_enc_clear(_enc); + return TH_EFAULT; + } + oc_mode_scheme_chooser_init(&_enc->chooser); + oc_enc_mb_info_init(_enc); + memset(_enc->huff_idxs,0,sizeof(_enc->huff_idxs)); + /*Reset the packet-out state machine.*/ + _enc->packet_state=OC_PACKET_INFO_HDR; + _enc->dup_count=0; + _enc->nqueued_dups=0; + _enc->prev_dup_count=0; + /*Enable speed optimizations up through early skip by default.*/ + _enc->sp_level=OC_SP_LEVEL_EARLY_SKIP; + /*Disable VP3 compatibility by default.*/ + _enc->vp3_compatible=0; + /*No INTER frames coded yet.*/ + _enc->coded_inter_frame=0; + memcpy(_enc->huff_codes,TH_VP31_HUFF_CODES,sizeof(_enc->huff_codes)); + oc_enc_set_quant_params(_enc,NULL); + return 0; +} + +static void oc_enc_clear(oc_enc_ctx *_enc){ + int pli; + oc_rc_state_clear(&_enc->rc); +#if defined(OC_COLLECT_METRICS) + oc_enc_mode_metrics_dump(_enc); +#endif + oggpackB_writeclear(&_enc->opb); +#if defined(OC_COLLECT_METRICS) + _ogg_free(_enc->frag_ssd); + _ogg_free(_enc->frag_satd); +#endif + for(pli=3;pli-->0;){ + oc_free_2d(_enc->extra_bits[pli]); + oc_free_2d(_enc->dct_tokens[pli]); + } + _ogg_free(_enc->mcu_skip_ssd); + _ogg_free(_enc->coded_mbis); + _ogg_free(_enc->frag_dc); + _ogg_free(_enc->mb_info); + oc_state_clear(&_enc->state); +} + +static void oc_enc_drop_frame(th_enc_ctx *_enc){ + /*Use the previous frame's reconstruction.*/ + _enc->state.ref_frame_idx[OC_FRAME_SELF]= + _enc->state.ref_frame_idx[OC_FRAME_PREV]; + /*Flag motion vector analysis about the frame drop.*/ + _enc->prevframe_dropped=1; + /*Zero the packet.*/ + oggpackB_reset(&_enc->opb); +} + +static void oc_enc_compress_keyframe(oc_enc_ctx *_enc,int _recode){ + if(_enc->state.info.target_bitrate>0){ + _enc->state.qis[0]=oc_enc_select_qi(_enc,OC_INTRA_FRAME, + _enc->state.curframe_num>0); + _enc->state.nqis=1; + } + oc_enc_calc_lambda(_enc,OC_INTRA_FRAME); + oc_enc_analyze_intra(_enc,_recode); + oc_enc_frame_pack(_enc); + /*On the first frame, the previous call was an initial dry-run to prime + feed-forward statistics.*/ + if(!_recode&&_enc->state.curframe_num==0){ + if(_enc->state.info.target_bitrate>0){ + oc_enc_update_rc_state(_enc,oggpackB_bytes(&_enc->opb)<<3, + OC_INTRA_FRAME,_enc->state.qis[0],1,0); + } + oc_enc_compress_keyframe(_enc,1); + } +} + +static void oc_enc_compress_frame(oc_enc_ctx *_enc,int _recode){ + if(_enc->state.info.target_bitrate>0){ + _enc->state.qis[0]=oc_enc_select_qi(_enc,OC_INTER_FRAME,1); + _enc->state.nqis=1; + } + oc_enc_calc_lambda(_enc,OC_INTER_FRAME); + if(oc_enc_analyze_inter(_enc,_enc->rc.twopass!=2,_recode)){ + /*Mode analysis thinks this should have been a keyframe; start over.*/ + oc_enc_compress_keyframe(_enc,1); + } + else{ + oc_enc_frame_pack(_enc); + if(!_enc->coded_inter_frame){ + /*On the first INTER frame, the previous call was an initial dry-run to + prime feed-forward statistics.*/ + _enc->coded_inter_frame=1; + if(_enc->state.info.target_bitrate>0){ + /*Rate control also needs to prime.*/ + oc_enc_update_rc_state(_enc,oggpackB_bytes(&_enc->opb)<<3, + OC_INTER_FRAME,_enc->state.qis[0],1,0); + } + oc_enc_compress_frame(_enc,1); + } + } +} + +/*Set the granule position for the next packet to output based on the current + internal state.*/ +static void oc_enc_set_granpos(oc_enc_ctx *_enc){ + unsigned dup_offs; + /*Add an offset for the number of duplicate frames we've emitted so far.*/ + dup_offs=_enc->prev_dup_count-_enc->nqueued_dups; + /*If the current frame was a keyframe, use it for the high part.*/ + if(_enc->state.frame_type==OC_INTRA_FRAME){ + _enc->state.granpos=(_enc->state.curframe_num+_enc->state.granpos_bias<< + _enc->state.info.keyframe_granule_shift)+dup_offs; + } + /*Otherwise use the last keyframe in the high part and put the current frame + in the low part.*/ + else{ + _enc->state.granpos= + (_enc->state.keyframe_num+_enc->state.granpos_bias<< + _enc->state.info.keyframe_granule_shift) + +_enc->state.curframe_num-_enc->state.keyframe_num+dup_offs; + } +} + + +th_enc_ctx *th_encode_alloc(const th_info *_info){ + oc_enc_ctx *enc; + if(_info==NULL)return NULL; + enc=_ogg_malloc(sizeof(*enc)); + if(enc==NULL||oc_enc_init(enc,_info)<0){ + _ogg_free(enc); + return NULL; + } + return enc; +} + +void th_encode_free(th_enc_ctx *_enc){ + if(_enc!=NULL){ + oc_enc_clear(_enc); + _ogg_free(_enc); + } +} + +int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,size_t _buf_sz){ + switch(_req){ + case TH_ENCCTL_SET_HUFFMAN_CODES:{ + if(_buf==NULL&&_buf_sz!=0|| + _buf!=NULL&&_buf_sz!=sizeof(th_huff_table)*TH_NHUFFMAN_TABLES){ + return TH_EINVAL; + } + return oc_enc_set_huffman_codes(_enc,(const th_huff_table *)_buf); + }break; + case TH_ENCCTL_SET_QUANT_PARAMS:{ + if(_buf==NULL&&_buf_sz!=0|| + _buf!=NULL&&_buf_sz!=sizeof(th_quant_info)){ + return TH_EINVAL; + } + return oc_enc_set_quant_params(_enc,(th_quant_info *)_buf); + }break; + case TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE:{ + ogg_uint32_t keyframe_frequency_force; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(keyframe_frequency_force))return TH_EINVAL; + keyframe_frequency_force=*(ogg_uint32_t *)_buf; + if(keyframe_frequency_force<=0)keyframe_frequency_force=1; + if(_enc->packet_state==OC_PACKET_INFO_HDR){ + /*It's still early enough to enlarge keyframe_granule_shift.*/ + _enc->state.info.keyframe_granule_shift=OC_CLAMPI( + _enc->state.info.keyframe_granule_shift, + OC_ILOG_32(keyframe_frequency_force-1),31); + } + _enc->keyframe_frequency_force=OC_MINI(keyframe_frequency_force, + (ogg_uint32_t)1U<<_enc->state.info.keyframe_granule_shift); + *(ogg_uint32_t *)_buf=_enc->keyframe_frequency_force; + return 0; + }break; + case TH_ENCCTL_SET_VP3_COMPATIBLE:{ + int vp3_compatible; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(vp3_compatible))return TH_EINVAL; + vp3_compatible=*(int *)_buf; + _enc->vp3_compatible=vp3_compatible; + if(oc_enc_set_huffman_codes(_enc,TH_VP31_HUFF_CODES)<0)vp3_compatible=0; + if(oc_enc_set_quant_params(_enc,&TH_VP31_QUANT_INFO)<0)vp3_compatible=0; + if(_enc->state.info.pixel_fmt!=TH_PF_420|| + _enc->state.info.pic_width<_enc->state.info.frame_width|| + _enc->state.info.pic_height<_enc->state.info.frame_height|| + /*If we have more than 4095 super blocks, VP3's RLE coding might + overflow. + We could overcome this by ensuring we flip the coded/not-coded flags on + at least one super block in the frame, but we pick the simple solution + of just telling the user the stream will be incompatible instead. + It's unlikely the old VP3 codec would be able to decode streams at this + resolution in real time in the first place.*/ + _enc->state.nsbs>4095){ + vp3_compatible=0; + } + *(int *)_buf=vp3_compatible; + return 0; + }break; + case TH_ENCCTL_GET_SPLEVEL_MAX:{ + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + *(int *)_buf=OC_SP_LEVEL_MAX; + return 0; + }break; + case TH_ENCCTL_SET_SPLEVEL:{ + int speed; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(speed))return TH_EINVAL; + speed=*(int *)_buf; + if(speed<0||speed>OC_SP_LEVEL_MAX)return TH_EINVAL; + _enc->sp_level=speed; + return 0; + }break; + case TH_ENCCTL_GET_SPLEVEL:{ + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(int))return TH_EINVAL; + *(int *)_buf=_enc->sp_level; + return 0; + } + case TH_ENCCTL_SET_DUP_COUNT:{ + int dup_count; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(dup_count))return TH_EINVAL; + dup_count=*(int *)_buf; + if(dup_count>=_enc->keyframe_frequency_force)return TH_EINVAL; + _enc->dup_count=OC_MAXI(dup_count,0); + return 0; + }break; + case TH_ENCCTL_SET_QUALITY:{ + int qi; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_enc->state.info.target_bitrate>0)return TH_EINVAL; + qi=*(int *)_buf; + if(qi<0||qi>63)return TH_EINVAL; + _enc->state.info.quality=qi; + _enc->state.qis[0]=(unsigned char)qi; + _enc->state.nqis=1; + return 0; + }break; + case TH_ENCCTL_SET_BITRATE:{ + long bitrate; + int reset; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + bitrate=*(long *)_buf; + if(bitrate<=0)return TH_EINVAL; + reset=_enc->state.info.target_bitrate<=0; + _enc->state.info.target_bitrate=bitrate>INT_MAX?INT_MAX:bitrate; + if(reset)oc_rc_state_init(&_enc->rc,_enc); + else oc_enc_rc_resize(_enc); + return 0; + }break; + case TH_ENCCTL_SET_RATE_FLAGS:{ + int set; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(set))return TH_EINVAL; + if(_enc->state.info.target_bitrate<=0)return TH_EINVAL; + set=*(int *)_buf; + _enc->rc.drop_frames=set&TH_RATECTL_DROP_FRAMES; + _enc->rc.cap_overflow=set&TH_RATECTL_CAP_OVERFLOW; + _enc->rc.cap_underflow=set&TH_RATECTL_CAP_UNDERFLOW; + return 0; + }break; + case TH_ENCCTL_SET_RATE_BUFFER:{ + int set; + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_buf_sz!=sizeof(set))return TH_EINVAL; + if(_enc->state.info.target_bitrate<=0)return TH_EINVAL; + set=*(int *)_buf; + _enc->rc.buf_delay=set; + oc_enc_rc_resize(_enc); + *(int *)_buf=_enc->rc.buf_delay; + return 0; + }break; + case TH_ENCCTL_2PASS_OUT:{ + if(_enc==NULL||_buf==NULL)return TH_EFAULT; + if(_enc->state.info.target_bitrate<=0|| + _enc->state.curframe_num>=0&&_enc->rc.twopass!=1|| + _buf_sz!=sizeof(unsigned char *)){ + return TH_EINVAL; + } + return oc_enc_rc_2pass_out(_enc,(unsigned char **)_buf); + }break; + case TH_ENCCTL_2PASS_IN:{ + if(_enc==NULL)return TH_EFAULT; + if(_enc->state.info.target_bitrate<=0|| + _enc->state.curframe_num>=0&&_enc->rc.twopass!=2){ + return TH_EINVAL; + } + return oc_enc_rc_2pass_in(_enc,_buf,_buf_sz); + }break; + default:return TH_EIMPL; + } +} + +int th_encode_flushheader(th_enc_ctx *_enc,th_comment *_tc,ogg_packet *_op){ + if(_enc==NULL)return TH_EFAULT; + return oc_state_flushheader(&_enc->state,&_enc->packet_state,&_enc->opb, + &_enc->qinfo,(const th_huff_table *)_enc->huff_codes,th_version_string(), + _tc,_op); +} + +static void oc_img_plane_copy_pad(th_img_plane *_dst,th_img_plane *_src, + ogg_int32_t _pic_x,ogg_int32_t _pic_y, + ogg_int32_t _pic_width,ogg_int32_t _pic_height){ + unsigned char *dst; + int dstride; + ogg_uint32_t frame_width; + ogg_uint32_t frame_height; + ogg_uint32_t y; + frame_width=_dst->width; + frame_height=_dst->height; + /*If we have _no_ data, just encode a dull green.*/ + if(_pic_width==0||_pic_height==0){ + dst=_dst->data; + dstride=_dst->stride; + for(y=0;ystride; + sstride=_src->stride; + dst_data=_dst->data; + src_data=_src->data; + dst=dst_data+_pic_y*(ptrdiff_t)dstride+_pic_x; + src=src_data+_pic_y*(ptrdiff_t)sstride+_pic_x; + for(y=0;y<_pic_height;y++){ + memcpy(dst,src,_pic_width); + dst+=dstride; + src+=sstride; + } + /*Step 2: Perform a low-pass extension into the padding region.*/ + /*Left side.*/ + for(x=_pic_x;x-->0;){ + dst=dst_data+_pic_y*(ptrdiff_t)dstride+x; + for(y=0;y<_pic_height;y++){ + dst[0]=(dst[1]<<1)+(dst-(dstride&-(y>0)))[1] + +(dst+(dstride&-(y+1<_pic_height)))[1]+2>>2; + dst+=dstride; + } + } + /*Right side.*/ + for(x=_pic_x+_pic_width;x0)))[0] + +(dst+(dstride&-(y+1<_pic_height)))[0]+2>>2; + dst+=dstride; + } + } + /*Top.*/ + dst=dst_data+_pic_y*(ptrdiff_t)dstride; + for(y=_pic_y;y-->0;){ + for(x=0;x0)] + +dst[x+(x+1>2; + } + dst-=dstride; + } + /*Bottom.*/ + dst=dst_data+(_pic_y+_pic_height)*(ptrdiff_t)dstride; + for(y=_pic_y+_pic_height;y0)] + +(dst-dstride)[x+(x+1>2; + } + dst+=dstride; + } + } +} + +int th_encode_ycbcr_in(th_enc_ctx *_enc,th_ycbcr_buffer _img){ + th_ycbcr_buffer img; + int cframe_width; + int cframe_height; + int cpic_width; + int cpic_height; + int cpic_x; + int cpic_y; + int hdec; + int vdec; + int pli; + int refi; + int drop; + /*Step 1: validate parameters.*/ + if(_enc==NULL||_img==NULL)return TH_EFAULT; + if(_enc->packet_state==OC_PACKET_DONE)return TH_EINVAL; + if(_enc->rc.twopass&&_enc->rc.twopass_buffer_bytes==0)return TH_EINVAL; + hdec=!(_enc->state.info.pixel_fmt&1); + vdec=!(_enc->state.info.pixel_fmt&2); + cframe_width=_enc->state.info.frame_width>>hdec; + cframe_height=_enc->state.info.frame_height>>vdec; + cpic_x=_enc->state.info.pic_x>>hdec; + cpic_y=_enc->state.info.pic_y>>vdec; + cpic_width=(_enc->state.info.pic_x+_enc->state.info.pic_width+hdec>>hdec) + -cpic_x; + cpic_height=(_enc->state.info.pic_y+_enc->state.info.pic_height+vdec>>vdec) + -cpic_y; + /*Flip the input buffer upside down.*/ + oc_ycbcr_buffer_flip(img,_img); + if((ogg_uint32_t)img[0].width!=_enc->state.info.frame_width|| + (ogg_uint32_t)img[0].height!=_enc->state.info.frame_height|| + img[1].width!=cframe_width||img[2].width!=cframe_width|| + img[1].height!=cframe_height||img[2].height!=cframe_height){ + /*The buffer does not match the frame size. + Check to see if it matches the picture size.*/ + if((ogg_uint32_t)img[0].width!=_enc->state.info.pic_width|| + (ogg_uint32_t)img[0].height!=_enc->state.info.pic_height|| + img[1].width!=cpic_width||img[2].width!=cpic_width|| + img[1].height!=cpic_height||img[2].height!=cpic_height){ + /*It doesn't; we don't know how to handle it.*/ + return TH_EINVAL; + } + /*Adjust the pointers to address a full frame. + We still only use the picture region, however.*/ + img[0].data-=_enc->state.info.pic_y*(ptrdiff_t)img[0].stride + +_enc->state.info.pic_x; + img[1].data-=cpic_y*(ptrdiff_t)img[1].stride+cpic_x; + img[2].data-=cpic_y*(ptrdiff_t)img[2].stride+cpic_x; + } + /*Step 2: Copy the input to our internal buffer. + This lets us add padding, if necessary, so we don't have to worry about + dereferencing possibly invalid addresses, and allows us to use the same + strides and fragment offsets for both the input frame and the reference + frames.*/ + oc_img_plane_copy_pad(_enc->state.ref_frame_bufs[OC_FRAME_IO]+0,img+0, + _enc->state.info.pic_x,_enc->state.info.pic_y, + _enc->state.info.pic_width,_enc->state.info.pic_height); + for(pli=1;pli<3;pli++){ + oc_img_plane_copy_pad(_enc->state.ref_frame_bufs[OC_FRAME_IO]+pli,img+pli, + cpic_x,cpic_y,cpic_width,cpic_height); + } + /*Step 3: Update the buffer state.*/ + if(_enc->state.ref_frame_idx[OC_FRAME_SELF]>=0){ + _enc->state.ref_frame_idx[OC_FRAME_PREV]= + _enc->state.ref_frame_idx[OC_FRAME_SELF]; + if(_enc->state.frame_type==OC_INTRA_FRAME){ + /*The new frame becomes both the previous and gold reference frames.*/ + _enc->state.keyframe_num=_enc->state.curframe_num; + _enc->state.ref_frame_idx[OC_FRAME_GOLD]= + _enc->state.ref_frame_idx[OC_FRAME_SELF]; + } + } + /*Select a free buffer to use for the reconstructed version of this frame.*/ + for(refi=0;refi==_enc->state.ref_frame_idx[OC_FRAME_GOLD]|| + refi==_enc->state.ref_frame_idx[OC_FRAME_PREV];refi++); + _enc->state.ref_frame_idx[OC_FRAME_SELF]=refi; + _enc->state.curframe_num+=_enc->prev_dup_count+1; + /*Step 4: Compress the frame.*/ + /*Start with a keyframe, and don't allow the generation of invalid files that + overflow the keyframe_granule_shift.*/ + if(_enc->rc.twopass_force_kf||_enc->state.curframe_num==0|| + _enc->state.curframe_num-_enc->state.keyframe_num+_enc->dup_count>= + _enc->keyframe_frequency_force){ + oc_enc_compress_keyframe(_enc,0); + drop=0; + } + else{ + oc_enc_compress_frame(_enc,0); + drop=1; + } + oc_restore_fpu(&_enc->state); + /*drop currently indicates if the frame is droppable.*/ + if(_enc->state.info.target_bitrate>0){ + drop=oc_enc_update_rc_state(_enc,oggpackB_bytes(&_enc->opb)<<3, + _enc->state.frame_type,_enc->state.qis[0],0,drop); + } + else drop=0; + /*drop now indicates if the frame was dropped.*/ + if(drop)oc_enc_drop_frame(_enc); + else _enc->prevframe_dropped=0; + _enc->packet_state=OC_PACKET_READY; + _enc->prev_dup_count=_enc->nqueued_dups=_enc->dup_count; + _enc->dup_count=0; +#if defined(OC_DUMP_IMAGES) + oc_enc_set_granpos(_enc); + oc_state_dump_frame(&_enc->state,OC_FRAME_IO,"src"); + oc_state_dump_frame(&_enc->state,OC_FRAME_SELF,"rec"); +#endif + return 0; +} + +int th_encode_packetout(th_enc_ctx *_enc,int _last_p,ogg_packet *_op){ + if(_enc==NULL||_op==NULL)return TH_EFAULT; + if(_enc->packet_state==OC_PACKET_READY){ + _enc->packet_state=OC_PACKET_EMPTY; + if(_enc->rc.twopass!=1){ + unsigned char *packet; + packet=oggpackB_get_buffer(&_enc->opb); + /*If there's no packet, malloc failed while writing; it's lost forever.*/ + if(packet==NULL)return TH_EFAULT; + _op->packet=packet; + _op->bytes=oggpackB_bytes(&_enc->opb); + } + /*For the first pass in 2-pass mode, don't emit any packet data.*/ + else{ + _op->packet=NULL; + _op->bytes=0; + } + } + else if(_enc->packet_state==OC_PACKET_EMPTY){ + if(_enc->nqueued_dups>0){ + _enc->nqueued_dups--; + _op->packet=NULL; + _op->bytes=0; + } + else{ + if(_last_p)_enc->packet_state=OC_PACKET_DONE; + return 0; + } + } + else return 0; + _last_p=_last_p&&_enc->nqueued_dups<=0; + _op->b_o_s=0; + _op->e_o_s=_last_p; + oc_enc_set_granpos(_enc); + _op->packetno=th_granule_frame(_enc,_enc->state.granpos)+3; + _op->granulepos=_enc->state.granpos; + if(_last_p)_enc->packet_state=OC_PACKET_DONE; + return 1+_enc->nqueued_dups; +} diff --git a/libs/libtheora-1.1/lib/encoder_disabled.c b/libs/libtheora-1.1/lib/encoder_disabled.c new file mode 100644 index 00000000..6092edaf --- /dev/null +++ b/libs/libtheora-1.1/lib/encoder_disabled.c @@ -0,0 +1,67 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: encoder_disabled.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include "apiwrapper.h" +#include "encint.h" + +th_enc_ctx *th_encode_alloc(const th_info *_info){ + return NULL; +} + +void th_encode_free(th_enc_ctx *_enc){} + + +int th_encode_ctl(th_enc_ctx *_enc,int _req,void *_buf,size_t _buf_sz){ + return OC_DISABLED; +} + +int th_encode_flushheader(th_enc_ctx *_enc,th_comment *_tc,ogg_packet *_op){ + return OC_DISABLED; +} + +int th_encode_ycbcr_in(th_enc_ctx *_enc,th_ycbcr_buffer _img){ + return OC_DISABLED; +} + +int th_encode_packetout(th_enc_ctx *_enc,int _last_p,ogg_packet *_op){ + return OC_DISABLED; +} + + + +int theora_encode_init(theora_state *_te,theora_info *_ci){ + return OC_DISABLED; +} + +int theora_encode_YUVin(theora_state *_te,yuv_buffer *_yuv){ + return OC_DISABLED; +} + +int theora_encode_packetout(theora_state *_te,int _last_p,ogg_packet *_op){ + return OC_DISABLED; +} + +int theora_encode_header(theora_state *_te,ogg_packet *_op){ + return OC_DISABLED; +} + +int theora_encode_comment(theora_comment *_tc,ogg_packet *_op){ + return OC_DISABLED; +} + +int theora_encode_tables(theora_state *_te,ogg_packet *_op){ + return OC_DISABLED; +} diff --git a/libs/libtheora-1.1/lib/enquant.c b/libs/libtheora-1.1/lib/enquant.c new file mode 100644 index 00000000..0759c92b --- /dev/null +++ b/libs/libtheora-1.1/lib/enquant.c @@ -0,0 +1,274 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: enquant.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include +#include "encint.h" + + + +void oc_quant_params_pack(oggpack_buffer *_opb,const th_quant_info *_qinfo){ + const th_quant_ranges *qranges; + const th_quant_base *base_mats[2*3*64]; + int indices[2][3][64]; + int nbase_mats; + int nbits; + int ci; + int qi; + int qri; + int qti; + int pli; + int qtj; + int plj; + int bmi; + int i; + i=_qinfo->loop_filter_limits[0]; + for(qi=1;qi<64;qi++)i=OC_MAXI(i,_qinfo->loop_filter_limits[qi]); + nbits=OC_ILOG_32(i); + oggpackB_write(_opb,nbits,3); + for(qi=0;qi<64;qi++){ + oggpackB_write(_opb,_qinfo->loop_filter_limits[qi],nbits); + } + /*580 bits for VP3.*/ + i=1; + for(qi=0;qi<64;qi++)i=OC_MAXI(_qinfo->ac_scale[qi],i); + nbits=OC_ILOGNZ_32(i); + oggpackB_write(_opb,nbits-1,4); + for(qi=0;qi<64;qi++)oggpackB_write(_opb,_qinfo->ac_scale[qi],nbits); + /*516 bits for VP3.*/ + i=1; + for(qi=0;qi<64;qi++)i=OC_MAXI(_qinfo->dc_scale[qi],i); + nbits=OC_ILOGNZ_32(i); + oggpackB_write(_opb,nbits-1,4); + for(qi=0;qi<64;qi++)oggpackB_write(_opb,_qinfo->dc_scale[qi],nbits); + /*Consolidate any duplicate base matrices.*/ + nbase_mats=0; + for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){ + qranges=_qinfo->qi_ranges[qti]+pli; + for(qri=0;qri<=qranges->nranges;qri++){ + for(bmi=0;;bmi++){ + if(bmi>=nbase_mats){ + base_mats[bmi]=qranges->base_matrices+qri; + indices[qti][pli][qri]=nbase_mats++; + break; + } + else if(memcmp(base_mats[bmi][0],qranges->base_matrices[qri], + sizeof(base_mats[bmi][0]))==0){ + indices[qti][pli][qri]=bmi; + break; + } + } + } + } + /*Write out the list of unique base matrices. + 1545 bits for VP3 matrices.*/ + oggpackB_write(_opb,nbase_mats-1,9); + for(bmi=0;bmiqi_ranges[qti]+pli; + if(i>0){ + if(qti>0){ + if(qranges->nranges==_qinfo->qi_ranges[qti-1][pli].nranges&& + memcmp(qranges->sizes,_qinfo->qi_ranges[qti-1][pli].sizes, + qranges->nranges*sizeof(qranges->sizes[0]))==0&& + memcmp(indices[qti][pli],indices[qti-1][pli], + (qranges->nranges+1)*sizeof(indices[qti][pli][0]))==0){ + oggpackB_write(_opb,1,2); + continue; + } + } + qtj=(i-1)/3; + plj=(i-1)%3; + if(qranges->nranges==_qinfo->qi_ranges[qtj][plj].nranges&& + memcmp(qranges->sizes,_qinfo->qi_ranges[qtj][plj].sizes, + qranges->nranges*sizeof(qranges->sizes[0]))==0&& + memcmp(indices[qti][pli],indices[qtj][plj], + (qranges->nranges+1)*sizeof(indices[qti][pli][0]))==0){ + oggpackB_write(_opb,0,1+(qti>0)); + continue; + } + oggpackB_write(_opb,1,1); + } + oggpackB_write(_opb,indices[qti][pli][0],nbits); + for(qi=qri=0;qi<63;qri++){ + oggpackB_write(_opb,qranges->sizes[qri]-1,OC_ILOG_32(62-qi)); + qi+=qranges->sizes[qri]; + oggpackB_write(_opb,indices[qti][pli][qri+1],nbits); + } + } +} + +static void oc_iquant_init(oc_iquant *_this,ogg_uint16_t _d){ + ogg_uint32_t t; + int l; + _d<<=1; + l=OC_ILOGNZ_32(_d)-1; + t=1+((ogg_uint32_t)1<<16+l)/_d; + _this->m=(ogg_int16_t)(t-0x10000); + _this->l=l; +} + +/*See comments at oc_dequant_tables_init() for how the quantization tables' + storage should be initialized.*/ +void oc_enquant_tables_init(ogg_uint16_t *_dequant[64][3][2], + oc_iquant *_enquant[64][3][2],const th_quant_info *_qinfo){ + int qi; + int pli; + int qti; + /*Initialize the dequantization tables first.*/ + oc_dequant_tables_init(_dequant,NULL,_qinfo); + /*Derive the quantization tables directly from the dequantization tables.*/ + for(qi=0;qi<64;qi++)for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){ + int zzi; + int plj; + int qtj; + int dupe; + dupe=0; + for(qtj=0;qtj<=qti;qtj++){ + for(plj=0;plj<(qtj>1))/qd; + qp+=rq*(ogg_uint32_t)rq; + } + q2+=OC_PCD[_pixel_fmt][pli]*(ogg_int64_t)qp; + } + /*qavg=1.0/sqrt(q2).*/ + _log_qavg[qti][qi]=OC_Q57(48)-oc_blog64(q2)>>1; + } +} diff --git a/libs/libtheora-1.1/lib/enquant.h b/libs/libtheora-1.1/lib/enquant.h new file mode 100644 index 00000000..d62df10d --- /dev/null +++ b/libs/libtheora-1.1/lib/enquant.h @@ -0,0 +1,27 @@ +#if !defined(_enquant_H) +# define _enquant_H (1) +# include "quant.h" + +typedef struct oc_iquant oc_iquant; + +#define OC_QUANT_MAX_LOG (OC_Q57(OC_STATIC_ILOG_32(OC_QUANT_MAX)-1)) + +/*Used to compute x/d via ((x*m>>16)+x>>l)+(x<0)) + (i.e., one 16x16->16 mul, 2 shifts, and 2 adds). + This is not an approximation; for 16-bit x and d, it is exact.*/ +struct oc_iquant{ + ogg_int16_t m; + ogg_int16_t l; +}; + +typedef oc_iquant oc_iquant_table[64]; + + + +void oc_quant_params_pack(oggpack_buffer *_opb,const th_quant_info *_qinfo); +void oc_enquant_tables_init(ogg_uint16_t *_dequant[64][3][2], + oc_iquant *_enquant[64][3][2],const th_quant_info *_qinfo); +void oc_enquant_qavg_init(ogg_int64_t _log_qavg[2][64], + ogg_uint16_t *_dequant[64][3][2],int _pixel_fmt); + +#endif diff --git a/libs/libtheora-1.1/lib/fdct.c b/libs/libtheora-1.1/lib/fdct.c new file mode 100644 index 00000000..7ad17968 --- /dev/null +++ b/libs/libtheora-1.1/lib/fdct.c @@ -0,0 +1,422 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: fdct.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include "encint.h" +#include "dct.h" + + + +/*Performs a forward 8 point Type-II DCT transform. + The output is scaled by a factor of 2 from the orthonormal version of the + transform. + _y: The buffer to store the result in. + Data will be placed the first 8 entries (e.g., in a row of an 8x8 block). + _x: The input coefficients. + Every 8th entry is used (e.g., from a column of an 8x8 block).*/ +static void oc_fdct8(ogg_int16_t _y[8],const ogg_int16_t *_x){ + int t0; + int t1; + int t2; + int t3; + int t4; + int t5; + int t6; + int t7; + int r; + int s; + int u; + int v; + /*Stage 1:*/ + /*0-7 butterfly.*/ + t0=_x[0<<3]+(int)_x[7<<3]; + t7=_x[0<<3]-(int)_x[7<<3]; + /*1-6 butterfly.*/ + t1=_x[1<<3]+(int)_x[6<<3]; + t6=_x[1<<3]-(int)_x[6<<3]; + /*2-5 butterfly.*/ + t2=_x[2<<3]+(int)_x[5<<3]; + t5=_x[2<<3]-(int)_x[5<<3]; + /*3-4 butterfly.*/ + t3=_x[3<<3]+(int)_x[4<<3]; + t4=_x[3<<3]-(int)_x[4<<3]; + /*Stage 2:*/ + /*0-3 butterfly.*/ + r=t0+t3; + t3=t0-t3; + t0=r; + /*1-2 butterfly.*/ + r=t1+t2; + t2=t1-t2; + t1=r; + /*6-5 butterfly.*/ + r=t6+t5; + t5=t6-t5; + t6=r; + /*Stages 3 and 4 are where all the approximation occurs. + These are chosen to be as close to an exact inverse of the approximations + made in the iDCT as possible, while still using mostly 16-bit arithmetic. + We use some 16x16->32 signed MACs, but those still commonly execute in 1 + cycle on a 16-bit DSP. + For example, s=(27146*t5+0x4000>>16)+t5+(t5!=0) is an exact inverse of + t5=(OC_C4S4*s>>16). + That is, applying the latter to the output of the former will recover t5 + exactly (over the valid input range of t5, -23171...23169). + We increase the rounding bias to 0xB500 in this particular case so that + errors inverting the subsequent butterfly are not one-sided (e.g., the + mean error is very close to zero). + The (t5!=0) term could be replaced simply by 1, but we want to send 0 to 0. + The fDCT of an all-zeros block will still not be zero, because of the + biases we added at the very beginning of the process, but it will be close + enough that it is guaranteed to round to zero.*/ + /*Stage 3:*/ + /*4-5 butterfly.*/ + s=(27146*t5+0xB500>>16)+t5+(t5!=0)>>1; + r=t4+s; + t5=t4-s; + t4=r; + /*7-6 butterfly.*/ + s=(27146*t6+0xB500>>16)+t6+(t6!=0)>>1; + r=t7+s; + t6=t7-s; + t7=r; + /*Stage 4:*/ + /*0-1 butterfly.*/ + r=(27146*t0+0x4000>>16)+t0+(t0!=0); + s=(27146*t1+0xB500>>16)+t1+(t1!=0); + u=r+s>>1; + v=r-u; + _y[0]=u; + _y[4]=v; + /*3-2 rotation by 6pi/16*/ + u=(OC_C6S2*t2+OC_C2S6*t3+0x6CB7>>16)+(t3!=0); + s=(OC_C6S2*u>>16)-t2; + v=(s*21600+0x2800>>18)+s+(s!=0); + _y[2]=u; + _y[6]=v; + /*6-5 rotation by 3pi/16*/ + u=(OC_C5S3*t6+OC_C3S5*t5+0x0E3D>>16)+(t5!=0); + s=t6-(OC_C5S3*u>>16); + v=(s*26568+0x3400>>17)+s+(s!=0); + _y[5]=u; + _y[3]=v; + /*7-4 rotation by 7pi/16*/ + u=(OC_C7S1*t4+OC_C1S7*t7+0x7B1B>>16)+(t7!=0); + s=(OC_C7S1*u>>16)-t4; + v=(s*20539+0x3000>>20)+s+(s!=0); + _y[1]=u; + _y[7]=v; +} + +void oc_enc_fdct8x8(const oc_enc_ctx *_enc,ogg_int16_t _y[64], + const ogg_int16_t _x[64]){ + (*_enc->opt_vtable.fdct8x8)(_y,_x); +} + +/*Performs a forward 8x8 Type-II DCT transform. + The output is scaled by a factor of 4 relative to the orthonormal version + of the transform. + _y: The buffer to store the result in. + This may be the same as _x. + _x: The input coefficients. */ +void oc_enc_fdct8x8_c(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + const ogg_int16_t *in; + ogg_int16_t *end; + ogg_int16_t *out; + ogg_int16_t w[64]; + int i; + /*Add two extra bits of working precision to improve accuracy; any more and + we could overflow.*/ + for(i=0;i<64;i++)w[i]=_x[i]<<2; + /*These biases correct for some systematic error that remains in the full + fDCT->iDCT round trip.*/ + w[0]+=(w[0]!=0)+1; + w[1]++; + w[8]--; + /*Transform columns of w into rows of _y.*/ + for(in=w,out=_y,end=out+64;out>2; +} + + + +/*This does not seem to outperform simple LFE border padding before MC. + It yields higher PSNR, but much higher bitrate usage.*/ +#if 0 +typedef struct oc_extension_info oc_extension_info; + + + +/*Information needed to pad boundary blocks. + We multiply each row/column by an extension matrix that fills in the padding + values as a linear combination of the active values, so that an equivalent + number of coefficients are forced to zero. + This costs at most 16 multiplies, the same as a 1-D fDCT itself, and as + little as 7 multiplies. + We compute the extension matrices for every possible shape in advance, as + there are only 35. + The coefficients for all matrices are stored in a single array to take + advantage of the overlap and repetitiveness of many of the shapes. + A similar technique is applied to the offsets into this array. + This reduces the required table storage by about 48%. + See tools/extgen.c for details. + We could conceivably do the same for all 256 possible shapes.*/ +struct oc_extension_info{ + /*The mask of the active pixels in the shape.*/ + short mask; + /*The number of active pixels in the shape.*/ + short na; + /*The extension matrix. + This is (8-na)xna*/ + const ogg_int16_t *const *ext; + /*The pixel indices: na active pixels followed by 8-na padding pixels.*/ + unsigned char pi[8]; + /*The coefficient indices: na unconstrained coefficients followed by 8-na + coefficients to be forced to zero.*/ + unsigned char ci[8]; +}; + + +/*The number of shapes we need.*/ +#define OC_NSHAPES (35) + +static const ogg_int16_t OC_EXT_COEFFS[229]={ + 0x7FFF,0xE1F8,0x6903,0xAA79,0x5587,0x7FFF,0x1E08,0x7FFF, + 0x5587,0xAA79,0x6903,0xE1F8,0x7FFF,0x0000,0x0000,0x0000, + 0x7FFF,0x0000,0x0000,0x7FFF,0x8000,0x7FFF,0x0000,0x0000, + 0x7FFF,0xE1F8,0x1E08,0xB0A7,0xAA1D,0x337C,0x7FFF,0x4345, + 0x2267,0x4345,0x7FFF,0x337C,0xAA1D,0xB0A7,0x8A8C,0x4F59, + 0x03B4,0xE2D6,0x7FFF,0x2CF3,0x7FFF,0xE2D6,0x03B4,0x4F59, + 0x8A8C,0x1103,0x7AEF,0x5225,0xDF60,0xC288,0xDF60,0x5225, + 0x7AEF,0x1103,0x668A,0xD6EE,0x3A16,0x0E6C,0xFA07,0x0E6C, + 0x3A16,0xD6EE,0x668A,0x2A79,0x2402,0x980F,0x50F5,0x4882, + 0x50F5,0x980F,0x2402,0x2A79,0xF976,0x2768,0x5F22,0x2768, + 0xF976,0x1F91,0x76C1,0xE9AE,0x76C1,0x1F91,0x7FFF,0xD185, + 0x0FC8,0xD185,0x7FFF,0x4F59,0x4345,0xED62,0x4345,0x4F59, + 0xF574,0x5D99,0x2CF3,0x5D99,0xF574,0x5587,0x3505,0x30FC, + 0xF482,0x953C,0xEAC4,0x7FFF,0x4F04,0x7FFF,0xEAC4,0x953C, + 0xF482,0x30FC,0x4F04,0x273D,0xD8C3,0x273D,0x1E09,0x61F7, + 0x1E09,0x273D,0xD8C3,0x273D,0x4F04,0x30FC,0xA57E,0x153C, + 0x6AC4,0x3C7A,0x1E08,0x3C7A,0x6AC4,0x153C,0xA57E,0x7FFF, + 0xA57E,0x5A82,0x6AC4,0x153C,0xC386,0xE1F8,0xC386,0x153C, + 0x6AC4,0x5A82,0xD8C3,0x273D,0x7FFF,0xE1F7,0x7FFF,0x273D, + 0xD8C3,0x4F04,0x30FC,0xD8C3,0x273D,0xD8C3,0x30FC,0x4F04, + 0x1FC8,0x67AD,0x1853,0xE038,0x1853,0x67AD,0x1FC8,0x4546, + 0xE038,0x1FC8,0x3ABA,0x1FC8,0xE038,0x4546,0x3505,0x5587, + 0xF574,0xBC11,0x78F4,0x4AFB,0xE6F3,0x4E12,0x3C11,0xF8F4, + 0x4AFB,0x3C7A,0xF88B,0x3C11,0x78F4,0xCAFB,0x7FFF,0x08CC, + 0x070C,0x236D,0x5587,0x236D,0x070C,0xF88B,0x3C7A,0x4AFB, + 0xF8F4,0x3C11,0x7FFF,0x153C,0xCAFB,0x153C,0x7FFF,0x1E08, + 0xE1F8,0x7FFF,0x08CC,0x7FFF,0xCAFB,0x78F4,0x3C11,0x4E12, + 0xE6F3,0x4AFB,0x78F4,0xBC11,0xFE3D,0x7FFF,0xFE3D,0x2F3A, + 0x7FFF,0x2F3A,0x89BC,0x7FFF,0x89BC +}; + +static const ogg_int16_t *const OC_EXT_ROWS[96]={ + OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 0, + OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 0,OC_EXT_COEFFS+ 6, + OC_EXT_COEFFS+ 27,OC_EXT_COEFFS+ 38,OC_EXT_COEFFS+ 43,OC_EXT_COEFFS+ 32, + OC_EXT_COEFFS+ 49,OC_EXT_COEFFS+ 58,OC_EXT_COEFFS+ 67,OC_EXT_COEFFS+ 71, + OC_EXT_COEFFS+ 62,OC_EXT_COEFFS+ 53,OC_EXT_COEFFS+ 12,OC_EXT_COEFFS+ 15, + OC_EXT_COEFFS+ 14,OC_EXT_COEFFS+ 13,OC_EXT_COEFFS+ 76,OC_EXT_COEFFS+ 81, + OC_EXT_COEFFS+ 86,OC_EXT_COEFFS+ 91,OC_EXT_COEFFS+ 96,OC_EXT_COEFFS+ 98, + OC_EXT_COEFFS+ 93,OC_EXT_COEFFS+ 88,OC_EXT_COEFFS+ 83,OC_EXT_COEFFS+ 78, + OC_EXT_COEFFS+ 12,OC_EXT_COEFFS+ 15,OC_EXT_COEFFS+ 15,OC_EXT_COEFFS+ 12, + OC_EXT_COEFFS+ 12,OC_EXT_COEFFS+ 15,OC_EXT_COEFFS+ 12,OC_EXT_COEFFS+ 15, + OC_EXT_COEFFS+ 15,OC_EXT_COEFFS+ 12,OC_EXT_COEFFS+ 103,OC_EXT_COEFFS+ 108, + OC_EXT_COEFFS+ 126,OC_EXT_COEFFS+ 16,OC_EXT_COEFFS+ 137,OC_EXT_COEFFS+ 141, + OC_EXT_COEFFS+ 20,OC_EXT_COEFFS+ 130,OC_EXT_COEFFS+ 113,OC_EXT_COEFFS+ 116, + OC_EXT_COEFFS+ 146,OC_EXT_COEFFS+ 153,OC_EXT_COEFFS+ 160,OC_EXT_COEFFS+ 167, + OC_EXT_COEFFS+ 170,OC_EXT_COEFFS+ 163,OC_EXT_COEFFS+ 156,OC_EXT_COEFFS+ 149, + OC_EXT_COEFFS+ 119,OC_EXT_COEFFS+ 122,OC_EXT_COEFFS+ 174,OC_EXT_COEFFS+ 177, + OC_EXT_COEFFS+ 182,OC_EXT_COEFFS+ 187,OC_EXT_COEFFS+ 192,OC_EXT_COEFFS+ 197, + OC_EXT_COEFFS+ 202,OC_EXT_COEFFS+ 207,OC_EXT_COEFFS+ 210,OC_EXT_COEFFS+ 215, + OC_EXT_COEFFS+ 179,OC_EXT_COEFFS+ 189,OC_EXT_COEFFS+ 24,OC_EXT_COEFFS+ 204, + OC_EXT_COEFFS+ 184,OC_EXT_COEFFS+ 194,OC_EXT_COEFFS+ 212,OC_EXT_COEFFS+ 199, + OC_EXT_COEFFS+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6,5,4,3,1}}, + {0x40,1,OC_EXT_ROWS+ 0,{6,7,5,4,3,2,1,0},{0,7,6,5,4,3,2,1}}, + {0x20,1,OC_EXT_ROWS+ 0,{5,7,6,4,3,2,1,0},{0,7,6,5,4,3,2,1}}, + {0x10,1,OC_EXT_ROWS+ 0,{4,7,6,5,3,2,1,0},{0,7,6,5,4,3,2,1}}, + {0x08,1,OC_EXT_ROWS+ 0,{3,7,6,5,4,2,1,0},{0,7,6,5,4,3,2,1}}, + {0x04,1,OC_EXT_ROWS+ 0,{2,7,6,5,4,3,1,0},{0,7,6,5,4,3,2,1}}, + {0x02,1,OC_EXT_ROWS+ 0,{1,7,6,5,4,3,2,0},{0,7,6,5,4,3,2,1}} +}; + + + +/*Pads a single column of a partial block and then performs a forward Type-II + DCT on the result. + The input is scaled by a factor of 4 and biased appropriately for the current + fDCT implementation. + The output is scaled by an additional factor of 2 from the orthonormal + version of the transform. + _y: The buffer to store the result in. + Data will be placed the first 8 entries (e.g., in a row of an 8x8 block). + _x: The input coefficients. + Every 8th entry is used (e.g., from a column of an 8x8 block). + _e: The extension information for the shape.*/ +static void oc_fdct8_ext(ogg_int16_t _y[8],ogg_int16_t *_x, + const oc_extension_info *_e){ + const unsigned char *pi; + int na; + na=_e->na; + pi=_e->pi; + if(na==1){ + int ci; + /*While the branch below is still correct for shapes with na==1, we can + perform the entire transform with just 1 multiply in this case instead + of 23.*/ + _y[0]=(ogg_int16_t)(OC_DIV2_16(OC_C4S4*(_x[pi[0]]))); + for(ci=1;ci<8;ci++)_y[ci]=0; + } + else{ + const ogg_int16_t *const *ext; + int zpi; + int api; + int nz; + /*First multiply by the extension matrix to compute the padding values.*/ + nz=8-na; + ext=_e->ext; + for(zpi=0;zpi>16)+1>>1; + } + oc_fdct8(_y,_x); + } +} + +/*Performs a forward 8x8 Type-II DCT transform on blocks which overlap the + border of the picture region. + This method ONLY works with rectangular regions. + _border: A description of which pixels are inside the border. + _y: The buffer to store the result in. + This may be the same as _x. + _x: The input pixel values. + Pixel values outside the border will be ignored.*/ +void oc_fdct8x8_border(const oc_border_info *_border, + ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + ogg_int16_t *in; + ogg_int16_t *out; + ogg_int16_t w[64]; + ogg_int64_t mask; + const oc_extension_info *cext; + const oc_extension_info *rext; + int cmask; + int rmask; + int ri; + int ci; + /*Identify the shapes of the non-zero rows and columns.*/ + rmask=cmask=0; + mask=_border->mask; + for(ri=0;ri<8;ri++){ + /*This aggregation is _only_ correct for rectangular masks.*/ + cmask|=((mask&0xFF)!=0)<>=8; + } + /*Find the associated extension info for these shapes.*/ + if(cmask==0xFF)cext=NULL; + else for(cext=OC_EXTENSION_INFO;cext->mask!=cmask;){ + /*If we somehow can't find the shape, then just do an unpadded fDCT. + It won't be efficient, but it should still be correct.*/ + if(++cext>=OC_EXTENSION_INFO+OC_NSHAPES){ + oc_enc_fdct8x8_c(_y,_x); + return; + } + } + if(rmask==0xFF)rext=NULL; + else for(rext=OC_EXTENSION_INFO;rext->mask!=rmask;){ + /*If we somehow can't find the shape, then just do an unpadded fDCT. + It won't be efficient, but it should still be correct.*/ + if(++rext>=OC_EXTENSION_INFO+OC_NSHAPES){ + oc_enc_fdct8x8_c(_y,_x); + return; + } + } + /*Add two extra bits of working precision to improve accuracy; any more and + we could overflow.*/ + for(ci=0;ci<64;ci++)w[ci]=_x[ci]<<2; + /*These biases correct for some systematic error that remains in the full + fDCT->iDCT round trip. + We can safely add them before padding, since if these pixel values are + overwritten, we didn't care what they were anyway (and the unbiased values + will usually yield smaller DCT coefficient magnitudes).*/ + w[0]+=(w[0]!=0)+1; + w[1]++; + w[8]--; + /*Transform the columns. + We can ignore zero columns without a problem.*/ + in=w; + out=_y; + if(cext==NULL)for(ci=0;ci<8;ci++)oc_fdct8(out+(ci<<3),in+ci); + else for(ci=0;ci<8;ci++)if(rmask&(1<>2; +} +#endif diff --git a/libs/libtheora-1.1/lib/fragment.c b/libs/libtheora-1.1/lib/fragment.c new file mode 100644 index 00000000..971d1a41 --- /dev/null +++ b/libs/libtheora-1.1/lib/fragment.c @@ -0,0 +1,87 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: fragment.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include "internal.h" + +void oc_frag_copy(const oc_theora_state *_state,unsigned char *_dst, + const unsigned char *_src,int _ystride){ + (*_state->opt_vtable.frag_copy)(_dst,_src,_ystride); +} + +void oc_frag_copy_c(unsigned char *_dst,const unsigned char *_src,int _ystride){ + int i; + for(i=8;i-->0;){ + memcpy(_dst,_src,8*sizeof(*_dst)); + _dst+=_ystride; + _src+=_ystride; + } +} + +void oc_frag_recon_intra(const oc_theora_state *_state,unsigned char *_dst, + int _ystride,const ogg_int16_t _residue[64]){ + _state->opt_vtable.frag_recon_intra(_dst,_ystride,_residue); +} + +void oc_frag_recon_intra_c(unsigned char *_dst,int _ystride, + const ogg_int16_t _residue[64]){ + int i; + for(i=0;i<8;i++){ + int j; + for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+128); + _dst+=_ystride; + } +} + +void oc_frag_recon_inter(const oc_theora_state *_state,unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){ + _state->opt_vtable.frag_recon_inter(_dst,_src,_ystride,_residue); +} + +void oc_frag_recon_inter_c(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){ + int i; + for(i=0;i<8;i++){ + int j; + for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+_src[j]); + _dst+=_ystride; + _src+=_ystride; + } +} + +void oc_frag_recon_inter2(const oc_theora_state *_state,unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride, + const ogg_int16_t _residue[64]){ + _state->opt_vtable.frag_recon_inter2(_dst,_src1,_src2,_ystride,_residue); +} + +void oc_frag_recon_inter2_c(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]){ + int i; + for(i=0;i<8;i++){ + int j; + for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+(_src1[j]+_src2[j]>>1)); + _dst+=_ystride; + _src1+=_ystride; + _src2+=_ystride; + } +} + +void oc_restore_fpu(const oc_theora_state *_state){ + _state->opt_vtable.restore_fpu(); +} + +void oc_restore_fpu_c(void){} diff --git a/libs/libtheora-1.1/lib/huffdec.c b/libs/libtheora-1.1/lib/huffdec.c new file mode 100644 index 00000000..31f48c1b --- /dev/null +++ b/libs/libtheora-1.1/lib/huffdec.c @@ -0,0 +1,489 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: huffdec.c 16702 2009-11-15 00:40:55Z tterribe $ + + ********************************************************************/ + +#include +#include +#include +#include "huffdec.h" +#include "decint.h" + + +/*The ANSI offsetof macro is broken on some platforms (e.g., older DECs).*/ +#define _ogg_offsetof(_type,_field)\ + ((size_t)((char *)&((_type *)0)->_field-(char *)0)) + +/*The number of internal tokens associated with each of the spec tokens.*/ +static const unsigned char OC_DCT_TOKEN_MAP_ENTRIES[TH_NDCT_TOKENS]={ + 1,1,1,4,8,1,1,8,1,1,1,1,1,2,2,2,2,4,8,2,2,2,4,2,2,2,2,2,8,2,4,8 +}; + +/*The map from external spec-defined tokens to internal tokens. + This is constructed so that any extra bits read with the original token value + can be masked off the least significant bits of its internal token index. + In addition, all of the tokens which require additional extra bits are placed + at the start of the list, and grouped by type. + OC_DCT_REPEAT_RUN3_TOKEN is placed first, as it is an extra-special case, so + giving it index 0 may simplify comparisons on some architectures. + These requirements require some substantial reordering.*/ +static const unsigned char OC_DCT_TOKEN_MAP[TH_NDCT_TOKENS]={ + /*OC_DCT_EOB1_TOKEN (0 extra bits)*/ + 15, + /*OC_DCT_EOB2_TOKEN (0 extra bits)*/ + 16, + /*OC_DCT_EOB3_TOKEN (0 extra bits)*/ + 17, + /*OC_DCT_REPEAT_RUN0_TOKEN (2 extra bits)*/ + 88, + /*OC_DCT_REPEAT_RUN1_TOKEN (3 extra bits)*/ + 80, + /*OC_DCT_REPEAT_RUN2_TOKEN (4 extra bits)*/ + 1, + /*OC_DCT_REPEAT_RUN3_TOKEN (12 extra bits)*/ + 0, + /*OC_DCT_SHORT_ZRL_TOKEN (3 extra bits)*/ + 48, + /*OC_DCT_ZRL_TOKEN (6 extra bits)*/ + 14, + /*OC_ONE_TOKEN (0 extra bits)*/ + 56, + /*OC_MINUS_ONE_TOKEN (0 extra bits)*/ + 57, + /*OC_TWO_TOKEN (0 extra bits)*/ + 58, + /*OC_MINUS_TWO_TOKEN (0 extra bits)*/ + 59, + /*OC_DCT_VAL_CAT2 (1 extra bit)*/ + 60, + 62, + 64, + 66, + /*OC_DCT_VAL_CAT3 (2 extra bits)*/ + 68, + /*OC_DCT_VAL_CAT4 (3 extra bits)*/ + 72, + /*OC_DCT_VAL_CAT5 (4 extra bits)*/ + 2, + /*OC_DCT_VAL_CAT6 (5 extra bits)*/ + 4, + /*OC_DCT_VAL_CAT7 (6 extra bits)*/ + 6, + /*OC_DCT_VAL_CAT8 (10 extra bits)*/ + 8, + /*OC_DCT_RUN_CAT1A (1 extra bit)*/ + 18, + 20, + 22, + 24, + 26, + /*OC_DCT_RUN_CAT1B (3 extra bits)*/ + 32, + /*OC_DCT_RUN_CAT1C (4 extra bits)*/ + 12, + /*OC_DCT_RUN_CAT2A (2 extra bits)*/ + 28, + /*OC_DCT_RUN_CAT2B (3 extra bits)*/ + 40 +}; + +/*These three functions are really part of the bitpack.c module, but + they are only used here. + Declaring local static versions so they can be inlined saves considerable + function call overhead.*/ + +static oc_pb_window oc_pack_refill(oc_pack_buf *_b,int _bits){ + const unsigned char *ptr; + const unsigned char *stop; + oc_pb_window window; + int available; + window=_b->window; + available=_b->bits; + ptr=_b->ptr; + stop=_b->stop; + /*This version of _refill() doesn't bother setting eof because we won't + check for it after we've started decoding DCT tokens.*/ + if(ptr>=stop)available=OC_LOTS_OF_BITS; + while(available<=OC_PB_WINDOW_SIZE-8){ + available+=8; + window|=(oc_pb_window)*ptr++<=stop)available=OC_LOTS_OF_BITS; + } + _b->ptr=ptr; + if(_bits>available)window|=*ptr>>(available&7); + _b->bits=available; + return window; +} + + +/*Read in bits without advancing the bit pointer. + Here we assume 0<=_bits&&_bits<=32.*/ +static long oc_pack_look(oc_pack_buf *_b,int _bits){ + oc_pb_window window; + int available; + long result; + window=_b->window; + available=_b->bits; + if(_bits==0)return 0; + if(_bits>available)_b->window=window=oc_pack_refill(_b,_bits); + result=window>>OC_PB_WINDOW_SIZE-_bits; + return result; +} + +/*Advance the bit pointer.*/ +static void oc_pack_adv(oc_pack_buf *_b,int _bits){ + /*We ignore the special cases for _bits==0 and _bits==32 here, since they are + never used actually used. + OC_HUFF_SLUSH (defined below) would have to be at least 27 to actually read + 32 bits in a single go, and would require a 32 GB lookup table (assuming + 8 byte pointers, since 4 byte pointers couldn't fit such a table).*/ + _b->window<<=_bits; + _b->bits-=_bits; +} + + +/*The log_2 of the size of a lookup table is allowed to grow to relative to + the number of unique nodes it contains. + E.g., if OC_HUFF_SLUSH is 2, then at most 75% of the space in the tree is + wasted (each node will have an amortized cost of at most 20 bytes when using + 4-byte pointers). + Larger numbers can decode tokens with fewer read operations, while smaller + numbers may save more space (requiring as little as 8 bytes amortized per + node, though there will be more nodes). + With a sample file: + 32233473 read calls are required when no tree collapsing is done (100.0%). + 19269269 read calls are required when OC_HUFF_SLUSH is 0 (59.8%). + 11144969 read calls are required when OC_HUFF_SLUSH is 1 (34.6%). + 10538563 read calls are required when OC_HUFF_SLUSH is 2 (32.7%). + 10192578 read calls are required when OC_HUFF_SLUSH is 3 (31.6%). + Since a value of 1 gets us the vast majority of the speed-up with only a + small amount of wasted memory, this is what we use.*/ +#define OC_HUFF_SLUSH (1) + + +/*Determines the size in bytes of a Huffman tree node that represents a + subtree of depth _nbits. + _nbits: The depth of the subtree. + If this is 0, the node is a leaf node. + Otherwise 1<<_nbits pointers are allocated for children. + Return: The number of bytes required to store the node.*/ +static size_t oc_huff_node_size(int _nbits){ + size_t size; + size=_ogg_offsetof(oc_huff_node,nodes); + if(_nbits>0)size+=sizeof(oc_huff_node *)*(1<<_nbits); + return size; +} + +static oc_huff_node *oc_huff_node_init(char **_storage,size_t _size,int _nbits){ + oc_huff_node *ret; + ret=(oc_huff_node *)*_storage; + ret->nbits=(unsigned char)_nbits; + (*_storage)+=_size; + return ret; +} + + +/*Determines the size in bytes of a Huffman tree. + _nbits: The depth of the subtree. + If this is 0, the node is a leaf node. + Otherwise storage for 1<<_nbits pointers are added for children. + Return: The number of bytes required to store the tree.*/ +static size_t oc_huff_tree_size(const oc_huff_node *_node){ + size_t size; + size=oc_huff_node_size(_node->nbits); + if(_node->nbits){ + int nchildren; + int i; + nchildren=1<<_node->nbits; + for(i=0;inbits-_node->nodes[i]->depth){ + size+=oc_huff_tree_size(_node->nodes[i]); + } + } + return size; +} + + +/*Unpacks a sub-tree from the given buffer. + _opb: The buffer to unpack from. + _binodes: The nodes to store the sub-tree in. + _nbinodes: The number of nodes available for the sub-tree. + Return: 0 on success, or a negative value on error.*/ +static int oc_huff_tree_unpack(oc_pack_buf *_opb, + oc_huff_node *_binodes,int _nbinodes){ + oc_huff_node *binode; + long bits; + int nused; + if(_nbinodes<1)return TH_EBADHEADER; + binode=_binodes; + nused=0; + bits=oc_pack_read1(_opb); + if(oc_pack_bytes_left(_opb)<0)return TH_EBADHEADER; + /*Read an internal node:*/ + if(!bits){ + int ret; + nused++; + binode->nbits=1; + binode->depth=1; + binode->nodes[0]=_binodes+nused; + ret=oc_huff_tree_unpack(_opb,_binodes+nused,_nbinodes-nused); + if(ret>=0){ + nused+=ret; + binode->nodes[1]=_binodes+nused; + ret=oc_huff_tree_unpack(_opb,_binodes+nused,_nbinodes-nused); + } + if(ret<0)return ret; + nused+=ret; + } + /*Read a leaf node:*/ + else{ + int ntokens; + int token; + int i; + bits=oc_pack_read(_opb,OC_NDCT_TOKEN_BITS); + if(oc_pack_bytes_left(_opb)<0)return TH_EBADHEADER; + /*Find out how many internal tokens we translate this external token into.*/ + ntokens=OC_DCT_TOKEN_MAP_ENTRIES[bits]; + if(_nbinodes<2*ntokens-1)return TH_EBADHEADER; + /*Fill in a complete binary tree pointing to the internal tokens.*/ + for(i=1;inbits=0; + binode->depth=1; + binode->token=token+i; + } + } + return nused; +} + +/*Finds the depth of shortest branch of the given sub-tree. + The tree must be binary. + _binode: The root of the given sub-tree. + _binode->nbits must be 0 or 1. + Return: The smallest depth of a leaf node in this sub-tree. + 0 indicates this sub-tree is a leaf node.*/ +static int oc_huff_tree_mindepth(oc_huff_node *_binode){ + int depth0; + int depth1; + if(_binode->nbits==0)return 0; + depth0=oc_huff_tree_mindepth(_binode->nodes[0]); + depth1=oc_huff_tree_mindepth(_binode->nodes[1]); + return OC_MINI(depth0,depth1)+1; +} + +/*Finds the number of internal nodes at a given depth, plus the number of + leaves at that depth or shallower. + The tree must be binary. + _binode: The root of the given sub-tree. + _binode->nbits must be 0 or 1. + Return: The number of entries that would be contained in a jump table of the + given depth.*/ +static int oc_huff_tree_occupancy(oc_huff_node *_binode,int _depth){ + if(_binode->nbits==0||_depth<=0)return 1; + else{ + return oc_huff_tree_occupancy(_binode->nodes[0],_depth-1)+ + oc_huff_tree_occupancy(_binode->nodes[1],_depth-1); + } +} + +/*Makes a copy of the given Huffman tree. + _node: The Huffman tree to copy. + Return: The copy of the Huffman tree.*/ +static oc_huff_node *oc_huff_tree_copy(const oc_huff_node *_node, + char **_storage){ + oc_huff_node *ret; + ret=oc_huff_node_init(_storage,oc_huff_node_size(_node->nbits),_node->nbits); + ret->depth=_node->depth; + if(_node->nbits){ + int nchildren; + int i; + int inext; + nchildren=1<<_node->nbits; + for(i=0;inodes[i]=oc_huff_tree_copy(_node->nodes[i],_storage); + inext=i+(1<<_node->nbits-ret->nodes[i]->depth); + while(++inodes[i]=ret->nodes[i-1]; + } + } + else ret->token=_node->token; + return ret; +} + +static size_t oc_huff_tree_collapse_size(oc_huff_node *_binode,int _depth){ + size_t size; + int mindepth; + int depth; + int loccupancy; + int occupancy; + if(_binode->nbits!=0&&_depth>0){ + return oc_huff_tree_collapse_size(_binode->nodes[0],_depth-1)+ + oc_huff_tree_collapse_size(_binode->nodes[1],_depth-1); + } + depth=mindepth=oc_huff_tree_mindepth(_binode); + occupancy=1<loccupancy&&occupancy>=1<0){ + size+=oc_huff_tree_collapse_size(_binode->nodes[0],depth-1); + size+=oc_huff_tree_collapse_size(_binode->nodes[1],depth-1); + } + return size; +} + +static oc_huff_node *oc_huff_tree_collapse(oc_huff_node *_binode, + char **_storage); + +/*Fills the given nodes table with all the children in the sub-tree at the + given depth. + The nodes in the sub-tree with a depth less than that stored in the table + are freed. + The sub-tree must be binary and complete up until the given depth. + _nodes: The nodes table to fill. + _binode: The root of the sub-tree to fill it with. + _binode->nbits must be 0 or 1. + _level: The current level in the table. + 0 indicates that the current node should be stored, regardless of + whether it is a leaf node or an internal node. + _depth: The depth of the nodes to fill the table with, relative to their + parent.*/ +static void oc_huff_node_fill(oc_huff_node **_nodes, + oc_huff_node *_binode,int _level,int _depth,char **_storage){ + if(_level<=0||_binode->nbits==0){ + int i; + _binode->depth=(unsigned char)(_depth-_level); + _nodes[0]=oc_huff_tree_collapse(_binode,_storage); + for(i=1;i<1<<_level;i++)_nodes[i]=_nodes[0]; + } + else{ + _level--; + oc_huff_node_fill(_nodes,_binode->nodes[0],_level,_depth,_storage); + _nodes+=1<<_level; + oc_huff_node_fill(_nodes,_binode->nodes[1],_level,_depth,_storage); + } +} + +/*Finds the largest complete sub-tree rooted at the current node and collapses + it into a single node. + This procedure is then applied recursively to all the children of that node. + _binode: The root of the sub-tree to collapse. + _binode->nbits must be 0 or 1. + Return: The new root of the collapsed sub-tree.*/ +static oc_huff_node *oc_huff_tree_collapse(oc_huff_node *_binode, + char **_storage){ + oc_huff_node *root; + size_t size; + int mindepth; + int depth; + int loccupancy; + int occupancy; + depth=mindepth=oc_huff_tree_mindepth(_binode); + occupancy=1<loccupancy&&occupancy>=1<depth=_binode->depth; + oc_huff_node_fill(root->nodes,_binode,depth,depth,_storage); + return root; +} + +/*Unpacks a set of Huffman trees, and reduces them to a collapsed + representation. + _opb: The buffer to unpack the trees from. + _nodes: The table to fill with the Huffman trees. + Return: 0 on success, or a negative value on error.*/ +int oc_huff_trees_unpack(oc_pack_buf *_opb, + oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]){ + int i; + for(i=0;i0)_ogg_free(_dst[i]); + return TH_EFAULT; + } + _dst[i]=oc_huff_tree_copy(_src[i],&storage); + } + return 0; +} + +/*Frees the memory used by a set of Huffman trees. + _nodes: The array of trees to free.*/ +void oc_huff_trees_clear(oc_huff_node *_nodes[TH_NHUFFMAN_TABLES]){ + int i; + for(i=0;inbits!=0){ + bits=oc_pack_look(_opb,_node->nbits); + _node=_node->nodes[bits]; + oc_pack_adv(_opb,_node->depth); + } + return _node->token; +} diff --git a/libs/libtheora-1.1/lib/huffdec.h b/libs/libtheora-1.1/lib/huffdec.h new file mode 100644 index 00000000..e0a06d84 --- /dev/null +++ b/libs/libtheora-1.1/lib/huffdec.h @@ -0,0 +1,92 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: huffdec.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_huffdec_H) +# define _huffdec_H (1) +# include "huffman.h" +# include "bitpack.h" + + + +typedef struct oc_huff_node oc_huff_node; + +/*A node in the Huffman tree. + Instead of storing every branching in the tree, subtrees can be collapsed + into one node, with a table of size 1< +#include +#include +#include "huffenc.h" + + + +/*The default Huffman codes used for VP3.1.*/ +const th_huff_code TH_VP31_HUFF_CODES[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]={ + { + {0x002D, 6},{0x0026, 7},{0x0166, 9},{0x004E, 8}, + {0x02CE,10},{0x059E,11},{0x027D,11},{0x0008, 5}, + {0x04F9,12},{0x000F, 4},{0x000E, 4},{0x001B, 5}, + {0x0006, 4},{0x0008, 4},{0x0005, 4},{0x001A, 5}, + {0x0015, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x0029, 6}, + {0x0028, 6},{0x00B2, 8},{0x04F8,12},{0x059F,11}, + {0x009E, 9},{0x013F,10},{0x0012, 6},{0x0058, 7} + }, + { + {0x0010, 5},{0x0047, 7},{0x01FF, 9},{0x008C, 8}, + {0x03FC,10},{0x046A,11},{0x0469,11},{0x0022, 6}, + {0x11A1,13},{0x000E, 4},{0x000D, 4},{0x0004, 4}, + {0x0005, 4},{0x0009, 4},{0x0006, 4},{0x001E, 5}, + {0x0016, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x000A, 4},{0x0017, 5},{0x007D, 7}, + {0x007E, 7},{0x011B, 9},{0x08D1,12},{0x03FD,10}, + {0x046B,11},{0x11A0,13},{0x007C, 7},{0x00FE, 8} + }, + { + {0x0016, 5},{0x0020, 6},{0x0086, 8},{0x0087, 8}, + {0x0367,10},{0x06CC,11},{0x06CB,11},{0x006E, 7}, + {0x366D,14},{0x000F, 4},{0x000E, 4},{0x0004, 4}, + {0x0005, 4},{0x000A, 4},{0x0006, 4},{0x001A, 5}, + {0x0011, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3}, + {0x0000, 3},{0x0009, 4},{0x0017, 5},{0x006F, 7}, + {0x006D, 7},{0x0364,10},{0x0D9A,12},{0x06CA,11}, + {0x1B37,13},{0x366C,14},{0x0042, 7},{0x00D8, 8} + }, + { + {0x0000, 4},{0x002D, 6},{0x00F7, 8},{0x0058, 7}, + {0x0167, 9},{0x02CB,10},{0x02CA,10},{0x000E, 6}, + {0x1661,13},{0x0003, 3},{0x0002, 3},{0x0008, 4}, + {0x0009, 4},{0x000D, 4},{0x0002, 4},{0x001F, 5}, + {0x0017, 5},{0x0001, 4},{0x000C, 4},{0x000E, 4}, + {0x000A, 4},{0x0006, 5},{0x0078, 7},{0x000F, 6}, + {0x007A, 7},{0x0164, 9},{0x0599,11},{0x02CD,10}, + {0x0B31,12},{0x1660,13},{0x0079, 7},{0x00F6, 8} + }, + { + {0x0003, 4},{0x003C, 6},{0x000F, 7},{0x007A, 7}, + {0x001D, 8},{0x0020, 9},{0x0072,10},{0x0006, 6}, + {0x0399,13},{0x0004, 3},{0x0005, 3},{0x0005, 4}, + {0x0006, 4},{0x000E, 4},{0x0004, 4},{0x0000, 4}, + {0x0019, 5},{0x0002, 4},{0x000D, 4},{0x0007, 4}, + {0x001F, 5},{0x0030, 6},{0x0011, 8},{0x0031, 6}, + {0x0005, 6},{0x0021, 9},{0x00E7,11},{0x0038, 9}, + {0x01CD,12},{0x0398,13},{0x007B, 7},{0x0009, 7} + }, + { + {0x0009, 4},{0x0002, 5},{0x0074, 7},{0x0007, 6}, + {0x00EC, 8},{0x00D1, 9},{0x01A6,10},{0x0006, 6}, + {0x0D21,13},{0x0005, 3},{0x0006, 3},{0x0008, 4}, + {0x0007, 4},{0x000F, 4},{0x0004, 4},{0x0000, 4}, + {0x001C, 5},{0x0002, 4},{0x0005, 4},{0x0003, 4}, + {0x000C, 5},{0x0035, 7},{0x01A7,10},{0x001B, 6}, + {0x0077, 7},{0x01A5,10},{0x0349,11},{0x00D0, 9}, + {0x0691,12},{0x0D20,13},{0x0075, 7},{0x00ED, 8} + }, + { + {0x000A, 4},{0x000C, 5},{0x0012, 6},{0x001B, 6}, + {0x00B7, 8},{0x016C, 9},{0x0099, 9},{0x005A, 7}, + {0x16D8,13},{0x0007, 3},{0x0006, 3},{0x0009, 4}, + {0x0008, 4},{0x0000, 3},{0x0005, 4},{0x0017, 5}, + {0x000E, 5},{0x0002, 4},{0x0003, 4},{0x000F, 5}, + {0x001A, 6},{0x004D, 8},{0x2DB3,14},{0x002C, 6}, + {0x0011, 6},{0x02DA,10},{0x05B7,11},{0x0098, 9}, + {0x0B6D,12},{0x2DB2,14},{0x0010, 6},{0x0027, 7} + }, + { + {0x000D, 4},{0x000F, 5},{0x001D, 6},{0x0008, 5}, + {0x0051, 7},{0x0056, 8},{0x00AF, 9},{0x002A, 7}, + {0x148A,13},{0x0007, 3},{0x0000, 2},{0x0008, 4}, + {0x0009, 4},{0x000C, 4},{0x0006, 4},{0x0017, 5}, + {0x000B, 5},{0x0016, 5},{0x0015, 5},{0x0009, 5}, + {0x0050, 7},{0x00AE, 9},{0x2917,14},{0x001C, 6}, + {0x0014, 6},{0x0290,10},{0x0523,11},{0x0149, 9}, + {0x0A44,12},{0x2916,14},{0x0053, 7},{0x00A5, 8} + }, + { + {0x0001, 4},{0x001D, 6},{0x00F5, 8},{0x00F4, 8}, + {0x024D,10},{0x0499,11},{0x0498,11},{0x0001, 5}, + {0x0021, 6},{0x0006, 3},{0x0005, 3},{0x0006, 4}, + {0x0005, 4},{0x0002, 4},{0x0007, 5},{0x0025, 6}, + {0x007B, 7},{0x001C, 6},{0x0020, 6},{0x000D, 6}, + {0x0048, 7},{0x0092, 8},{0x0127, 9},{0x000E, 4}, + {0x0004, 4},{0x0011, 5},{0x000C, 6},{0x003C, 6}, + {0x000F, 5},{0x0000, 5},{0x001F, 5},{0x0013, 5} + }, + { + {0x0005, 4},{0x003C, 6},{0x0040, 7},{0x000D, 7}, + {0x0031, 9},{0x0061,10},{0x0060,10},{0x0002, 5}, + {0x00F5, 8},{0x0006, 3},{0x0005, 3},{0x0007, 4}, + {0x0006, 4},{0x0002, 4},{0x0009, 5},{0x0025, 6}, + {0x0007, 6},{0x0021, 6},{0x0024, 6},{0x0010, 6}, + {0x0041, 7},{0x00F4, 8},{0x0019, 8},{0x000E, 4}, + {0x0003, 4},{0x0011, 5},{0x0011, 6},{0x003F, 6}, + {0x003E, 6},{0x007B, 7},{0x0000, 4},{0x0013, 5} + }, + { + {0x000A, 4},{0x0007, 5},{0x0001, 6},{0x0009, 6}, + {0x0131, 9},{0x0261,10},{0x0260,10},{0x0015, 6}, + {0x0001, 7},{0x0007, 3},{0x0006, 3},{0x0008, 4}, + {0x0007, 4},{0x0006, 4},{0x0012, 5},{0x002F, 6}, + {0x0014, 6},{0x0027, 6},{0x002D, 6},{0x0016, 6}, + {0x004D, 7},{0x0099, 8},{0x0000, 7},{0x0004, 4}, + {0x0001, 4},{0x0005, 5},{0x0017, 6},{0x002E, 6}, + {0x002C, 6},{0x0008, 6},{0x0006, 5},{0x0001, 5} + }, + { + {0x0000, 3},{0x000E, 5},{0x0017, 6},{0x002A, 6}, + {0x0010, 7},{0x00F9,10},{0x00F8,10},{0x001E, 7}, + {0x003F, 8},{0x0007, 3},{0x0006, 3},{0x0009, 4}, + {0x0008, 4},{0x0006, 4},{0x000F, 5},{0x0005, 5}, + {0x0016, 6},{0x0029, 6},{0x002B, 6},{0x0015, 6}, + {0x0050, 7},{0x0011, 7},{0x007D, 9},{0x0004, 4}, + {0x0017, 5},{0x0006, 5},{0x0014, 6},{0x002C, 6}, + {0x002D, 6},{0x000E, 6},{0x0009, 6},{0x0051, 7} + }, + { + {0x0002, 3},{0x0018, 5},{0x002F, 6},{0x000D, 5}, + {0x0053, 7},{0x0295,10},{0x0294,10},{0x00A4, 8}, + {0x007C, 8},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x001B, 5},{0x000C, 5},{0x0028, 6}, + {0x006A, 7},{0x001E, 6},{0x001D, 6},{0x0069, 7}, + {0x00D7, 8},{0x007D, 8},{0x014B, 9},{0x0019, 5}, + {0x0016, 5},{0x002E, 6},{0x001C, 6},{0x002B, 6}, + {0x002A, 6},{0x0068, 7},{0x003F, 7},{0x00D6, 8} + }, + { + {0x0002, 3},{0x001B, 5},{0x000C, 5},{0x0018, 5}, + {0x0029, 6},{0x007F, 8},{0x02F0,10},{0x0198, 9}, + {0x0179, 9},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x001A, 5},{0x000D, 5},{0x002A, 6}, + {0x0064, 7},{0x001E, 6},{0x0067, 7},{0x005F, 7}, + {0x00CD, 8},{0x007E, 8},{0x02F1,10},{0x0016, 5}, + {0x000E, 5},{0x002E, 6},{0x0065, 7},{0x002B, 6}, + {0x0028, 6},{0x003E, 7},{0x00BD, 8},{0x0199, 9} + }, + { + {0x0002, 3},{0x0007, 4},{0x0016, 5},{0x0006, 4}, + {0x0036, 6},{0x005C, 7},{0x015D, 9},{0x015C, 9}, + {0x02BF,10},{0x0000, 2},{0x0007, 3},{0x0009, 4}, + {0x0008, 4},{0x0018, 5},{0x0034, 6},{0x002A, 6}, + {0x005E, 7},{0x006A, 7},{0x0064, 7},{0x005D, 7}, + {0x00CB, 8},{0x00AD, 8},{0x02BE,10},{0x0014, 5}, + {0x0033, 6},{0x006E, 7},{0x005F, 7},{0x006F, 7}, + {0x006B, 7},{0x00CA, 8},{0x00AC, 8},{0x015E, 9} + }, + { + {0x000F, 4},{0x001D, 5},{0x0018, 5},{0x000B, 4}, + {0x0019, 5},{0x0029, 6},{0x00D6, 8},{0x0551,11}, + {0x0AA1,12},{0x0001, 2},{0x0000, 2},{0x0009, 4}, + {0x0008, 4},{0x001B, 5},{0x0038, 6},{0x0028, 6}, + {0x0057, 7},{0x006A, 7},{0x0068, 7},{0x0056, 7}, + {0x00E5, 8},{0x0155, 9},{0x0AA0,12},{0x0073, 7}, + {0x0069, 7},{0x00D7, 8},{0x00AB, 8},{0x00E4, 8}, + {0x00A9, 8},{0x0151, 9},{0x0150, 9},{0x02A9,10} + }, + { + {0x0008, 5},{0x0025, 7},{0x017A, 9},{0x02F7,10}, + {0x0BDB,12},{0x17B4,13},{0x2F6B,14},{0x001D, 5}, + {0x2F6A,14},{0x0008, 4},{0x0007, 4},{0x0001, 4}, + {0x0002, 4},{0x000A, 4},{0x0006, 4},{0x0000, 4}, + {0x001C, 5},{0x0009, 4},{0x000D, 4},{0x000F, 4}, + {0x000C, 4},{0x0003, 4},{0x000A, 5},{0x0016, 5}, + {0x0013, 6},{0x005D, 7},{0x0024, 7},{0x00BC, 8}, + {0x005C, 7},{0x05EC,11},{0x000B, 5},{0x005F, 7} + }, + { + {0x000F, 5},{0x0010, 6},{0x004B, 8},{0x00C6, 8}, + {0x031D,10},{0x0C71,12},{0x0C70,12},{0x0001, 4}, + {0x0C73,12},{0x0008, 4},{0x0009, 4},{0x0002, 4}, + {0x0003, 4},{0x000B, 4},{0x0006, 4},{0x0000, 4}, + {0x001C, 5},{0x0005, 4},{0x000D, 4},{0x000F, 4}, + {0x000A, 4},{0x0019, 5},{0x0013, 6},{0x001D, 5}, + {0x0030, 6},{0x0062, 7},{0x0024, 7},{0x004A, 8}, + {0x018F, 9},{0x0C72,12},{0x000E, 5},{0x0011, 6} + }, + { + {0x001B, 5},{0x0003, 6},{0x008D, 8},{0x0040, 7}, + {0x0239,10},{0x0471,11},{0x08E0,12},{0x0003, 4}, + {0x11C3,13},{0x000A, 4},{0x0009, 4},{0x0004, 4}, + {0x0005, 4},{0x000E, 4},{0x0007, 4},{0x0001, 4}, + {0x001E, 5},{0x0006, 4},{0x000C, 4},{0x000B, 4}, + {0x0002, 4},{0x0000, 5},{0x0041, 7},{0x001F, 5}, + {0x0022, 6},{0x0002, 6},{0x008F, 8},{0x008C, 8}, + {0x011D, 9},{0x11C2,13},{0x001A, 5},{0x0021, 6} + }, + { + {0x001F, 5},{0x0003, 6},{0x0003, 7},{0x0043, 7}, + {0x000B, 9},{0x0015,10},{0x0051,12},{0x0003, 4}, + {0x0050,12},{0x000D, 4},{0x000C, 4},{0x0004, 4}, + {0x0006, 4},{0x000E, 4},{0x000A, 4},{0x0001, 4}, + {0x001E, 5},{0x0005, 4},{0x0009, 4},{0x0007, 4}, + {0x0011, 5},{0x0002, 6},{0x0004, 8},{0x0002, 4}, + {0x002D, 6},{0x0020, 6},{0x0042, 7},{0x0001, 7}, + {0x0000, 7},{0x0029,11},{0x0017, 5},{0x002C, 6} + }, + { + {0x0003, 4},{0x001F, 6},{0x003A, 7},{0x005D, 7}, + {0x0173, 9},{0x02E4,10},{0x172D,13},{0x0004, 4}, + {0x172C,13},{0x000F, 4},{0x000E, 4},{0x0009, 4}, + {0x0008, 4},{0x000C, 4},{0x000A, 4},{0x0001, 4}, + {0x0016, 5},{0x0002, 4},{0x0005, 4},{0x001A, 5}, + {0x002F, 6},{0x0038, 7},{0x05CA,11},{0x0006, 4}, + {0x0037, 6},{0x001E, 6},{0x003B, 7},{0x0039, 7}, + {0x00B8, 8},{0x0B97,12},{0x0000, 4},{0x0036, 6} + }, + { + {0x0006, 4},{0x0037, 6},{0x005D, 7},{0x000C, 6}, + {0x00B9, 8},{0x02E3,10},{0x05C4,11},{0x0004, 4}, + {0x1715,13},{0x0000, 3},{0x000F, 4},{0x0008, 4}, + {0x0007, 4},{0x000C, 4},{0x0009, 4},{0x001D, 5}, + {0x0016, 5},{0x001C, 5},{0x001A, 5},{0x000B, 5}, + {0x005E, 7},{0x0170, 9},{0x1714,13},{0x000A, 4}, + {0x000A, 5},{0x0036, 6},{0x005F, 7},{0x001B, 7}, + {0x001A, 7},{0x0B8B,12},{0x0002, 4},{0x0007, 5} + }, + { + {0x000C, 4},{0x000B, 5},{0x0079, 7},{0x0022, 6}, + {0x00F0, 8},{0x0119, 9},{0x0230,10},{0x001D, 5}, + {0x08C4,12},{0x0001, 3},{0x0000, 3},{0x000A, 4}, + {0x0009, 4},{0x000B, 4},{0x0007, 4},{0x001C, 5}, + {0x003D, 6},{0x000D, 5},{0x0008, 5},{0x0015, 6}, + {0x008D, 8},{0x118B,13},{0x118A,13},{0x000D, 4}, + {0x0010, 5},{0x0009, 5},{0x0014, 6},{0x0047, 7}, + {0x00F1, 8},{0x0463,11},{0x001F, 5},{0x000C, 5} + }, + { + {0x0000, 3},{0x001A, 5},{0x0033, 6},{0x000C, 5}, + {0x0046, 7},{0x01E3, 9},{0x03C5,10},{0x0017, 5}, + {0x1E21,13},{0x0002, 3},{0x0001, 3},{0x0009, 4}, + {0x000A, 4},{0x0007, 4},{0x001B, 5},{0x003D, 6}, + {0x001B, 6},{0x0022, 6},{0x0079, 7},{0x00F0, 8}, + {0x1E20,13},{0x1E23,13},{0x1E22,13},{0x000E, 4}, + {0x0016, 5},{0x0018, 5},{0x0032, 6},{0x001A, 6}, + {0x0047, 7},{0x0789,11},{0x001F, 5},{0x0010, 5} + }, + { + {0x001D, 5},{0x0061, 7},{0x004E, 8},{0x009E, 9}, + {0x027C,11},{0x09F5,13},{0x09F4,13},{0x0003, 4}, + {0x0060, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4}, + {0x000A, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5}, + {0x0031, 6},{0x0008, 5},{0x0038, 6},{0x0012, 6}, + {0x0026, 7},{0x013F,10},{0x04FB,12},{0x000D, 4}, + {0x0002, 4},{0x000C, 5},{0x0039, 6},{0x001C, 6}, + {0x000F, 5},{0x001D, 6},{0x0008, 4},{0x0019, 5} + }, + { + {0x0007, 4},{0x0019, 6},{0x00AB, 8},{0x00AA, 8}, + {0x0119,10},{0x0461,12},{0x0460,12},{0x001B, 5}, + {0x0047, 8},{0x0001, 3},{0x0000, 3},{0x000C, 4}, + {0x000B, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5}, + {0x0035, 6},{0x003D, 6},{0x003C, 6},{0x0018, 6}, + {0x0022, 7},{0x008D, 9},{0x0231,11},{0x000E, 4}, + {0x001F, 5},{0x0009, 5},{0x002B, 6},{0x0010, 6}, + {0x0034, 6},{0x0054, 7},{0x0008, 4},{0x0014, 5} + }, + { + {0x000C, 4},{0x0005, 5},{0x0008, 6},{0x005B, 7}, + {0x004D, 9},{0x0131,11},{0x0261,12},{0x001A, 5}, + {0x0012, 7},{0x0000, 3},{0x000F, 4},{0x000A, 4}, + {0x0009, 4},{0x0006, 4},{0x001B, 5},{0x0006, 5}, + {0x001C, 6},{0x002C, 6},{0x0015, 6},{0x005A, 7}, + {0x0027, 8},{0x0099,10},{0x0260,12},{0x000E, 4}, + {0x0004, 4},{0x000F, 5},{0x0007, 5},{0x001D, 6}, + {0x000B, 5},{0x0014, 6},{0x0008, 4},{0x0017, 5} + }, + { + {0x000F, 4},{0x0013, 5},{0x0075, 7},{0x0024, 6}, + {0x0095, 8},{0x0251,10},{0x04A0,11},{0x0010, 5}, + {0x00C8, 8},{0x0002, 3},{0x0001, 3},{0x0001, 4}, + {0x0000, 4},{0x001A, 5},{0x0011, 5},{0x002C, 6}, + {0x0065, 7},{0x0074, 7},{0x004B, 7},{0x00C9, 8}, + {0x0129, 9},{0x0943,12},{0x0942,12},{0x0003, 3}, + {0x000A, 4},{0x001C, 5},{0x0018, 5},{0x0033, 6}, + {0x0017, 5},{0x002D, 6},{0x001B, 5},{0x003B, 6} + }, + { + {0x0003, 3},{0x001A, 5},{0x002D, 6},{0x0038, 6}, + {0x0028, 7},{0x0395,10},{0x0E51,12},{0x0037, 6}, + {0x00E4, 8},{0x0001, 3},{0x0000, 3},{0x001F, 5}, + {0x001E, 5},{0x0017, 5},{0x003A, 6},{0x0073, 7}, + {0x002A, 7},{0x002B, 7},{0x0029, 7},{0x01CB, 9}, + {0x0729,11},{0x1CA1,13},{0x1CA0,13},{0x0004, 3}, + {0x000A, 4},{0x0004, 4},{0x0018, 5},{0x0036, 6}, + {0x000B, 5},{0x002C, 6},{0x0019, 5},{0x003B, 6} + }, + { + {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0017, 5}, + {0x0075, 7},{0x01F5, 9},{0x07D1,11},{0x0017, 6}, + {0x01F6, 9},{0x0001, 3},{0x0000, 3},{0x001B, 5}, + {0x001A, 5},{0x000A, 5},{0x0032, 6},{0x0074, 7}, + {0x00F8, 8},{0x00F9, 8},{0x01F7, 9},{0x03E9,10}, + {0x0FA0,12},{0x1F43,13},{0x1F42,13},{0x0003, 3}, + {0x000A, 4},{0x001E, 5},{0x001C, 5},{0x003B, 6}, + {0x0018, 5},{0x0016, 6},{0x0016, 5},{0x0033, 6} + }, + { + {0x0004, 3},{0x0007, 4},{0x0018, 5},{0x001E, 5}, + {0x0036, 6},{0x0031, 7},{0x0177, 9},{0x0077, 7}, + {0x0176, 9},{0x0001, 3},{0x0000, 3},{0x001A, 5}, + {0x0019, 5},{0x003A, 6},{0x0019, 6},{0x005C, 7}, + {0x00BA, 8},{0x0061, 8},{0x00C1, 9},{0x0180,10}, + {0x0302,11},{0x0607,12},{0x0606,12},{0x0002, 3}, + {0x000A, 4},{0x001F, 5},{0x001C, 5},{0x0037, 6}, + {0x0016, 5},{0x0076, 7},{0x000D, 5},{0x002F, 6} + }, + { + {0x0000, 3},{0x000A, 4},{0x001A, 5},{0x000C, 4}, + {0x001D, 5},{0x0039, 6},{0x0078, 7},{0x005E, 7}, + {0x0393,11},{0x0002, 3},{0x0001, 3},{0x0016, 5}, + {0x000F, 5},{0x002E, 6},{0x005F, 7},{0x0073, 8}, + {0x00E5, 9},{0x01C8,10},{0x0E4A,13},{0x1C97,14}, + {0x1C96,14},{0x0E49,13},{0x0E48,13},{0x0004, 3}, + {0x0006, 4},{0x001F, 5},{0x001B, 5},{0x001D, 6}, + {0x0038, 6},{0x0038, 7},{0x003D, 6},{0x0079, 7} + }, + { + {0x000B, 5},{0x002B, 7},{0x0054, 8},{0x01B7, 9}, + {0x06D9,11},{0x0DB1,12},{0x0DB0,12},{0x0002, 4}, + {0x00AB, 9},{0x0009, 4},{0x000A, 4},{0x0007, 4}, + {0x0008, 4},{0x000F, 4},{0x000C, 4},{0x0003, 4}, + {0x001D, 5},{0x0004, 4},{0x000B, 4},{0x0006, 4}, + {0x001A, 5},{0x0003, 6},{0x00AA, 9},{0x0001, 4}, + {0x0000, 5},{0x0014, 6},{0x006C, 7},{0x00DA, 8}, + {0x0002, 6},{0x036D,10},{0x001C, 5},{0x0037, 6} + }, + { + {0x001D, 5},{0x0004, 6},{0x00B6, 8},{0x006A, 8}, + {0x05B9,11},{0x16E1,13},{0x16E0,13},{0x0007, 4}, + {0x016F, 9},{0x000C, 4},{0x000D, 4},{0x0009, 4}, + {0x0008, 4},{0x000F, 4},{0x000A, 4},{0x0003, 4}, + {0x0017, 5},{0x0002, 4},{0x0004, 4},{0x001C, 5}, + {0x002C, 6},{0x006B, 8},{0x0B71,12},{0x0005, 4}, + {0x0003, 5},{0x001B, 6},{0x005A, 7},{0x0034, 7}, + {0x0005, 6},{0x02DD,10},{0x0000, 4},{0x000C, 5} + }, + { + {0x0003, 4},{0x007F, 7},{0x00A1, 8},{0x00A0, 8}, + {0x020C,10},{0x0834,12},{0x106B,13},{0x0007, 4}, + {0x0082, 8},{0x000E, 4},{0x000D, 4},{0x000B, 4}, + {0x000C, 4},{0x0000, 3},{0x0009, 4},{0x0002, 4}, + {0x0011, 5},{0x001E, 5},{0x0015, 5},{0x003E, 6}, + {0x0040, 7},{0x041B,11},{0x106A,13},{0x0006, 4}, + {0x000A, 5},{0x0029, 6},{0x007E, 7},{0x0051, 7}, + {0x0021, 6},{0x0107, 9},{0x0004, 4},{0x000B, 5} + }, + { + {0x0007, 4},{0x001B, 6},{0x00F6, 8},{0x00E9, 8}, + {0x03A1,10},{0x0740,11},{0x0E82,12},{0x001F, 5}, + {0x01EF, 9},{0x0001, 3},{0x0002, 3},{0x000B, 4}, + {0x000C, 4},{0x000D, 4},{0x0008, 4},{0x001C, 5}, + {0x0003, 5},{0x0012, 5},{0x0002, 5},{0x0075, 7}, + {0x01D1, 9},{0x1D07,13},{0x1D06,13},{0x000A, 4}, + {0x0013, 5},{0x003B, 6},{0x001A, 6},{0x007A, 7}, + {0x003C, 6},{0x01EE, 9},{0x0000, 4},{0x000C, 5} + }, + { + {0x000D, 4},{0x003D, 6},{0x0042, 7},{0x0037, 7}, + {0x00D9, 9},{0x0362,11},{0x06C6,12},{0x001F, 5}, + {0x0086, 8},{0x0001, 3},{0x0002, 3},{0x000C, 4}, + {0x000B, 4},{0x000A, 4},{0x0001, 4},{0x000F, 5}, + {0x0025, 6},{0x003C, 6},{0x001A, 6},{0x0087, 8}, + {0x01B0,10},{0x0D8F,13},{0x0D8E,13},{0x000E, 4}, + {0x0013, 5},{0x000C, 5},{0x0024, 6},{0x0020, 6}, + {0x0011, 5},{0x006D, 8},{0x0000, 4},{0x000E, 5} + }, + { + {0x0000, 3},{0x0012, 5},{0x0076, 7},{0x0077, 7}, + {0x014D, 9},{0x0533,11},{0x14C9,13},{0x0013, 5}, + {0x00A5, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x0008, 4},{0x001A, 5},{0x002B, 6}, + {0x0075, 7},{0x0074, 7},{0x00A7, 8},{0x0298,10}, + {0x14C8,13},{0x14CB,13},{0x14CA,13},{0x000F, 4}, + {0x001C, 5},{0x0007, 5},{0x002A, 6},{0x0028, 6}, + {0x001B, 5},{0x00A4, 8},{0x0002, 4},{0x0006, 5} + }, + { + {0x0002, 3},{0x001A, 5},{0x002B, 6},{0x003A, 6}, + {0x00ED, 8},{0x0283,10},{0x0A0A,12},{0x0004, 5}, + {0x00A1, 8},{0x0004, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x001F, 5},{0x0006, 5},{0x0077, 7}, + {0x00A3, 8},{0x00A2, 8},{0x0140, 9},{0x1417,13}, + {0x1416,13},{0x0A09,12},{0x0A08,12},{0x0000, 3}, + {0x001E, 5},{0x0007, 5},{0x002A, 6},{0x0029, 6}, + {0x001C, 5},{0x00EC, 8},{0x001B, 5},{0x0005, 5} + }, + { + {0x0002, 3},{0x0002, 4},{0x0018, 5},{0x001D, 5}, + {0x0035, 6},{0x00E4, 8},{0x01CF,11},{0x001D, 7}, + {0x0072, 9},{0x0004, 3},{0x0005, 3},{0x0006, 4}, + {0x0007, 4},{0x0006, 5},{0x0073, 7},{0x0038, 8}, + {0x01CE,11},{0x039B,12},{0x0398,12},{0x0733,13}, + {0x0732,13},{0x0735,13},{0x0734,13},{0x0000, 3}, + {0x001F, 5},{0x001B, 5},{0x0034, 6},{0x000F, 6}, + {0x001E, 5},{0x00E5, 8},{0x0019, 5},{0x0038, 6} + }, + { + {0x0016, 5},{0x0050, 7},{0x0172, 9},{0x02E7,10}, + {0x1732,13},{0x2E67,14},{0x2E66,14},{0x0006, 4}, + {0x0051, 7},{0x0001, 3},{0x0000, 3},{0x000D, 4}, + {0x000C, 4},{0x0009, 4},{0x001C, 5},{0x0009, 5}, + {0x001C, 6},{0x001D, 6},{0x005D, 7},{0x00B8, 8}, + {0x05CD,11},{0x1731,13},{0x1730,13},{0x000F, 4}, + {0x0005, 4},{0x000F, 5},{0x0008, 5},{0x0029, 6}, + {0x001D, 5},{0x002F, 6},{0x0008, 4},{0x0015, 5} + }, + { + {0x0009, 4},{0x0021, 6},{0x0040, 7},{0x00AD, 8}, + {0x02B0,10},{0x1589,13},{0x1588,13},{0x001C, 5}, + {0x005F, 7},{0x0000, 3},{0x000F, 4},{0x000D, 4}, + {0x000C, 4},{0x0006, 4},{0x0011, 5},{0x002A, 6}, + {0x0057, 7},{0x005E, 7},{0x0041, 7},{0x0159, 9}, + {0x0563,11},{0x158B,13},{0x158A,13},{0x0001, 3}, + {0x0005, 4},{0x0014, 5},{0x003B, 6},{0x002E, 6}, + {0x0004, 4},{0x003A, 6},{0x0007, 4},{0x0016, 5} + }, + { + {0x000E, 4},{0x0007, 5},{0x0046, 7},{0x0045, 7}, + {0x0064, 9},{0x032A,12},{0x0657,13},{0x0018, 5}, + {0x000D, 6},{0x0000, 3},{0x000F, 4},{0x000A, 4}, + {0x000B, 4},{0x001A, 5},{0x0036, 6},{0x0047, 7}, + {0x0044, 7},{0x0018, 7},{0x0033, 8},{0x00CB,10}, + {0x0656,13},{0x0329,12},{0x0328,12},{0x0002, 3}, + {0x0006, 4},{0x0019, 5},{0x000E, 5},{0x0037, 6}, + {0x0009, 4},{0x000F, 5},{0x0002, 4},{0x0010, 5} + }, + { + {0x0003, 3},{0x0018, 5},{0x0023, 6},{0x0077, 7}, + {0x0194, 9},{0x1956,13},{0x32AF,14},{0x003A, 6}, + {0x0076, 7},{0x0002, 3},{0x0001, 3},{0x001F, 5}, + {0x001E, 5},{0x0014, 5},{0x0022, 6},{0x0064, 7}, + {0x0197, 9},{0x0196, 9},{0x032B,10},{0x0654,11}, + {0x32AE,14},{0x1955,13},{0x1954,13},{0x0000, 3}, + {0x0009, 4},{0x001C, 5},{0x0015, 5},{0x0010, 5}, + {0x000D, 4},{0x0017, 5},{0x0016, 5},{0x0033, 6} + }, + { + {0x0005, 3},{0x0006, 4},{0x003E, 6},{0x0010, 5}, + {0x0048, 7},{0x093F,12},{0x24FA,14},{0x0032, 6}, + {0x0067, 7},{0x0002, 3},{0x0001, 3},{0x001B, 5}, + {0x001E, 5},{0x0034, 6},{0x0066, 7},{0x0092, 8}, + {0x0126, 9},{0x024E,10},{0x049E,11},{0x49F7,15}, + {0x49F6,15},{0x24F9,14},{0x24F8,14},{0x0000, 3}, + {0x0007, 4},{0x0018, 5},{0x0011, 5},{0x003F, 6}, + {0x000E, 4},{0x0013, 5},{0x0035, 6},{0x0025, 6} + }, + { + {0x0005, 3},{0x0008, 4},{0x0012, 5},{0x001C, 5}, + {0x001C, 6},{0x00EA, 9},{0x1D75,14},{0x001E, 6}, + {0x0066, 7},{0x0001, 3},{0x0002, 3},{0x001B, 5}, + {0x001A, 5},{0x001F, 6},{0x003B, 7},{0x0074, 8}, + {0x01D6,10},{0x03AF,11},{0x1D74,14},{0x1D77,14}, + {0x1D76,14},{0x0EB9,13},{0x0EB8,13},{0x000F, 4}, + {0x0006, 4},{0x0013, 5},{0x003B, 6},{0x003A, 6}, + {0x0000, 3},{0x0018, 5},{0x0032, 6},{0x0067, 7} + }, + { + {0x0004, 3},{0x000A, 4},{0x001B, 5},{0x000C, 4}, + {0x000D, 5},{0x00E6, 8},{0x0684,11},{0x0072, 7}, + {0x00E7, 8},{0x0002, 3},{0x0001, 3},{0x0017, 5}, + {0x0016, 5},{0x0018, 6},{0x00D1, 8},{0x01A0, 9}, + {0x0686,11},{0x0D0F,12},{0x0D0A,12},{0x1A17,13}, + {0x1A16,13},{0x1A1D,13},{0x1A1C,13},{0x000F, 4}, + {0x001D, 5},{0x000E, 5},{0x0035, 6},{0x0038, 6}, + {0x0000, 3},{0x000F, 5},{0x0019, 6},{0x0069, 7} + }, + { + {0x0003, 3},{0x000C, 4},{0x001B, 5},{0x0000, 3}, + {0x0003, 4},{0x002E, 6},{0x0051, 9},{0x00BC, 8}, + {0x0053, 9},{0x0004, 3},{0x0002, 3},{0x0016, 5}, + {0x0015, 5},{0x0015, 7},{0x0050, 9},{0x00A4,10}, + {0x0294,12},{0x052B,13},{0x052A,13},{0x052D,13}, + {0x052C,13},{0x052F,13},{0x052E,13},{0x000E, 4}, + {0x001A, 5},{0x0004, 5},{0x0028, 6},{0x0029, 6}, + {0x000F, 4},{0x000B, 6},{0x005F, 7},{0x00BD, 8} + }, + { + {0x0003, 4},{0x0009, 6},{0x00D0, 8},{0x01A3, 9}, + {0x0344,10},{0x0D14,12},{0x1A2B,13},{0x0004, 4}, + {0x0015, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4}, + {0x000C, 4},{0x000E, 4},{0x0009, 4},{0x001B, 5}, + {0x000A, 5},{0x0014, 5},{0x000D, 5},{0x002A, 6}, + {0x0014, 7},{0x068B,11},{0x1A2A,13},{0x0008, 4}, + {0x000B, 5},{0x002B, 6},{0x000B, 6},{0x0069, 7}, + {0x0035, 6},{0x0008, 6},{0x0007, 4},{0x000C, 5} + }, + { + {0x000A, 4},{0x003C, 6},{0x0032, 7},{0x0030, 7}, + {0x00C5, 9},{0x0621,12},{0x0620,12},{0x001F, 5}, + {0x0033, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4}, + {0x000D, 4},{0x000C, 4},{0x0004, 4},{0x000D, 5}, + {0x0026, 6},{0x0027, 6},{0x0014, 6},{0x0063, 8}, + {0x0189,10},{0x0623,12},{0x0622,12},{0x000B, 4}, + {0x0012, 5},{0x003D, 6},{0x0022, 6},{0x0015, 6}, + {0x000B, 5},{0x0023, 6},{0x0007, 4},{0x0010, 5} + }, + { + {0x000F, 4},{0x000C, 5},{0x0043, 7},{0x0010, 6}, + {0x0044, 8},{0x0114,10},{0x0455,12},{0x0018, 5}, + {0x0023, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4}, + {0x000D, 4},{0x0009, 4},{0x0019, 5},{0x0009, 5}, + {0x0017, 6},{0x0016, 6},{0x0042, 7},{0x008B, 9}, + {0x0454,12},{0x0457,12},{0x0456,12},{0x000B, 4}, + {0x0015, 5},{0x000A, 5},{0x0029, 6},{0x0020, 6}, + {0x000D, 5},{0x0028, 6},{0x0007, 4},{0x0011, 5} + }, + { + {0x0001, 3},{0x001A, 5},{0x0029, 6},{0x002A, 6}, + {0x00A0, 8},{0x0285,10},{0x1425,13},{0x0002, 5}, + {0x0000, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4}, + {0x000B, 4},{0x0008, 4},{0x0012, 5},{0x0001, 6}, + {0x0051, 7},{0x0001, 7},{0x0143, 9},{0x0508,11}, + {0x1424,13},{0x1427,13},{0x1426,13},{0x000F, 4}, + {0x001C, 5},{0x0003, 5},{0x0037, 6},{0x002B, 6}, + {0x0013, 5},{0x0036, 6},{0x001D, 5},{0x0001, 5} + }, + { + {0x0004, 3},{0x001F, 5},{0x003D, 6},{0x0006, 5}, + {0x0016, 7},{0x0053, 9},{0x014A,11},{0x0034, 6}, + {0x002A, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4}, + {0x000C, 4},{0x001C, 5},{0x0037, 6},{0x0017, 7}, + {0x002B, 8},{0x0028, 8},{0x00A4,10},{0x052D,13}, + {0x052C,13},{0x052F,13},{0x052E,13},{0x0000, 3}, + {0x001D, 5},{0x0007, 5},{0x0004, 5},{0x0035, 6}, + {0x0014, 5},{0x0036, 6},{0x0015, 5},{0x003C, 6} + }, + { + {0x0004, 3},{0x000A, 4},{0x0007, 5},{0x001D, 5}, + {0x0009, 6},{0x01F3, 9},{0x07C7,11},{0x0008, 6}, + {0x01F0, 9},{0x0003, 3},{0x0002, 3},{0x000D, 4}, + {0x000C, 4},{0x0017, 5},{0x007D, 7},{0x01F2, 9}, + {0x07C6,11},{0x07C5,11},{0x1F12,13},{0x3E27,14}, + {0x3E26,14},{0x1F11,13},{0x1F10,13},{0x0000, 3}, + {0x001E, 5},{0x0006, 5},{0x0039, 6},{0x0038, 6}, + {0x003F, 6},{0x002C, 6},{0x0005, 5},{0x002D, 6} + }, + { + {0x0002, 3},{0x0007, 4},{0x0018, 5},{0x0003, 4}, + {0x0005, 5},{0x0035, 7},{0x004F, 9},{0x0012, 7}, + {0x04E5,13},{0x0005, 3},{0x0004, 3},{0x000D, 4}, + {0x000E, 4},{0x0033, 6},{0x0026, 8},{0x009D,10}, + {0x04E4,13},{0x04E7,13},{0x04E6,13},{0x04E1,13}, + {0x04E0,13},{0x04E3,13},{0x04E2,13},{0x0000, 3}, + {0x001F, 5},{0x000C, 5},{0x003D, 6},{0x003C, 6}, + {0x0032, 6},{0x0034, 7},{0x001B, 6},{0x0008, 6} + }, + { + {0x0000, 3},{0x0004, 4},{0x001C, 5},{0x000F, 4}, + {0x0002, 4},{0x0007, 5},{0x0075, 7},{0x00E8, 8}, + {0x1D2A,13},{0x0005, 3},{0x0004, 3},{0x000D, 4}, + {0x000C, 4},{0x0077, 7},{0x0E96,12},{0x3A57,14}, + {0x3A56,14},{0x3A5D,14},{0x3A5C,14},{0x3A5F,14}, + {0x3A5E,14},{0x1D29,13},{0x1D28,13},{0x0003, 3}, + {0x0006, 5},{0x000A, 5},{0x002C, 7},{0x0017, 6}, + {0x0076, 7},{0x01D3, 9},{0x03A4,10},{0x002D, 7} + }, + { + {0x000A, 4},{0x0024, 6},{0x00BF, 8},{0x0085, 8}, + {0x0211,10},{0x0842,12},{0x1087,13},{0x0018, 5}, + {0x0020, 6},{0x0001, 3},{0x0002, 3},{0x000E, 4}, + {0x000D, 4},{0x0007, 4},{0x0013, 5},{0x0025, 6}, + {0x005E, 7},{0x0043, 7},{0x00BE, 8},{0x0109, 9}, + {0x1086,13},{0x0841,12},{0x0840,12},{0x000F, 4}, + {0x0001, 4},{0x0011, 5},{0x0000, 5},{0x002E, 6}, + {0x0019, 5},{0x0001, 5},{0x0006, 4},{0x0016, 5} + }, + { + {0x0002, 3},{0x000F, 5},{0x006F, 7},{0x0061, 7}, + {0x0374,10},{0x1BA8,13},{0x3753,14},{0x0012, 5}, + {0x0036, 6},{0x0000, 3},{0x0001, 3},{0x000A, 4}, + {0x000B, 4},{0x001A, 5},{0x0031, 6},{0x0060, 7}, + {0x00DC, 8},{0x01BB, 9},{0x06EB,11},{0x1BAB,13}, + {0x3752,14},{0x3755,14},{0x3754,14},{0x000E, 4}, + {0x0006, 4},{0x0013, 5},{0x000E, 5},{0x003E, 6}, + {0x0008, 4},{0x001E, 5},{0x0019, 5},{0x003F, 6} + }, + { + {0x0003, 3},{0x001C, 5},{0x0025, 6},{0x0024, 6}, + {0x01DA, 9},{0x1DBD,13},{0x3B7C,14},{0x003C, 6}, + {0x003D, 6},{0x0000, 3},{0x0001, 3},{0x000B, 4}, + {0x000A, 4},{0x000B, 5},{0x0077, 7},{0x00EC, 8}, + {0x03B6,10},{0x076E,11},{0x1DBF,13},{0x76FB,15}, + {0x76FA,15},{0x3B79,14},{0x3B78,14},{0x000D, 4}, + {0x001F, 5},{0x0013, 5},{0x000A, 5},{0x0008, 5}, + {0x000C, 4},{0x0008, 4},{0x0009, 5},{0x003A, 6} + }, + { + {0x0005, 3},{0x0003, 4},{0x0004, 5},{0x0010, 5}, + {0x008F, 8},{0x0475,11},{0x11D1,13},{0x0079, 7}, + {0x0027, 6},{0x0002, 3},{0x0003, 3},{0x0001, 4}, + {0x0000, 4},{0x0026, 6},{0x0046, 7},{0x011C, 9}, + {0x0477,11},{0x08ED,12},{0x11D0,13},{0x11D3,13}, + {0x11D2,13},{0x11D9,13},{0x11D8,13},{0x000D, 4}, + {0x001F, 5},{0x0012, 5},{0x0005, 5},{0x003D, 6}, + {0x000C, 4},{0x000E, 4},{0x0022, 6},{0x0078, 7} + }, + { + {0x0005, 3},{0x000C, 4},{0x001B, 5},{0x0000, 4}, + {0x0006, 6},{0x03E2,10},{0x3E3D,14},{0x000F, 7}, + {0x0034, 6},{0x0003, 3},{0x0002, 3},{0x001E, 5}, + {0x001D, 5},{0x007D, 7},{0x01F0, 9},{0x07C6,11}, + {0x3E3C,14},{0x3E3F,14},{0x3E3E,14},{0x3E39,14}, + {0x3E38,14},{0x3E3B,14},{0x3E3A,14},{0x0008, 4}, + {0x001C, 5},{0x0002, 5},{0x003F, 6},{0x0035, 6}, + {0x0009, 4},{0x0001, 3},{0x000E, 7},{0x00F9, 8} + }, + { + {0x0004, 3},{0x000B, 4},{0x0001, 4},{0x000A, 4}, + {0x001E, 6},{0x00E0, 9},{0x0E1E,13},{0x0071, 8}, + {0x0039, 7},{0x0007, 3},{0x0006, 3},{0x000D, 5}, + {0x000C, 5},{0x0020, 7},{0x01C2,10},{0x1C3F,14}, + {0x1C3E,14},{0x0E19,13},{0x0E18,13},{0x0E1B,13}, + {0x0E1A,13},{0x0E1D,13},{0x0E1C,13},{0x0000, 4}, + {0x0009, 5},{0x001D, 6},{0x001F, 6},{0x0011, 6}, + {0x0005, 4},{0x0001, 3},{0x0043, 8},{0x0042, 8} + }, + { + {0x0004, 3},{0x000D, 4},{0x0007, 4},{0x0002, 3}, + {0x0014, 5},{0x016C, 9},{0x16D1,13},{0x02DF,10}, + {0x016E, 9},{0x0000, 2},{0x0007, 3},{0x002C, 6}, + {0x002B, 6},{0x02DE,10},{0x16D0,13},{0x16D3,13}, + {0x16D2,13},{0x2DB5,14},{0x2DB4,14},{0x2DB7,14}, + {0x2DB6,14},{0x16D9,13},{0x16D8,13},{0x000C, 5}, + {0x002A, 6},{0x005A, 7},{0x001B, 6},{0x001A, 6}, + {0x0017, 5},{0x000C, 4},{0x05B7,11},{0x05B5,11} + }, + { + {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4}, + {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14}, + {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7}, + {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14}, + {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14}, + {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9}, + {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8}, + {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14} + }, + { + {0x0000, 3},{0x0010, 5},{0x0072, 7},{0x0071, 7}, + {0x0154, 9},{0x0AAB,12},{0x0AA8,12},{0x0014, 5}, + {0x0070, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4}, + {0x000B, 4},{0x0003, 4},{0x0011, 5},{0x0073, 7}, + {0x0054, 7},{0x00AB, 8},{0x02AB,10},{0x1553,13}, + {0x1552,13},{0x1555,13},{0x1554,13},{0x000D, 4}, + {0x001E, 5},{0x0012, 5},{0x003E, 6},{0x002B, 6}, + {0x0002, 4},{0x003F, 6},{0x001D, 5},{0x0013, 5} + }, + { + {0x0003, 3},{0x001F, 5},{0x0029, 6},{0x003D, 6}, + {0x000C, 7},{0x0069,10},{0x0345,13},{0x0002, 5}, + {0x0028, 6},{0x0002, 3},{0x0001, 3},{0x000E, 4}, + {0x000C, 4},{0x0015, 5},{0x0007, 6},{0x001B, 8}, + {0x006B,10},{0x006A,10},{0x0344,13},{0x0347,13}, + {0x0346,13},{0x01A1,12},{0x01A0,12},{0x000B, 4}, + {0x001A, 5},{0x0012, 5},{0x0000, 5},{0x003C, 6}, + {0x0008, 4},{0x001B, 5},{0x0013, 5},{0x0001, 5} + }, + { + {0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0014, 5}, + {0x0056, 7},{0x015C, 9},{0x15D5,13},{0x003C, 6}, + {0x002A, 6},{0x0000, 3},{0x0001, 3},{0x000E, 4}, + {0x000D, 4},{0x000C, 5},{0x00AF, 8},{0x02BB,10}, + {0x15D4,13},{0x15D7,13},{0x15D6,13},{0x15D1,13}, + {0x15D0,13},{0x15D3,13},{0x15D2,13},{0x000B, 4}, + {0x0019, 5},{0x000D, 5},{0x003E, 6},{0x0031, 6}, + {0x0007, 4},{0x0005, 4},{0x003D, 6},{0x0030, 6} + }, + { + {0x0005, 3},{0x0008, 4},{0x001A, 5},{0x0000, 4}, + {0x0036, 6},{0x0011, 8},{0x0106,12},{0x000A, 7}, + {0x006E, 7},{0x0002, 3},{0x0003, 3},{0x0003, 4}, + {0x0002, 4},{0x006F, 7},{0x0021, 9},{0x020F,13}, + {0x020E,13},{0x0101,12},{0x0100,12},{0x0103,12}, + {0x0102,12},{0x0105,12},{0x0104,12},{0x000C, 4}, + {0x001E, 5},{0x0003, 5},{0x003E, 6},{0x003F, 6}, + {0x0009, 4},{0x000E, 4},{0x000B, 7},{0x0009, 7} + }, + { + {0x0002, 3},{0x000E, 4},{0x001E, 5},{0x000C, 4}, + {0x001F, 5},{0x006E, 7},{0x00AD,10},{0x00AF,10}, + {0x0014, 7},{0x0004, 3},{0x0003, 3},{0x001A, 5}, + {0x0017, 5},{0x002A, 8},{0x0576,13},{0x0AEF,14}, + {0x0AEE,14},{0x0571,13},{0x0570,13},{0x0573,13}, + {0x0572,13},{0x0575,13},{0x0574,13},{0x0003, 4}, + {0x0016, 5},{0x0004, 5},{0x0036, 6},{0x000B, 6}, + {0x000A, 4},{0x0000, 3},{0x006F, 7},{0x00AC,10} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3}, + {0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13}, + {0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6}, + {0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13}, + {0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13}, + {0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3}, + {0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8}, + {0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14} + }, + { + {0x0003, 3},{0x0011, 5},{0x0020, 6},{0x0074, 7}, + {0x010D, 9},{0x0863,12},{0x0860,12},{0x000A, 5}, + {0x0075, 7},{0x0001, 3},{0x0000, 3},{0x000B, 4}, + {0x000A, 4},{0x0018, 5},{0x0038, 6},{0x0042, 7}, + {0x010F, 9},{0x010E, 9},{0x0219,10},{0x10C3,13}, + {0x10C2,13},{0x10C5,13},{0x10C4,13},{0x000F, 4}, + {0x0004, 4},{0x0019, 5},{0x000B, 5},{0x0039, 6}, + {0x0009, 4},{0x001B, 5},{0x001A, 5},{0x003B, 6} + }, + { + {0x0005, 3},{0x0001, 4},{0x003E, 6},{0x0001, 5}, + {0x00E2, 8},{0x1C6F,13},{0x38D9,14},{0x0039, 6}, + {0x001F, 6},{0x0002, 3},{0x0001, 3},{0x0009, 4}, + {0x0008, 4},{0x0000, 5},{0x0070, 7},{0x01C7, 9}, + {0x038C,10},{0x071A,11},{0x38D8,14},{0x38DB,14}, + {0x38DA,14},{0x38DD,14},{0x38DC,14},{0x000D, 4}, + {0x001D, 5},{0x000E, 5},{0x003F, 6},{0x003C, 6}, + {0x000C, 4},{0x0006, 4},{0x003D, 6},{0x001E, 6} + }, + { + {0x0006, 3},{0x000B, 4},{0x0011, 5},{0x001E, 5}, + {0x0074, 7},{0x03AA,10},{0x1D5C,13},{0x0001, 6}, + {0x0021, 6},{0x0001, 3},{0x0002, 3},{0x0007, 4}, + {0x0006, 4},{0x003E, 6},{0x00EB, 8},{0x01D4, 9}, + {0x0EAF,12},{0x3ABB,14},{0x3ABA,14},{0x1D59,13}, + {0x1D58,13},{0x1D5B,13},{0x1D5A,13},{0x000A, 4}, + {0x001C, 5},{0x0001, 5},{0x003F, 6},{0x003B, 6}, + {0x0001, 4},{0x0009, 4},{0x0020, 6},{0x0000, 6} + }, + { + {0x0004, 3},{0x000A, 4},{0x0017, 5},{0x0004, 4}, + {0x0016, 6},{0x016A, 9},{0x16B1,13},{0x0017, 7}, + {0x005B, 7},{0x0006, 3},{0x0007, 3},{0x0001, 4}, + {0x0000, 4},{0x000A, 6},{0x02D7,10},{0x0B5A,12}, + {0x16B0,13},{0x16B3,13},{0x16B2,13},{0x2D6D,14}, + {0x2D6C,14},{0x2D6F,14},{0x2D6E,14},{0x0006, 4}, + {0x000A, 5},{0x0004, 5},{0x002C, 6},{0x0017, 6}, + {0x0003, 4},{0x0007, 4},{0x0016, 7},{0x00B4, 8} + }, + { + {0x0005, 3},{0x000D, 4},{0x0005, 4},{0x0009, 4}, + {0x0033, 6},{0x0193, 9},{0x192C,13},{0x0061, 8}, + {0x0031, 7},{0x0000, 2},{0x0007, 3},{0x0010, 5}, + {0x0011, 5},{0x00C8, 8},{0x192F,13},{0x325B,14}, + {0x325A,14},{0x1929,13},{0x1928,13},{0x192B,13}, + {0x192A,13},{0x325D,14},{0x325C,14},{0x0018, 5}, + {0x001A, 6},{0x001B, 6},{0x0065, 7},{0x0019, 6}, + {0x0004, 4},{0x0007, 4},{0x0060, 8},{0x0324,10} + }, + { + {0x0006, 3},{0x0000, 3},{0x0002, 4},{0x000F, 4}, + {0x0039, 6},{0x01D9, 9},{0x1D82,13},{0x0761,11}, + {0x03BE,10},{0x0001, 2},{0x0002, 2},{0x000F, 6}, + {0x000E, 6},{0x0762,11},{0x3B07,14},{0x3B06,14}, + {0x3B1D,14},{0x3B1C,14},{0x3B1F,14},{0x3B1E,14}, + {0x3B19,14},{0x3B18,14},{0x3B1B,14},{0x0038, 6}, + {0x01DE, 9},{0x00ED, 8},{0x03BF,10},{0x00EE, 8}, + {0x003A, 6},{0x0006, 5},{0x0EC0,12},{0x3B1A,14} + }, + { + {0x0000, 2},{0x0002, 3},{0x000F, 5},{0x0006, 4}, + {0x001C, 6},{0x01D0,10},{0x0E8C,13},{0x1D1B,14}, + {0x1D1A,14},{0x0003, 2},{0x0002, 2},{0x00EA, 9}, + {0x00E9, 9},{0x0E89,13},{0x0E88,13},{0x0E8B,13}, + {0x0E8A,13},{0x1D65,14},{0x1D64,14},{0x1D67,14}, + {0x1D66,14},{0x1D61,14},{0x1D60,14},{0x03AD,11}, + {0x1D63,14},{0x1D62,14},{0x1D1D,14},{0x1D1C,14}, + {0x003B, 7},{0x01D7,10},{0x1D1F,14},{0x1D1E,14} + }, + { + {0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4}, + {0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14}, + {0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7}, + {0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14}, + {0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14}, + {0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9}, + {0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8}, + {0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14} + } +}; + + + +/*A description of a Huffman code value used when encoding the tree.*/ +typedef struct{ + /*The bit pattern, left-shifted so that the MSB of all patterns is + aligned.*/ + ogg_uint32_t pattern; + /*The amount the bit pattern was shifted.*/ + int shift; + /*The token this bit pattern represents.*/ + int token; +}oc_huff_entry; + + + +/*Compares two oc_huff_entry structures by their bit patterns. + _c1: The first entry to compare. + _c2: The second entry to compare. + Return: <0 if _c1<_c2, >0 if _c1>_c2.*/ +static int huff_entry_cmp(const void *_c1,const void *_c2){ + ogg_uint32_t b1; + ogg_uint32_t b2; + b1=((const oc_huff_entry *)_c1)->pattern; + b2=((const oc_huff_entry *)_c2)->pattern; + return b1b2?1:0; +} + +/*Encodes a description of the given Huffman tables. + Although the codes are stored in the encoder as flat arrays, in the bit + stream and in the decoder they are structured as a tree. + This function recovers the tree structure from the flat array and then + writes it out. + Note that the codes MUST form a Huffman code, and not merely a prefix-free + code, since the binary tree is assumed to be full. + _opb: The buffer to store the tree in. + _codes: The Huffman tables to pack. + Return: 0 on success, or a negative value if one of the given Huffman tables + does not form a full, prefix-free code.*/ +int oc_huff_codes_pack(oggpack_buffer *_opb, + const th_huff_code _codes[TH_NHUFFMAN_TABLES][TH_NDCT_TOKENS]){ + int i; + for(i=0;i>1)<<(maxlen+1>>1))-1; + /*Copy over the codes into our temporary workspace. + The bit patterns are aligned, and the original entry each code is from + is stored as well.*/ + for(j=0;jentries[j].shift;bpos--)oggpackB_write(_opb,0,1); + /*Mark this as a leaf node, and write its value.*/ + oggpackB_write(_opb,1,1); + oggpackB_write(_opb,entries[j].token,5); + /*For each 1 branch we've descended, back up the tree until we reach a + 0 branch.*/ + bit=1< +#include "internal.h" +#include "dct.h" + +/*Performs an inverse 8 point Type-II DCT transform. + The output is scaled by a factor of 2 relative to the orthonormal version of + the transform. + _y: The buffer to store the result in. + Data will be placed in every 8th entry (e.g., in a column of an 8x8 + block). + _x: The input coefficients. + The first 8 entries are used (e.g., from a row of an 8x8 block).*/ +static void idct8(ogg_int16_t *_y,const ogg_int16_t _x[8]){ + ogg_int32_t t[8]; + ogg_int32_t r; + /*Stage 1:*/ + /*0-1 butterfly.*/ + t[0]=OC_C4S4*(ogg_int16_t)(_x[0]+_x[4])>>16; + t[1]=OC_C4S4*(ogg_int16_t)(_x[0]-_x[4])>>16; + /*2-3 rotation by 6pi/16.*/ + t[2]=(OC_C6S2*_x[2]>>16)-(OC_C2S6*_x[6]>>16); + t[3]=(OC_C2S6*_x[2]>>16)+(OC_C6S2*_x[6]>>16); + /*4-7 rotation by 7pi/16.*/ + t[4]=(OC_C7S1*_x[1]>>16)-(OC_C1S7*_x[7]>>16); + /*5-6 rotation by 3pi/16.*/ + t[5]=(OC_C3S5*_x[5]>>16)-(OC_C5S3*_x[3]>>16); + t[6]=(OC_C5S3*_x[5]>>16)+(OC_C3S5*_x[3]>>16); + t[7]=(OC_C1S7*_x[1]>>16)+(OC_C7S1*_x[7]>>16); + /*Stage 2:*/ + /*4-5 butterfly.*/ + r=t[4]+t[5]; + t[5]=OC_C4S4*(ogg_int16_t)(t[4]-t[5])>>16; + t[4]=r; + /*7-6 butterfly.*/ + r=t[7]+t[6]; + t[6]=OC_C4S4*(ogg_int16_t)(t[7]-t[6])>>16; + t[7]=r; + /*Stage 3:*/ + /*0-3 butterfly.*/ + r=t[0]+t[3]; + t[3]=t[0]-t[3]; + t[0]=r; + /*1-2 butterfly.*/ + r=t[1]+t[2]; + t[2]=t[1]-t[2]; + t[1]=r; + /*6-5 butterfly.*/ + r=t[6]+t[5]; + t[5]=t[6]-t[5]; + t[6]=r; + /*Stage 4:*/ + /*0-7 butterfly.*/ + _y[0<<3]=(ogg_int16_t)(t[0]+t[7]); + /*1-6 butterfly.*/ + _y[1<<3]=(ogg_int16_t)(t[1]+t[6]); + /*2-5 butterfly.*/ + _y[2<<3]=(ogg_int16_t)(t[2]+t[5]); + /*3-4 butterfly.*/ + _y[3<<3]=(ogg_int16_t)(t[3]+t[4]); + _y[4<<3]=(ogg_int16_t)(t[3]-t[4]); + _y[5<<3]=(ogg_int16_t)(t[2]-t[5]); + _y[6<<3]=(ogg_int16_t)(t[1]-t[6]); + _y[7<<3]=(ogg_int16_t)(t[0]-t[7]); +} + +/*Performs an inverse 8 point Type-II DCT transform. + The output is scaled by a factor of 2 relative to the orthonormal version of + the transform. + _y: The buffer to store the result in. + Data will be placed in every 8th entry (e.g., in a column of an 8x8 + block). + _x: The input coefficients. + Only the first 4 entries are used. + The other 4 are assumed to be 0.*/ +static void idct8_4(ogg_int16_t *_y,const ogg_int16_t _x[8]){ + ogg_int32_t t[8]; + ogg_int32_t r; + /*Stage 1:*/ + t[0]=OC_C4S4*_x[0]>>16; + t[2]=OC_C6S2*_x[2]>>16; + t[3]=OC_C2S6*_x[2]>>16; + t[4]=OC_C7S1*_x[1]>>16; + t[5]=-(OC_C5S3*_x[3]>>16); + t[6]=OC_C3S5*_x[3]>>16; + t[7]=OC_C1S7*_x[1]>>16; + /*Stage 2:*/ + r=t[4]+t[5]; + t[5]=OC_C4S4*(ogg_int16_t)(t[4]-t[5])>>16; + t[4]=r; + r=t[7]+t[6]; + t[6]=OC_C4S4*(ogg_int16_t)(t[7]-t[6])>>16; + t[7]=r; + /*Stage 3:*/ + t[1]=t[0]+t[2]; + t[2]=t[0]-t[2]; + r=t[0]+t[3]; + t[3]=t[0]-t[3]; + t[0]=r; + r=t[6]+t[5]; + t[5]=t[6]-t[5]; + t[6]=r; + /*Stage 4:*/ + _y[0<<3]=(ogg_int16_t)(t[0]+t[7]); + _y[1<<3]=(ogg_int16_t)(t[1]+t[6]); + _y[2<<3]=(ogg_int16_t)(t[2]+t[5]); + _y[3<<3]=(ogg_int16_t)(t[3]+t[4]); + _y[4<<3]=(ogg_int16_t)(t[3]-t[4]); + _y[5<<3]=(ogg_int16_t)(t[2]-t[5]); + _y[6<<3]=(ogg_int16_t)(t[1]-t[6]); + _y[7<<3]=(ogg_int16_t)(t[0]-t[7]); +} + +/*Performs an inverse 8 point Type-II DCT transform. + The output is scaled by a factor of 2 relative to the orthonormal version of + the transform. + _y: The buffer to store the result in. + Data will be placed in every 8th entry (e.g., in a column of an 8x8 + block). + _x: The input coefficients. + Only the first 3 entries are used. + The other 5 are assumed to be 0.*/ +static void idct8_3(ogg_int16_t *_y,const ogg_int16_t _x[8]){ + ogg_int32_t t[8]; + ogg_int32_t r; + /*Stage 1:*/ + t[0]=OC_C4S4*_x[0]>>16; + t[2]=OC_C6S2*_x[2]>>16; + t[3]=OC_C2S6*_x[2]>>16; + t[4]=OC_C7S1*_x[1]>>16; + t[7]=OC_C1S7*_x[1]>>16; + /*Stage 2:*/ + t[5]=OC_C4S4*t[4]>>16; + t[6]=OC_C4S4*t[7]>>16; + /*Stage 3:*/ + t[1]=t[0]+t[2]; + t[2]=t[0]-t[2]; + r=t[0]+t[3]; + t[3]=t[0]-t[3]; + t[0]=r; + r=t[6]+t[5]; + t[5]=t[6]-t[5]; + t[6]=r; + /*Stage 4:*/ + _y[0<<3]=(ogg_int16_t)(t[0]+t[7]); + _y[1<<3]=(ogg_int16_t)(t[1]+t[6]); + _y[2<<3]=(ogg_int16_t)(t[2]+t[5]); + _y[3<<3]=(ogg_int16_t)(t[3]+t[4]); + _y[4<<3]=(ogg_int16_t)(t[3]-t[4]); + _y[5<<3]=(ogg_int16_t)(t[2]-t[5]); + _y[6<<3]=(ogg_int16_t)(t[1]-t[6]); + _y[7<<3]=(ogg_int16_t)(t[0]-t[7]); +} + +/*Performs an inverse 8 point Type-II DCT transform. + The output is scaled by a factor of 2 relative to the orthonormal version of + the transform. + _y: The buffer to store the result in. + Data will be placed in every 8th entry (e.g., in a column of an 8x8 + block). + _x: The input coefficients. + Only the first 2 entries are used. + The other 6 are assumed to be 0.*/ +static void idct8_2(ogg_int16_t *_y,const ogg_int16_t _x[8]){ + ogg_int32_t t[8]; + ogg_int32_t r; + /*Stage 1:*/ + t[0]=OC_C4S4*_x[0]>>16; + t[4]=OC_C7S1*_x[1]>>16; + t[7]=OC_C1S7*_x[1]>>16; + /*Stage 2:*/ + t[5]=OC_C4S4*t[4]>>16; + t[6]=OC_C4S4*t[7]>>16; + /*Stage 3:*/ + r=t[6]+t[5]; + t[5]=t[6]-t[5]; + t[6]=r; + /*Stage 4:*/ + _y[0<<3]=(ogg_int16_t)(t[0]+t[7]); + _y[1<<3]=(ogg_int16_t)(t[0]+t[6]); + _y[2<<3]=(ogg_int16_t)(t[0]+t[5]); + _y[3<<3]=(ogg_int16_t)(t[0]+t[4]); + _y[4<<3]=(ogg_int16_t)(t[0]-t[4]); + _y[5<<3]=(ogg_int16_t)(t[0]-t[5]); + _y[6<<3]=(ogg_int16_t)(t[0]-t[6]); + _y[7<<3]=(ogg_int16_t)(t[0]-t[7]); +} + +/*Performs an inverse 8 point Type-II DCT transform. + The output is scaled by a factor of 2 relative to the orthonormal version of + the transform. + _y: The buffer to store the result in. + Data will be placed in every 8th entry (e.g., in a column of an 8x8 + block). + _x: The input coefficients. + Only the first entry is used. + The other 7 are assumed to be 0.*/ +static void idct8_1(ogg_int16_t *_y,const ogg_int16_t _x[1]){ + _y[0<<3]=_y[1<<3]=_y[2<<3]=_y[3<<3]= + _y[4<<3]=_y[5<<3]=_y[6<<3]=_y[7<<3]=(ogg_int16_t)(OC_C4S4*_x[0]>>16); +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform. + All coefficients but the first 3 in zig-zag scan order are assumed to be 0: + x x 0 0 0 0 0 0 + x 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 + _y: The buffer to store the result in. + This may be the same as _x. + _x: The input coefficients.*/ +static void oc_idct8x8_3(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + const ogg_int16_t *in; + ogg_int16_t *end; + ogg_int16_t *out; + ogg_int16_t w[64]; + /*Transform rows of x into columns of w.*/ + idct8_2(w,_x); + idct8_1(w+1,_x+8); + /*Transform rows of w into columns of y.*/ + for(in=w,out=_y,end=out+8;out>4); +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform. + All coefficients but the first 10 in zig-zag scan order are assumed to be 0: + x x x x 0 0 0 0 + x x x 0 0 0 0 0 + x x 0 0 0 0 0 0 + x 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 + _y: The buffer to store the result in. + This may be the same as _x. + _x: The input coefficients.*/ +static void oc_idct8x8_10(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + const ogg_int16_t *in; + ogg_int16_t *end; + ogg_int16_t *out; + ogg_int16_t w[64]; + /*Transform rows of x into columns of w.*/ + idct8_4(w,_x); + idct8_3(w+1,_x+8); + idct8_2(w+2,_x+16); + idct8_1(w+3,_x+24); + /*Transform rows of w into columns of y.*/ + for(in=w,out=_y,end=out+8;out>4); +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform. + _y: The buffer to store the result in. + This may be the same as _x. + _x: The input coefficients.*/ +static void oc_idct8x8_slow(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + const ogg_int16_t *in; + ogg_int16_t *end; + ogg_int16_t *out; + ogg_int16_t w[64]; + /*Transform rows of x into columns of w.*/ + for(in=_x,out=w,end=out+8;out>4); +} + +void oc_idct8x8(const oc_theora_state *_state,ogg_int16_t _y[64], + int _last_zzi){ + (*_state->opt_vtable.idct8x8)(_y,_last_zzi); +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform.*/ +void oc_idct8x8_c(ogg_int16_t _y[64],int _last_zzi){ + /*_last_zzi is subtly different from an actual count of the number of + coefficients we decoded for this block. + It contains the value of zzi BEFORE the final token in the block was + decoded. + In most cases this is an EOB token (the continuation of an EOB run from a + previous block counts), and so this is the same as the coefficient count. + However, in the case that the last token was NOT an EOB token, but filled + the block up with exactly 64 coefficients, _last_zzi will be less than 64. + Provided the last token was not a pure zero run, the minimum value it can + be is 46, and so that doesn't affect any of the cases in this routine. + However, if the last token WAS a pure zero run of length 63, then _last_zzi + will be 1 while the number of coefficients decoded is 64. + Thus, we will trigger the following special case, where the real + coefficient count would not. + Note also that a zero run of length 64 will give _last_zzi a value of 0, + but we still process the DC coefficient, which might have a non-zero value + due to DC prediction. + Although convoluted, this is arguably the correct behavior: it allows us to + use a smaller transform when the block ends with a long zero run instead + of a normal EOB token. + It could be smarter... multiple separate zero runs at the end of a block + will fool it, but an encoder that generates these really deserves what it + gets. + Needless to say we inherited this approach from VP3.*/ + /*Then perform the iDCT.*/ + if(_last_zzi<3)oc_idct8x8_3(_y,_y); + else if(_last_zzi<10)oc_idct8x8_10(_y,_y); + else oc_idct8x8_slow(_y,_y); +} diff --git a/libs/libtheora-1.1/lib/info.c b/libs/libtheora-1.1/lib/info.c new file mode 100644 index 00000000..c31e15c2 --- /dev/null +++ b/libs/libtheora-1.1/lib/info.c @@ -0,0 +1,131 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: info.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include +#include "internal.h" + + + +/*This is more or less the same as strncasecmp, but that doesn't exist + everywhere, and this is a fairly trivial function, so we include it. + Note: We take advantage of the fact that we know _n is less than or equal to + the length of at least one of the strings.*/ +static int oc_tagcompare(const char *_s1,const char *_s2,int _n){ + int c; + for(c=0;c<_n;c++){ + if(toupper(_s1[c])!=toupper(_s2[c]))return !0; + } + return _s1[c]!='='; +} + + + +void th_info_init(th_info *_info){ + memset(_info,0,sizeof(*_info)); + _info->version_major=TH_VERSION_MAJOR; + _info->version_minor=TH_VERSION_MINOR; + _info->version_subminor=TH_VERSION_SUB; + _info->keyframe_granule_shift=6; +} + +void th_info_clear(th_info *_info){ + memset(_info,0,sizeof(*_info)); +} + + + +void th_comment_init(th_comment *_tc){ + memset(_tc,0,sizeof(*_tc)); +} + +void th_comment_add(th_comment *_tc,char *_comment){ + char **user_comments; + int *comment_lengths; + int comment_len; + user_comments=_ogg_realloc(_tc->user_comments, + (_tc->comments+2)*sizeof(*_tc->user_comments)); + if(user_comments==NULL)return; + _tc->user_comments=user_comments; + comment_lengths=_ogg_realloc(_tc->comment_lengths, + (_tc->comments+2)*sizeof(*_tc->comment_lengths)); + if(comment_lengths==NULL)return; + _tc->comment_lengths=comment_lengths; + comment_len=strlen(_comment); + comment_lengths[_tc->comments]=comment_len; + user_comments[_tc->comments]=_ogg_malloc(comment_len+1); + if(user_comments[_tc->comments]==NULL)return; + memcpy(_tc->user_comments[_tc->comments],_comment,comment_len+1); + _tc->comments++; + _tc->user_comments[_tc->comments]=NULL; +} + +void th_comment_add_tag(th_comment *_tc,char *_tag,char *_val){ + char *comment; + int tag_len; + int val_len; + tag_len=strlen(_tag); + val_len=strlen(_val); + /*+2 for '=' and '\0'.*/ + comment=_ogg_malloc(tag_len+val_len+2); + if(comment==NULL)return; + memcpy(comment,_tag,tag_len); + comment[tag_len]='='; + memcpy(comment+tag_len+1,_val,val_len+1); + th_comment_add(_tc,comment); + _ogg_free(comment); +} + +char *th_comment_query(th_comment *_tc,char *_tag,int _count){ + long i; + int found; + int tag_len; + tag_len=strlen(_tag); + found=0; + for(i=0;i<_tc->comments;i++){ + if(!oc_tagcompare(_tc->user_comments[i],_tag,tag_len)){ + /*We return a pointer to the data, not a copy.*/ + if(_count==found++)return _tc->user_comments[i]+tag_len+1; + } + } + /*Didn't find anything.*/ + return NULL; +} + +int th_comment_query_count(th_comment *_tc,char *_tag){ + long i; + int tag_len; + int count; + tag_len=strlen(_tag); + count=0; + for(i=0;i<_tc->comments;i++){ + if(!oc_tagcompare(_tc->user_comments[i],_tag,tag_len))count++; + } + return count; +} + +void th_comment_clear(th_comment *_tc){ + if(_tc!=NULL){ + long i; + for(i=0;i<_tc->comments;i++)_ogg_free(_tc->user_comments[i]); + _ogg_free(_tc->user_comments); + _ogg_free(_tc->comment_lengths); + _ogg_free(_tc->vendor); + memset(_tc,0,sizeof(*_tc)); + } +} diff --git a/libs/libtheora-1.1/lib/internal.c b/libs/libtheora-1.1/lib/internal.c new file mode 100644 index 00000000..21fc2488 --- /dev/null +++ b/libs/libtheora-1.1/lib/internal.c @@ -0,0 +1,262 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: internal.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include +#include "internal.h" + + + +/*A map from the index in the zig zag scan to the coefficient number in a + block. + All zig zag indices beyond 63 are sent to coefficient 64, so that zero runs + past the end of a block in bogus streams get mapped to a known location.*/ +const unsigned char OC_FZIG_ZAG[128]={ + 0, 1, 8,16, 9, 2, 3,10, + 17,24,32,25,18,11, 4, 5, + 12,19,26,33,40,48,41,34, + 27,20,13, 6, 7,14,21,28, + 35,42,49,56,57,50,43,36, + 29,22,15,23,30,37,44,51, + 58,59,52,45,38,31,39,46, + 53,60,61,54,47,55,62,63, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64 +}; + +/*A map from the coefficient number in a block to its index in the zig zag + scan.*/ +const unsigned char OC_IZIG_ZAG[64]={ + 0, 1, 5, 6,14,15,27,28, + 2, 4, 7,13,16,26,29,42, + 3, 8,12,17,25,30,41,43, + 9,11,18,24,31,40,44,53, + 10,19,23,32,39,45,52,54, + 20,22,33,38,46,51,55,60, + 21,34,37,47,50,56,59,61, + 35,36,48,49,57,58,62,63 +}; + +/*A map from physical macro block ordering to bitstream macro block + ordering within a super block.*/ +const unsigned char OC_MB_MAP[2][2]={{0,3},{1,2}}; + +/*A list of the indices in the oc_mb.map array that can be valid for each of + the various chroma decimation types.*/ +const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12]={ + {0,1,2,3,4,8}, + {0,1,2,3,4,5,8,9}, + {0,1,2,3,4,6,8,10}, + {0,1,2,3,4,5,6,7,8,9,10,11} +}; + +/*The number of indices in the oc_mb.map array that can be valid for each of + the various chroma decimation types.*/ +const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS]={6,8,8,12}; + +/*The number of extra bits that are coded with each of the DCT tokens. + Each DCT token has some fixed number of additional bits (possibly 0) stored + after the token itself, containing, for example, coefficient magnitude, + sign bits, etc.*/ +const unsigned char OC_DCT_TOKEN_EXTRA_BITS[TH_NDCT_TOKENS]={ + 0,0,0,2,3,4,12,3,6, + 0,0,0,0, + 1,1,1,1,2,3,4,5,6,10, + 1,1,1,1,1,3,4, + 2,3 +}; + + + +int oc_ilog(unsigned _v){ + int ret; + for(ret=0;_v;ret++)_v>>=1; + return ret; +} + + + +/*The function used to fill in the chroma plane motion vectors for a macro + block when 4 different motion vectors are specified in the luma plane. + This version is for use with chroma decimated in the X and Y directions + (4:2:0). + _cbmvs: The chroma block-level motion vectors to fill in. + _lbmvs: The luma block-level motion vectors.*/ +static void oc_set_chroma_mvs00(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ + int dx; + int dy; + dx=_lbmvs[0][0]+_lbmvs[1][0]+_lbmvs[2][0]+_lbmvs[3][0]; + dy=_lbmvs[0][1]+_lbmvs[1][1]+_lbmvs[2][1]+_lbmvs[3][1]; + _cbmvs[0][0]=(signed char)OC_DIV_ROUND_POW2(dx,2,2); + _cbmvs[0][1]=(signed char)OC_DIV_ROUND_POW2(dy,2,2); +} + +/*The function used to fill in the chroma plane motion vectors for a macro + block when 4 different motion vectors are specified in the luma plane. + This version is for use with chroma decimated in the Y direction. + _cbmvs: The chroma block-level motion vectors to fill in. + _lbmvs: The luma block-level motion vectors.*/ +static void oc_set_chroma_mvs01(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ + int dx; + int dy; + dx=_lbmvs[0][0]+_lbmvs[2][0]; + dy=_lbmvs[0][1]+_lbmvs[2][1]; + _cbmvs[0][0]=(signed char)OC_DIV_ROUND_POW2(dx,1,1); + _cbmvs[0][1]=(signed char)OC_DIV_ROUND_POW2(dy,1,1); + dx=_lbmvs[1][0]+_lbmvs[3][0]; + dy=_lbmvs[1][1]+_lbmvs[3][1]; + _cbmvs[1][0]=(signed char)OC_DIV_ROUND_POW2(dx,1,1); + _cbmvs[1][1]=(signed char)OC_DIV_ROUND_POW2(dy,1,1); +} + +/*The function used to fill in the chroma plane motion vectors for a macro + block when 4 different motion vectors are specified in the luma plane. + This version is for use with chroma decimated in the X direction (4:2:2). + _cbmvs: The chroma block-level motion vectors to fill in. + _lbmvs: The luma block-level motion vectors.*/ +static void oc_set_chroma_mvs10(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ + int dx; + int dy; + dx=_lbmvs[0][0]+_lbmvs[1][0]; + dy=_lbmvs[0][1]+_lbmvs[1][1]; + _cbmvs[0][0]=(signed char)OC_DIV_ROUND_POW2(dx,1,1); + _cbmvs[0][1]=(signed char)OC_DIV_ROUND_POW2(dy,1,1); + dx=_lbmvs[2][0]+_lbmvs[3][0]; + dy=_lbmvs[2][1]+_lbmvs[3][1]; + _cbmvs[2][0]=(signed char)OC_DIV_ROUND_POW2(dx,1,1); + _cbmvs[2][1]=(signed char)OC_DIV_ROUND_POW2(dy,1,1); +} + +/*The function used to fill in the chroma plane motion vectors for a macro + block when 4 different motion vectors are specified in the luma plane. + This version is for use with no chroma decimation (4:4:4). + _cbmvs: The chroma block-level motion vectors to fill in. + _lmbmv: The luma macro-block level motion vector to fill in for use in + prediction. + _lbmvs: The luma block-level motion vectors.*/ +static void oc_set_chroma_mvs11(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ + memcpy(_cbmvs,_lbmvs,4*sizeof(_lbmvs[0])); +} + +/*A table of functions used to fill in the chroma plane motion vectors for a + macro block when 4 different motion vectors are specified in the luma + plane.*/ +const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[TH_PF_NFORMATS]={ + (oc_set_chroma_mvs_func)oc_set_chroma_mvs00, + (oc_set_chroma_mvs_func)oc_set_chroma_mvs01, + (oc_set_chroma_mvs_func)oc_set_chroma_mvs10, + (oc_set_chroma_mvs_func)oc_set_chroma_mvs11 +}; + + + +void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz){ + size_t rowsz; + size_t colsz; + size_t datsz; + char *ret; + colsz=_height*sizeof(void *); + rowsz=_sz*_width; + datsz=rowsz*_height; + /*Alloc array and row pointers.*/ + ret=(char *)_ogg_malloc(datsz+colsz); + if(ret==NULL)return NULL; + /*Initialize the array.*/ + if(ret!=NULL){ + size_t i; + void **p; + char *datptr; + p=(void **)ret; + i=_height; + for(datptr=ret+colsz;i-->0;p++,datptr+=rowsz)*p=(void *)datptr; + } + return (void **)ret; +} + +void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz){ + size_t colsz; + size_t rowsz; + size_t datsz; + char *ret; + colsz=_height*sizeof(void *); + rowsz=_sz*_width; + datsz=rowsz*_height; + /*Alloc array and row pointers.*/ + ret=(char *)_ogg_calloc(datsz+colsz,1); + if(ret==NULL)return NULL; + /*Initialize the array.*/ + if(ret!=NULL){ + size_t i; + void **p; + char *datptr; + p=(void **)ret; + i=_height; + for(datptr=ret+colsz;i-->0;p++,datptr+=rowsz)*p=(void *)datptr; + } + return (void **)ret; +} + +void oc_free_2d(void *_ptr){ + _ogg_free(_ptr); +} + +/*Fills in a Y'CbCr buffer with a pointer to the image data in the first + buffer, but with the opposite vertical orientation. + _dst: The destination buffer. + This can be the same as _src. + _src: The source buffer.*/ +void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst, + const th_ycbcr_buffer _src){ + int pli; + for(pli=0;pli<3;pli++){ + _dst[pli].width=_src[pli].width; + _dst[pli].height=_src[pli].height; + _dst[pli].stride=-_src[pli].stride; + _dst[pli].data=_src[pli].data + +(1-_dst[pli].height)*(ptrdiff_t)_dst[pli].stride; + } +} + +const char *th_version_string(void){ + return OC_VENDOR_STRING; +} + +ogg_uint32_t th_version_number(void){ + return (TH_VERSION_MAJOR<<16)+(TH_VERSION_MINOR<<8)+TH_VERSION_SUB; +} + +/*Determines the packet type. + Note that this correctly interprets a 0-byte packet as a video data packet. + Return: 1 for a header packet, 0 for a data packet.*/ +int th_packet_isheader(ogg_packet *_op){ + return _op->bytes>0?_op->packet[0]>>7:0; +} + +/*Determines the frame type of a video data packet. + Note that this correctly interprets a 0-byte packet as a delta frame. + Return: 1 for a key frame, 0 for a delta frame, and -1 for a header + packet.*/ +int th_packet_iskeyframe(ogg_packet *_op){ + return _op->bytes<=0?0:_op->packet[0]&0x80?-1:!(_op->packet[0]&0x40); +} diff --git a/libs/libtheora-1.1/lib/internal.h b/libs/libtheora-1.1/lib/internal.h new file mode 100644 index 00000000..7440c01f --- /dev/null +++ b/libs/libtheora-1.1/lib/internal.h @@ -0,0 +1,509 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: internal.h 16753 2009-12-19 00:52:46Z tterribe $ + + ********************************************************************/ +#if !defined(_internal_H) +# define _internal_H (1) +# include +# include +# if defined(HAVE_CONFIG_H) +# include "config.h" +# endif +# include "theora/codec.h" +# include "theora/theora.h" + +# if defined(_MSC_VER) +/*Disable missing EMMS warnings.*/ +# pragma warning(disable:4799) +/*Thank you Microsoft, I know the order of operations.*/ +# pragma warning(disable:4554) +# endif +/*You, too, gcc.*/ +# if defined(__GNUC_PREREQ) +# if __GNUC_PREREQ(4,2) +# pragma GCC diagnostic ignored "-Wparentheses" +# endif +# endif + +# include "ocintrin.h" +# include "huffman.h" +# include "quant.h" + +/*Some assembly constructs require aligned operands.*/ +# if defined(OC_X86_ASM) +# if defined(__GNUC__) +# define OC_ALIGN8(expr) expr __attribute__((aligned(8))) +# define OC_ALIGN16(expr) expr __attribute__((aligned(16))) +# elif defined(_MSC_VER) +# define OC_ALIGN8(expr) __declspec (align(8)) expr +# define OC_ALIGN16(expr) __declspec (align(16)) expr +# endif +# endif +# if !defined(OC_ALIGN8) +# define OC_ALIGN8(expr) expr +# endif +# if !defined(OC_ALIGN16) +# define OC_ALIGN16(expr) expr +# endif + + + +typedef struct oc_sb_flags oc_sb_flags; +typedef struct oc_border_info oc_border_info; +typedef struct oc_fragment oc_fragment; +typedef struct oc_fragment_plane oc_fragment_plane; +typedef struct oc_base_opt_vtable oc_base_opt_vtable; +typedef struct oc_base_opt_data oc_base_opt_data; +typedef struct oc_state_dispatch_vtable oc_state_dispatch_vtable; +typedef struct oc_theora_state oc_theora_state; + + + +/*This library's version.*/ +# define OC_VENDOR_STRING "Xiph.Org libtheora 1.1 20090822 (Thusnelda)" + +/*Theora bitstream version.*/ +# define TH_VERSION_MAJOR (3) +# define TH_VERSION_MINOR (2) +# define TH_VERSION_SUB (1) +# define TH_VERSION_CHECK(_info,_maj,_min,_sub) \ + ((_info)->version_major>(_maj)||(_info)->version_major==(_maj)&& \ + ((_info)->version_minor>(_min)||(_info)->version_minor==(_min)&& \ + (_info)->version_subminor>=(_sub))) + +/*A keyframe.*/ +#define OC_INTRA_FRAME (0) +/*A predicted frame.*/ +#define OC_INTER_FRAME (1) +/*A frame of unknown type (frame type decision has not yet been made).*/ +#define OC_UNKWN_FRAME (-1) + +/*The amount of padding to add to the reconstructed frame buffers on all + sides. + This is used to allow unrestricted motion vectors without special casing. + This must be a multiple of 2.*/ +#define OC_UMV_PADDING (16) + +/*Frame classification indices.*/ +/*The previous golden frame.*/ +#define OC_FRAME_GOLD (0) +/*The previous frame.*/ +#define OC_FRAME_PREV (1) +/*The current frame.*/ +#define OC_FRAME_SELF (2) + +/*The input or output buffer.*/ +#define OC_FRAME_IO (3) + +/*Macroblock modes.*/ +/*Macro block is invalid: It is never coded.*/ +#define OC_MODE_INVALID (-1) +/*Encoded difference from the same macro block in the previous frame.*/ +#define OC_MODE_INTER_NOMV (0) +/*Encoded with no motion compensated prediction.*/ +#define OC_MODE_INTRA (1) +/*Encoded difference from the previous frame offset by the given motion + vector.*/ +#define OC_MODE_INTER_MV (2) +/*Encoded difference from the previous frame offset by the last coded motion + vector.*/ +#define OC_MODE_INTER_MV_LAST (3) +/*Encoded difference from the previous frame offset by the second to last + coded motion vector.*/ +#define OC_MODE_INTER_MV_LAST2 (4) +/*Encoded difference from the same macro block in the previous golden + frame.*/ +#define OC_MODE_GOLDEN_NOMV (5) +/*Encoded difference from the previous golden frame offset by the given motion + vector.*/ +#define OC_MODE_GOLDEN_MV (6) +/*Encoded difference from the previous frame offset by the individual motion + vectors given for each block.*/ +#define OC_MODE_INTER_MV_FOUR (7) +/*The number of (coded) modes.*/ +#define OC_NMODES (8) + +/*Determines the reference frame used for a given MB mode.*/ +#define OC_FRAME_FOR_MODE(_x) \ + OC_UNIBBLE_TABLE32(OC_FRAME_PREV,OC_FRAME_SELF,OC_FRAME_PREV,OC_FRAME_PREV, \ + OC_FRAME_PREV,OC_FRAME_GOLD,OC_FRAME_GOLD,OC_FRAME_PREV,(_x)) + +/*Constants for the packet state machine common between encoder and decoder.*/ + +/*Next packet to emit/read: Codec info header.*/ +#define OC_PACKET_INFO_HDR (-3) +/*Next packet to emit/read: Comment header.*/ +#define OC_PACKET_COMMENT_HDR (-2) +/*Next packet to emit/read: Codec setup header.*/ +#define OC_PACKET_SETUP_HDR (-1) +/*No more packets to emit/read.*/ +#define OC_PACKET_DONE (INT_MAX) + + + +/*Super blocks are 32x32 segments of pixels in a single color plane indexed + in image order. + Internally, super blocks are broken up into four quadrants, each of which + contains a 2x2 pattern of blocks, each of which is an 8x8 block of pixels. + Quadrants, and the blocks within them, are indexed in a special order called + a "Hilbert curve" within the super block. + + In order to differentiate between the Hilbert-curve indexing strategy and + the regular image order indexing strategy, blocks indexed in image order + are called "fragments". + Fragments are indexed in image order, left to right, then bottom to top, + from Y' plane to Cb plane to Cr plane. + + The co-located fragments in all image planes corresponding to the location + of a single quadrant of a luma plane super block form a macro block. + Thus there is only a single set of macro blocks for all planes, each of which + contains between 6 and 12 fragments, depending on the pixel format. + Therefore macro block information is kept in a separate set of arrays from + super blocks to avoid unused space in the other planes. + The lists are indexed in super block order. + That is, the macro block corresponding to the macro block mbi in (luma plane) + super block sbi is at index (sbi<<2|mbi). + Thus the number of macro blocks in each dimension is always twice the number + of super blocks, even when only an odd number fall inside the coded frame. + These "extra" macro blocks are just an artifact of our internal data layout, + and not part of the coded stream; they are flagged with a negative MB mode.*/ + + + +/*A single quadrant of the map from a super block to fragment numbers.*/ +typedef ptrdiff_t oc_sb_map_quad[4]; +/*A map from a super block to fragment numbers.*/ +typedef oc_sb_map_quad oc_sb_map[4]; +/*A single plane of the map from a macro block to fragment numbers.*/ +typedef ptrdiff_t oc_mb_map_plane[4]; +/*A map from a macro block to fragment numbers.*/ +typedef oc_mb_map_plane oc_mb_map[3]; +/*A motion vector.*/ +typedef signed char oc_mv[2]; + + + +/*Super block information.*/ +struct oc_sb_flags{ + unsigned char coded_fully:1; + unsigned char coded_partially:1; + unsigned char quad_valid:4; +}; + + + +/*Information about a fragment which intersects the border of the displayable + region. + This marks which pixels belong to the displayable region.*/ +struct oc_border_info{ + /*A bit mask marking which pixels are in the displayable region. + Pixel (x,y) corresponds to bit (y<<3|x).*/ + ogg_int64_t mask; + /*The number of pixels in the displayable region. + This is always positive, and always less than 64.*/ + int npixels; +}; + + + +/*Fragment information.*/ +struct oc_fragment{ + /*A flag indicating whether or not this fragment is coded.*/ + unsigned coded:1; + /*A flag indicating that this entire fragment lies outside the displayable + region of the frame. + Note the contrast with an invalid macro block, which is outside the coded + frame, not just the displayable one. + There are no fragments outside the coded frame by construction.*/ + unsigned invalid:1; + /*The index of the quality index used for this fragment's AC coefficients.*/ + unsigned qii:6; + /*The mode of the macroblock this fragment belongs to.*/ + unsigned mb_mode:3; + /*The index of the associated border information for fragments which lie + partially outside the displayable region. + For fragments completely inside or outside this region, this is -1. + Note that the C standard requires an explicit signed keyword for bitfield + types, since some compilers may treat them as unsigned without it.*/ + signed int borderi:5; + /*The prediction-corrected DC component. + Note that the C standard requires an explicit signed keyword for bitfield + types, since some compilers may treat them as unsigned without it.*/ + signed int dc:16; +}; + + + +/*A description of each fragment plane.*/ +struct oc_fragment_plane{ + /*The number of fragments in the horizontal direction.*/ + int nhfrags; + /*The number of fragments in the vertical direction.*/ + int nvfrags; + /*The offset of the first fragment in the plane.*/ + ptrdiff_t froffset; + /*The total number of fragments in the plane.*/ + ptrdiff_t nfrags; + /*The number of super blocks in the horizontal direction.*/ + unsigned nhsbs; + /*The number of super blocks in the vertical direction.*/ + unsigned nvsbs; + /*The offset of the first super block in the plane.*/ + unsigned sboffset; + /*The total number of super blocks in the plane.*/ + unsigned nsbs; +}; + + + +/*The shared (encoder and decoder) functions that have accelerated variants.*/ +struct oc_base_opt_vtable{ + void (*frag_copy)(unsigned char *_dst, + const unsigned char *_src,int _ystride); + void (*frag_recon_intra)(unsigned char *_dst,int _ystride, + const ogg_int16_t _residue[64]); + void (*frag_recon_inter)(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]); + void (*frag_recon_inter2)(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]); + void (*idct8x8)(ogg_int16_t _y[64],int _last_zzi); + void (*state_frag_recon)(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant); + void (*state_frag_copy_list)(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli); + void (*state_loop_filter_frag_rows)(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); + void (*restore_fpu)(void); +}; + +/*The shared (encoder and decoder) tables that vary according to which variants + of the above functions are used.*/ +struct oc_base_opt_data{ + const unsigned char *dct_fzig_zag; +}; + + +/*State information common to both the encoder and decoder.*/ +struct oc_theora_state{ + /*The stream information.*/ + th_info info; + /*Table for shared accelerated functions.*/ + oc_base_opt_vtable opt_vtable; + /*Table for shared data used by accelerated functions.*/ + oc_base_opt_data opt_data; + /*CPU flags to detect the presence of extended instruction sets.*/ + ogg_uint32_t cpu_flags; + /*The fragment plane descriptions.*/ + oc_fragment_plane fplanes[3]; + /*The list of fragments, indexed in image order.*/ + oc_fragment *frags; + /*The the offset into the reference frame buffer to the upper-left pixel of + each fragment.*/ + ptrdiff_t *frag_buf_offs; + /*The motion vector for each fragment.*/ + oc_mv *frag_mvs; + /*The total number of fragments in a single frame.*/ + ptrdiff_t nfrags; + /*The list of super block maps, indexed in image order.*/ + oc_sb_map *sb_maps; + /*The list of super block flags, indexed in image order.*/ + oc_sb_flags *sb_flags; + /*The total number of super blocks in a single frame.*/ + unsigned nsbs; + /*The fragments from each color plane that belong to each macro block. + Fragments are stored in image order (left to right then top to bottom). + When chroma components are decimated, the extra fragments have an index of + -1.*/ + oc_mb_map *mb_maps; + /*The list of macro block modes. + A negative number indicates the macro block lies entirely outside the + coded frame.*/ + signed char *mb_modes; + /*The number of macro blocks in the X direction.*/ + unsigned nhmbs; + /*The number of macro blocks in the Y direction.*/ + unsigned nvmbs; + /*The total number of macro blocks.*/ + size_t nmbs; + /*The list of coded fragments, in coded order. + Uncoded fragments are stored in reverse order from the end of the list.*/ + ptrdiff_t *coded_fragis; + /*The number of coded fragments in each plane.*/ + ptrdiff_t ncoded_fragis[3]; + /*The total number of coded fragments.*/ + ptrdiff_t ntotal_coded_fragis; + /*The index of the buffers being used for each OC_FRAME_* reference frame.*/ + int ref_frame_idx[4]; + /*The actual buffers used for the previously decoded frames.*/ + th_ycbcr_buffer ref_frame_bufs[4]; + /*The storage for the reference frame buffers.*/ + unsigned char *ref_frame_data[4]; + /*The strides for each plane in the reference frames.*/ + int ref_ystride[3]; + /*The number of unique border patterns.*/ + int nborders; + /*The unique border patterns for all border fragments. + The borderi field of fragments which straddle the border indexes this + list.*/ + oc_border_info borders[16]; + /*The frame number of the last keyframe.*/ + ogg_int64_t keyframe_num; + /*The frame number of the current frame.*/ + ogg_int64_t curframe_num; + /*The granpos of the current frame.*/ + ogg_int64_t granpos; + /*The type of the current frame.*/ + unsigned char frame_type; + /*The bias to add to the frame count when computing granule positions.*/ + unsigned char granpos_bias; + /*The number of quality indices used in the current frame.*/ + unsigned char nqis; + /*The quality indices of the current frame.*/ + unsigned char qis[3]; + /*The dequantization tables, stored in zig-zag order, and indexed by + qi, pli, qti, and zzi.*/ + ogg_uint16_t *dequant_tables[64][3][2]; + OC_ALIGN16(oc_quant_table dequant_table_data[64][3][2]); + /*Loop filter strength parameters.*/ + unsigned char loop_filter_limits[64]; +}; + + + +/*The function type used to fill in the chroma plane motion vectors for a + macro block when 4 different motion vectors are specified in the luma + plane. + _cbmvs: The chroma block-level motion vectors to fill in. + _lmbmv: The luma macro-block level motion vector to fill in for use in + prediction. + _lbmvs: The luma block-level motion vectors.*/ +typedef void (*oc_set_chroma_mvs_func)(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]); + + + +/*A map from the index in the zig zag scan to the coefficient number in a + block.*/ +extern const unsigned char OC_FZIG_ZAG[128]; +/*A map from the coefficient number in a block to its index in the zig zag + scan.*/ +extern const unsigned char OC_IZIG_ZAG[64]; +/*A map from physical macro block ordering to bitstream macro block + ordering within a super block.*/ +extern const unsigned char OC_MB_MAP[2][2]; +/*A list of the indices in the oc_mb_map array that can be valid for each of + the various chroma decimation types.*/ +extern const unsigned char OC_MB_MAP_IDXS[TH_PF_NFORMATS][12]; +/*The number of indices in the oc_mb_map array that can be valid for each of + the various chroma decimation types.*/ +extern const unsigned char OC_MB_MAP_NIDXS[TH_PF_NFORMATS]; +/*A table of functions used to fill in the Cb,Cr plane motion vectors for a + macro block when 4 different motion vectors are specified in the luma + plane.*/ +extern const oc_set_chroma_mvs_func OC_SET_CHROMA_MVS_TABLE[TH_PF_NFORMATS]; + + + +int oc_ilog(unsigned _v); +void **oc_malloc_2d(size_t _height,size_t _width,size_t _sz); +void **oc_calloc_2d(size_t _height,size_t _width,size_t _sz); +void oc_free_2d(void *_ptr); + +void oc_ycbcr_buffer_flip(th_ycbcr_buffer _dst, + const th_ycbcr_buffer _src); + +int oc_state_init(oc_theora_state *_state,const th_info *_info,int _nrefs); +void oc_state_clear(oc_theora_state *_state); +void oc_state_vtable_init_c(oc_theora_state *_state); +void oc_state_borders_fill_rows(oc_theora_state *_state,int _refi,int _pli, + int _y0,int _yend); +void oc_state_borders_fill_caps(oc_theora_state *_state,int _refi,int _pli); +void oc_state_borders_fill(oc_theora_state *_state,int _refi); +void oc_state_fill_buffer_ptrs(oc_theora_state *_state,int _buf_idx, + th_ycbcr_buffer _img); +int oc_state_mbi_for_pos(oc_theora_state *_state,int _mbx,int _mby); +int oc_state_get_mv_offsets(const oc_theora_state *_state,int _offsets[2], + int _pli,int _dx,int _dy); + +int oc_state_loop_filter_init(oc_theora_state *_state,int *_bv); +void oc_state_loop_filter(oc_theora_state *_state,int _frame); +#if defined(OC_DUMP_IMAGES) +int oc_state_dump_frame(const oc_theora_state *_state,int _frame, + const char *_suf); +#endif + +/*Shared accelerated functions.*/ +void oc_frag_copy(const oc_theora_state *_state,unsigned char *_dst, + const unsigned char *_src,int _ystride); +void oc_frag_recon_intra(const oc_theora_state *_state, + unsigned char *_dst,int _dst_ystride,const ogg_int16_t _residue[64]); +void oc_frag_recon_inter(const oc_theora_state *_state,unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]); +void oc_frag_recon_inter2(const oc_theora_state *_state, + unsigned char *_dst,const unsigned char *_src1,const unsigned char *_src2, + int _ystride,const ogg_int16_t _residue[64]); +void oc_idct8x8(const oc_theora_state *_state,ogg_int16_t _y[64],int _last_zzi); +void oc_state_frag_recon(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant); +void oc_state_frag_copy_list(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli); +void oc_state_loop_filter_frag_rows(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); +void oc_restore_fpu(const oc_theora_state *_state); + +/*Default pure-C implementations.*/ +void oc_frag_copy_c(unsigned char *_dst, + const unsigned char *_src,int _src_ystride); +void oc_frag_recon_intra_c(unsigned char *_dst,int _dst_ystride, + const ogg_int16_t _residue[64]); +void oc_frag_recon_inter_c(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]); +void oc_frag_recon_inter2_c(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]); +void oc_idct8x8_c(ogg_int16_t _y[64],int _last_zzi); +void oc_state_frag_recon_c(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant); +void oc_state_frag_copy_list_c(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli); +void oc_state_loop_filter_frag_rows_c(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); +void oc_restore_fpu_c(void); + +/*We need a way to call a few encoder functions without introducing a link-time + dependency into the decoder, while still allowing the old alpha API which + does not distinguish between encoder and decoder objects to be used. + We do this by placing a function table at the start of the encoder object + which can dispatch into the encoder library. + We do a similar thing for the decoder in case we ever decide to split off a + common base library.*/ +typedef void (*oc_state_clear_func)(theora_state *_th); +typedef int (*oc_state_control_func)(theora_state *th,int _req, + void *_buf,size_t _buf_sz); +typedef ogg_int64_t (*oc_state_granule_frame_func)(theora_state *_th, + ogg_int64_t _granulepos); +typedef double (*oc_state_granule_time_func)(theora_state *_th, + ogg_int64_t _granulepos); + + +struct oc_state_dispatch_vtable{ + oc_state_clear_func clear; + oc_state_control_func control; + oc_state_granule_frame_func granule_frame; + oc_state_granule_time_func granule_time; +}; + +#endif diff --git a/libs/libtheora-1.1/lib/mathops.c b/libs/libtheora-1.1/lib/mathops.c new file mode 100644 index 00000000..d3fb9091 --- /dev/null +++ b/libs/libtheora-1.1/lib/mathops.c @@ -0,0 +1,296 @@ +#include "mathops.h" +#include + +/*The fastest fallback strategy for platforms with fast multiplication appears + to be based on de Bruijn sequences~\cite{LP98}. + Tests confirmed this to be true even on an ARM11, where it is actually faster + than using the native clz instruction. + Define OC_ILOG_NODEBRUIJN to use a simpler fallback on platforms where + multiplication or table lookups are too expensive. + + @UNPUBLISHED{LP98, + author="Charles E. Leiserson and Harald Prokop", + title="Using de {Bruijn} Sequences to Index a 1 in a Computer Word", + month=Jun, + year=1998, + note="\url{http://supertech.csail.mit.edu/papers/debruijn.pdf}" + }*/ +#if !defined(OC_ILOG_NODEBRUIJN)&& \ + !defined(OC_CLZ32)||!defined(OC_CLZ64)&&LONG_MAX<9223372036854775807LL +static const unsigned char OC_DEBRUIJN_IDX32[32]={ + 0, 1,28, 2,29,14,24, 3,30,22,20,15,25,17, 4, 8, + 31,27,13,23,21,19,16, 7,26,12,18, 6,11, 5,10, 9 +}; +#endif + +int oc_ilog32(ogg_uint32_t _v){ +#if defined(OC_CLZ32) + return (OC_CLZ32_OFFS-OC_CLZ32(_v))&-!!_v; +#else +/*On a Pentium M, this branchless version tested as the fastest version without + multiplications on 1,000,000,000 random 32-bit integers, edging out a + similar version with branches, and a 256-entry LUT version.*/ +# if defined(OC_ILOG_NODEBRUIJN) + int ret; + int m; + ret=_v>0; + m=(_v>0xFFFFU)<<4; + _v>>=m; + ret|=m; + m=(_v>0xFFU)<<3; + _v>>=m; + ret|=m; + m=(_v>0xFU)<<2; + _v>>=m; + ret|=m; + m=(_v>3)<<1; + _v>>=m; + ret|=m; + ret+=_v>1; + return ret; +/*This de Bruijn sequence version is faster if you have a fast multiplier.*/ +# else + int ret; + ret=_v>0; + _v|=_v>>1; + _v|=_v>>2; + _v|=_v>>4; + _v|=_v>>8; + _v|=_v>>16; + _v=(_v>>1)+1; + ret+=OC_DEBRUIJN_IDX32[_v*0x77CB531U>>27&0x1F]; + return ret; +# endif +#endif +} + +int oc_ilog64(ogg_int64_t _v){ +#if defined(OC_CLZ64) + return (OC_CLZ64_OFFS-OC_CLZ64(_v))&-!!_v; +#else +# if defined(OC_ILOG_NODEBRUIJN) + ogg_uint32_t v; + int ret; + int m; + ret=_v>0; + m=(_v>0xFFFFFFFFU)<<5; + v=(ogg_uint32_t)(_v>>m); + ret|=m; + m=(v>0xFFFFU)<<4; + v>>=m; + ret|=m; + m=(v>0xFFU)<<3; + v>>=m; + ret|=m; + m=(v>0xFU)<<2; + v>>=m; + ret|=m; + m=(v>3)<<1; + v>>=m; + ret|=m; + ret+=v>1; + return ret; +# else +/*If we don't have a 64-bit word, split it into two 32-bit halves.*/ +# if LONG_MAX<9223372036854775807LL + ogg_uint32_t v; + int ret; + int m; + ret=_v>0; + m=(_v>0xFFFFFFFFU)<<5; + v=(ogg_uint32_t)(_v>>m); + ret|=m; + v|=v>>1; + v|=v>>2; + v|=v>>4; + v|=v>>8; + v|=v>>16; + v=(v>>1)+1; + ret+=OC_DEBRUIJN_IDX32[v*0x77CB531U>>27&0x1F]; + return ret; +/*Otherwise do it in one 64-bit operation.*/ +# else + static const unsigned char OC_DEBRUIJN_IDX64[64]={ + 0, 1, 2, 7, 3,13, 8,19, 4,25,14,28, 9,34,20,40, + 5,17,26,38,15,46,29,48,10,31,35,54,21,50,41,57, + 63, 6,12,18,24,27,33,39,16,37,45,47,30,53,49,56, + 62,11,23,32,36,44,52,55,61,22,43,51,60,42,59,58 + }; + int ret; + ret=_v>0; + _v|=_v>>1; + _v|=_v>>2; + _v|=_v>>4; + _v|=_v>>8; + _v|=_v>>16; + _v|=_v>>32; + _v=(_v>>1)+1; + ret+=OC_DEBRUIJN_IDX64[_v*0x218A392CD3D5DBF>>58&0x3F]; + return ret; +# endif +# endif +#endif +} + +/*round(2**(62+i)*atanh(2**(-(i+1)))/log(2))*/ +static const ogg_int64_t OC_ATANH_LOG2[32]={ + 0x32B803473F7AD0F4LL,0x2F2A71BD4E25E916LL,0x2E68B244BB93BA06LL, + 0x2E39FB9198CE62E4LL,0x2E2E683F68565C8FLL,0x2E2B850BE2077FC1LL, + 0x2E2ACC58FE7B78DBLL,0x2E2A9E2DE52FD5F2LL,0x2E2A92A338D53EECLL, + 0x2E2A8FC08F5E19B6LL,0x2E2A8F07E51A485ELL,0x2E2A8ED9BA8AF388LL, + 0x2E2A8ECE2FE7384ALL,0x2E2A8ECB4D3E4B1ALL,0x2E2A8ECA94940FE8LL, + 0x2E2A8ECA6669811DLL,0x2E2A8ECA5ADEDD6ALL,0x2E2A8ECA57FC347ELL, + 0x2E2A8ECA57438A43LL,0x2E2A8ECA57155FB4LL,0x2E2A8ECA5709D510LL, + 0x2E2A8ECA5706F267LL,0x2E2A8ECA570639BDLL,0x2E2A8ECA57060B92LL, + 0x2E2A8ECA57060008LL,0x2E2A8ECA5705FD25LL,0x2E2A8ECA5705FC6CLL, + 0x2E2A8ECA5705FC3ELL,0x2E2A8ECA5705FC33LL,0x2E2A8ECA5705FC30LL, + 0x2E2A8ECA5705FC2FLL,0x2E2A8ECA5705FC2FLL +}; + +/*Computes the binary exponential of _z, a log base 2 in Q57 format.*/ +ogg_int64_t oc_bexp64(ogg_int64_t _z){ + ogg_int64_t w; + ogg_int64_t z; + int ipart; + ipart=(int)(_z>>57); + if(ipart<0)return 0; + if(ipart>=63)return 0x7FFFFFFFFFFFFFFFLL; + z=_z-OC_Q57(ipart); + if(z){ + ogg_int64_t mask; + long wlo; + int i; + /*C doesn't give us 64x64->128 muls, so we use CORDIC. + This is not particularly fast, but it's not being used in time-critical + code; it is very accurate.*/ + /*z is the fractional part of the log in Q62 format. + We need 1 bit of headroom since the magnitude can get larger than 1 + during the iteration, and a sign bit.*/ + z<<=5; + /*w is the exponential in Q61 format (since it also needs headroom and can + get as large as 2.0); we could get another bit if we dropped the sign, + but we'll recover that bit later anyway. + Ideally this should start out as + \lim_{n->\infty} 2^{61}/\product_{i=1}^n \sqrt{1-2^{-2i}} + but in order to guarantee convergence we have to repeat iterations 4, + 13 (=3*4+1), and 40 (=3*13+1, etc.), so it winds up somewhat larger.*/ + w=0x26A3D0E401DD846DLL; + for(i=0;;i++){ + mask=-(z<0); + w+=(w>>i+1)+mask^mask; + z-=OC_ATANH_LOG2[i]+mask^mask; + /*Repeat iteration 4.*/ + if(i>=3)break; + z<<=1; + } + for(;;i++){ + mask=-(z<0); + w+=(w>>i+1)+mask^mask; + z-=OC_ATANH_LOG2[i]+mask^mask; + /*Repeat iteration 13.*/ + if(i>=12)break; + z<<=1; + } + for(;i<32;i++){ + mask=-(z<0); + w+=(w>>i+1)+mask^mask; + z=z-(OC_ATANH_LOG2[i]+mask^mask)<<1; + } + wlo=0; + /*Skip the remaining iterations unless we really require that much + precision. + We could have bailed out earlier for smaller iparts, but that would + require initializing w from a table, as the limit doesn't converge to + 61-bit precision until n=30.*/ + if(ipart>30){ + /*For these iterations, we just update the low bits, as the high bits + can't possibly be affected. + OC_ATANH_LOG2 has also converged (it actually did so one iteration + earlier, but that's no reason for an extra special case).*/ + for(;;i++){ + mask=-(z<0); + wlo+=(w>>i)+mask^mask; + z-=OC_ATANH_LOG2[31]+mask^mask; + /*Repeat iteration 40.*/ + if(i>=39)break; + z<<=1; + } + for(;i<61;i++){ + mask=-(z<0); + wlo+=(w>>i)+mask^mask; + z=z-(OC_ATANH_LOG2[31]+mask^mask)<<1; + } + } + w=(w<<1)+wlo; + } + else w=(ogg_int64_t)1<<62; + if(ipart<62)w=(w>>61-ipart)+1>>1; + return w; +} + +/*Computes the binary logarithm of _w, returned in Q57 format.*/ +ogg_int64_t oc_blog64(ogg_int64_t _w){ + ogg_int64_t z; + int ipart; + if(_w<=0)return -1; + ipart=OC_ILOGNZ_64(_w)-1; + if(ipart>61)_w>>=ipart-61; + else _w<<=61-ipart; + z=0; + if(_w&_w-1){ + ogg_int64_t x; + ogg_int64_t y; + ogg_int64_t u; + ogg_int64_t mask; + int i; + /*C doesn't give us 64x64->128 muls, so we use CORDIC. + This is not particularly fast, but it's not being used in time-critical + code; it is very accurate.*/ + /*z is the fractional part of the log in Q61 format.*/ + /*x and y are the cosh() and sinh(), respectively, in Q61 format. + We are computing z=2*atanh(y/x)=2*atanh((_w-1)/(_w+1)).*/ + x=_w+((ogg_int64_t)1<<61); + y=_w-((ogg_int64_t)1<<61); + for(i=0;i<4;i++){ + mask=-(y<0); + z+=(OC_ATANH_LOG2[i]>>i)+mask^mask; + u=x>>i+1; + x-=(y>>i+1)+mask^mask; + y-=u+mask^mask; + } + /*Repeat iteration 4.*/ + for(i--;i<13;i++){ + mask=-(y<0); + z+=(OC_ATANH_LOG2[i]>>i)+mask^mask; + u=x>>i+1; + x-=(y>>i+1)+mask^mask; + y-=u+mask^mask; + } + /*Repeat iteration 13.*/ + for(i--;i<32;i++){ + mask=-(y<0); + z+=(OC_ATANH_LOG2[i]>>i)+mask^mask; + u=x>>i+1; + x-=(y>>i+1)+mask^mask; + y-=u+mask^mask; + } + /*OC_ATANH_LOG2 has converged.*/ + for(;i<40;i++){ + mask=-(y<0); + z+=(OC_ATANH_LOG2[31]>>i)+mask^mask; + u=x>>i+1; + x-=(y>>i+1)+mask^mask; + y-=u+mask^mask; + } + /*Repeat iteration 40.*/ + for(i--;i<62;i++){ + mask=-(y<0); + z+=(OC_ATANH_LOG2[31]>>i)+mask^mask; + u=x>>i+1; + x-=(y>>i+1)+mask^mask; + y-=u+mask^mask; + } + z=z+8>>4; + } + return OC_Q57(ipart)+z; +} diff --git a/libs/libtheora-1.1/lib/mathops.h b/libs/libtheora-1.1/lib/mathops.h new file mode 100644 index 00000000..efbc5377 --- /dev/null +++ b/libs/libtheora-1.1/lib/mathops.h @@ -0,0 +1,141 @@ +#if !defined(_mathops_H) +# define _mathops_H (1) +# include + +# ifdef __GNUC_PREREQ +# if __GNUC_PREREQ(3,4) +# include +/*Note the casts to (int) below: this prevents OC_CLZ{32|64}_OFFS from + "upgrading" the type of an entire expression to an (unsigned) size_t.*/ +# if INT_MAX>=2147483647 +# define OC_CLZ32_OFFS ((int)sizeof(unsigned)*CHAR_BIT) +# define OC_CLZ32(_x) (__builtin_clz(_x)) +# elif LONG_MAX>=2147483647L +# define OC_CLZ32_OFFS ((int)sizeof(unsigned long)*CHAR_BIT) +# define OC_CLZ32(_x) (__builtin_clzl(_x)) +# endif +# if INT_MAX>=9223372036854775807LL +# define OC_CLZ64_OFFS ((int)sizeof(unsigned)*CHAR_BIT) +# define OC_CLZ64(_x) (__builtin_clz(_x)) +# elif LONG_MAX>=9223372036854775807LL +# define OC_CLZ64_OFFS ((int)sizeof(unsigned long)*CHAR_BIT) +# define OC_CLZ64(_x) (__builtin_clzl(_x)) +# elif LLONG_MAX>=9223372036854775807LL|| \ + __LONG_LONG_MAX__>=9223372036854775807LL +# define OC_CLZ64_OFFS ((int)sizeof(unsigned long long)*CHAR_BIT) +# define OC_CLZ64(_x) (__builtin_clzll(_x)) +# endif +# endif +# endif + + + +/** + * oc_ilog32 - Integer binary logarithm of a 32-bit value. + * @_v: A 32-bit value. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * The OC_ILOG_32() or OC_ILOGNZ_32() macros may be able to use a builtin + * function instead, which should be faster. + */ +int oc_ilog32(ogg_uint32_t _v); +/** + * oc_ilog64 - Integer binary logarithm of a 64-bit value. + * @_v: A 64-bit value. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * The OC_ILOG_64() or OC_ILOGNZ_64() macros may be able to use a builtin + * function instead, which should be faster. + */ +int oc_ilog64(ogg_int64_t _v); + + +# if defined(OC_CLZ32) +/** + * OC_ILOGNZ_32 - Integer binary logarithm of a non-zero 32-bit value. + * @_v: A non-zero 32-bit value. + * Returns floor(log2(_v))+1. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * If _v is zero, the return value is undefined; use OC_ILOG_32() instead. + */ +# define OC_ILOGNZ_32(_v) (OC_CLZ32_OFFS-OC_CLZ32(_v)) +/** + * OC_ILOG_32 - Integer binary logarithm of a 32-bit value. + * @_v: A 32-bit value. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + */ +# define OC_ILOG_32(_v) (OC_ILOGNZ_32(_v)&-!!(_v)) +# else +# define OC_ILOGNZ_32(_v) (oc_ilog32(_v)) +# define OC_ILOG_32(_v) (oc_ilog32(_v)) +# endif + +# if defined(CLZ64) +/** + * OC_ILOGNZ_64 - Integer binary logarithm of a non-zero 64-bit value. + * @_v: A non-zero 64-bit value. + * Returns floor(log2(_v))+1. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * If _v is zero, the return value is undefined; use OC_ILOG_64() instead. + */ +# define OC_ILOGNZ_64(_v) (CLZ64_OFFS-CLZ64(_v)) +/** + * OC_ILOG_64 - Integer binary logarithm of a 64-bit value. + * @_v: A 64-bit value. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + */ +# define OC_ILOG_64(_v) (OC_ILOGNZ_64(_v)&-!!(_v)) +# else +# define OC_ILOGNZ_64(_v) (oc_ilog64(_v)) +# define OC_ILOG_64(_v) (oc_ilog64(_v)) +# endif + +# define OC_STATIC_ILOG0(_v) (!!(_v)) +# define OC_STATIC_ILOG1(_v) (((_v)&0x2)?2:OC_STATIC_ILOG0(_v)) +# define OC_STATIC_ILOG2(_v) \ + (((_v)&0xC)?2+OC_STATIC_ILOG1((_v)>>2):OC_STATIC_ILOG1(_v)) +# define OC_STATIC_ILOG3(_v) \ + (((_v)&0xF0)?4+OC_STATIC_ILOG2((_v)>>4):OC_STATIC_ILOG2(_v)) +# define OC_STATIC_ILOG4(_v) \ + (((_v)&0xFF00)?8+OC_STATIC_ILOG3((_v)>>8):OC_STATIC_ILOG3(_v)) +# define OC_STATIC_ILOG5(_v) \ + (((_v)&0xFFFF0000)?16+OC_STATIC_ILOG4((_v)>>16):OC_STATIC_ILOG4(_v)) +# define OC_STATIC_ILOG6(_v) \ + (((_v)&0xFFFFFFFF00000000ULL)?32+OC_STATIC_ILOG5((_v)>>32):OC_STATIC_ILOG5(_v)) +/** + * OC_STATIC_ILOG_32 - The integer logarithm of an (unsigned, 32-bit) constant. + * @_v: A non-negative 32-bit constant. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * This macro is suitable for evaluation at compile time, but it should not be + * used on values that can change at runtime, as it operates via exhaustive + * search. + */ +# define OC_STATIC_ILOG_32(_v) (OC_STATIC_ILOG5((ogg_uint32_t)(_v))) +/** + * OC_STATIC_ILOG_64 - The integer logarithm of an (unsigned, 64-bit) constant. + * @_v: A non-negative 64-bit constant. + * Returns floor(log2(_v))+1, or 0 if _v==0. + * This is the number of bits that would be required to represent _v in two's + * complement notation with all of the leading zeros stripped. + * This macro is suitable for evaluation at compile time, but it should not be + * used on values that can change at runtime, as it operates via exhaustive + * search. + */ +# define OC_STATIC_ILOG_64(_v) (OC_STATIC_ILOG6((ogg_int64_t)(_v))) + +#define OC_Q57(_v) ((ogg_int64_t)(_v)<<57) + +ogg_int64_t oc_bexp64(ogg_int64_t _z); +ogg_int64_t oc_blog64(ogg_int64_t _w); + +#endif diff --git a/libs/libtheora-1.1/lib/mcenc.c b/libs/libtheora-1.1/lib/mcenc.c new file mode 100644 index 00000000..797e81f4 --- /dev/null +++ b/libs/libtheora-1.1/lib/mcenc.c @@ -0,0 +1,767 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id$ + + ********************************************************************/ +#include +#include +#include +#include "encint.h" + + + +typedef struct oc_mcenc_ctx oc_mcenc_ctx; + + + +/*Temporary state used for motion estimation.*/ +struct oc_mcenc_ctx{ + /*The candidate motion vectors.*/ + int candidates[13][2]; + /*The start of the Set B candidates.*/ + int setb0; + /*The total number of candidates.*/ + int ncandidates; +}; + + + +/*The maximum Y plane SAD value for accepting the median predictor.*/ +#define OC_YSAD_THRESH1 (256) +/*The amount to right shift the minimum error by when inflating it for + computing the second maximum Y plane SAD threshold.*/ +#define OC_YSAD_THRESH2_SCALE_BITS (4) +/*The amount to add to the second maximum Y plane threshold when inflating + it.*/ +#define OC_YSAD_THRESH2_OFFSET (64) + +/*The vector offsets in the X direction for each search site in the square + pattern.*/ +static const int OC_SQUARE_DX[9]={-1,0,1,-1,0,1,-1,0,1}; +/*The vector offsets in the Y direction for each search site in the square + pattern.*/ +static const int OC_SQUARE_DY[9]={-1,-1,-1,0,0,0,1,1,1}; +/*The number of sites to search for each boundary condition in the square + pattern. + Bit flags for the boundary conditions are as follows: + 1: -16==dx + 2: dx==15(.5) + 4: -16==dy + 8: dy==15(.5)*/ +static const int OC_SQUARE_NSITES[11]={8,5,5,0,5,3,3,0,5,3,3}; +/*The list of sites to search for each boundary condition in the square + pattern.*/ +static const int OC_SQUARE_SITES[11][8]={ + /* -15.5mb_info; + /*Skip a position to store the median predictor in.*/ + ncandidates=1; + if(embs[_mbi].ncneighbors>0){ + /*Fill in the first part of set A: the vectors from adjacent blocks.*/ + for(i=0;icandidates[ncandidates][0]=embs[nmbi].analysis_mv[0][_frame][0]; + _mcenc->candidates[ncandidates][1]=embs[nmbi].analysis_mv[0][_frame][1]; + ncandidates++; + } + } + /*Add a few additional vectors to set A: the vectors used in the previous + frames and the (0,0) vector.*/ + _mcenc->candidates[ncandidates][0]=OC_CLAMPI(-31,_accum[0],31); + _mcenc->candidates[ncandidates][1]=OC_CLAMPI(-31,_accum[1],31); + ncandidates++; + _mcenc->candidates[ncandidates][0]=OC_CLAMPI(-31, + embs[_mbi].analysis_mv[1][_frame][0]+_accum[0],31); + _mcenc->candidates[ncandidates][1]=OC_CLAMPI(-31, + embs[_mbi].analysis_mv[1][_frame][1]+_accum[1],31); + ncandidates++; + _mcenc->candidates[ncandidates][0]=0; + _mcenc->candidates[ncandidates][1]=0; + ncandidates++; + /*Use the first three vectors of set A to find our best predictor: their + median.*/ + memcpy(a,_mcenc->candidates+1,sizeof(a)); + OC_SORT2I(a[0][0],a[1][0]); + OC_SORT2I(a[0][1],a[1][1]); + OC_SORT2I(a[1][0],a[2][0]); + OC_SORT2I(a[1][1],a[2][1]); + OC_SORT2I(a[0][0],a[1][0]); + OC_SORT2I(a[0][1],a[1][1]); + _mcenc->candidates[0][0]=a[1][0]; + _mcenc->candidates[0][1]=a[1][1]; + /*Fill in set B: accelerated predictors for this and adjacent macro blocks.*/ + _mcenc->setb0=ncandidates; + /*The first time through the loop use the current macro block.*/ + nmbi=_mbi; + for(i=0;;i++){ + _mcenc->candidates[ncandidates][0]=OC_CLAMPI(-31, + 2*embs[_mbi].analysis_mv[1][_frame][0] + -embs[_mbi].analysis_mv[2][_frame][0]+_accum[0],31); + _mcenc->candidates[ncandidates][1]=OC_CLAMPI(-31, + 2*embs[_mbi].analysis_mv[1][_frame][1] + -embs[_mbi].analysis_mv[2][_frame][1]+_accum[1],31); + ncandidates++; + if(i>=embs[_mbi].npneighbors)break; + nmbi=embs[_mbi].pneighbors[i]; + } + /*Truncate to full-pel positions.*/ + for(i=0;icandidates[i][0]=OC_DIV2(_mcenc->candidates[i][0]); + _mcenc->candidates[i][1]=OC_DIV2(_mcenc->candidates[i][1]); + } + _mcenc->ncandidates=ncandidates; +} + +#if 0 +static unsigned oc_sad16_halfpel(const oc_enc_ctx *_enc, + const ptrdiff_t *_frag_buf_offs,const ptrdiff_t _fragis[4], + int _mvoffset0,int _mvoffset1,const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _best_err){ + unsigned err; + int bi; + err=0; + for(bi=0;bi<4;bi++){ + ptrdiff_t frag_offs; + frag_offs=_frag_buf_offs[_fragis[bi]]; + err+=oc_enc_frag_sad2_thresh(_enc,_src+frag_offs,_ref+frag_offs+_mvoffset0, + _ref+frag_offs+_mvoffset1,_ystride,_best_err-err); + } + return err; +} +#endif + +static unsigned oc_satd16_halfpel(const oc_enc_ctx *_enc, + const ptrdiff_t *_frag_buf_offs,const ptrdiff_t _fragis[4], + int _mvoffset0,int _mvoffset1,const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _best_err){ + unsigned err; + int bi; + err=0; + for(bi=0;bi<4;bi++){ + ptrdiff_t frag_offs; + frag_offs=_frag_buf_offs[_fragis[bi]]; + err+=oc_enc_frag_satd2_thresh(_enc,_src+frag_offs,_ref+frag_offs+_mvoffset0, + _ref+frag_offs+_mvoffset1,_ystride,_best_err-err); + } + return err; +} + +static unsigned oc_mcenc_ysad_check_mbcandidate_fullpel(const oc_enc_ctx *_enc, + const ptrdiff_t *_frag_buf_offs,const ptrdiff_t _fragis[4],int _dx,int _dy, + const unsigned char *_src,const unsigned char *_ref,int _ystride, + unsigned _block_err[4]){ + unsigned err; + int mvoffset; + int bi; + mvoffset=_dx+_dy*_ystride; + err=0; + for(bi=0;bi<4;bi++){ + ptrdiff_t frag_offs; + unsigned block_err; + frag_offs=_frag_buf_offs[_fragis[bi]]; + block_err=oc_enc_frag_sad(_enc, + _src+frag_offs,_ref+frag_offs+mvoffset,_ystride); + _block_err[bi]=block_err; + err+=block_err; + } + return err; +} + +static int oc_mcenc_ysatd_check_mbcandidate_fullpel(const oc_enc_ctx *_enc, + const ptrdiff_t *_frag_buf_offs,const ptrdiff_t _fragis[4],int _dx,int _dy, + const unsigned char *_src,const unsigned char *_ref,int _ystride){ + int mvoffset; + int err; + int bi; + mvoffset=_dx+_dy*_ystride; + err=0; + for(bi=0;bi<4;bi++){ + ptrdiff_t frag_offs; + frag_offs=_frag_buf_offs[_fragis[bi]]; + err+=oc_enc_frag_satd_thresh(_enc, + _src+frag_offs,_ref+frag_offs+mvoffset,_ystride,UINT_MAX); + } + return err; +} + +static unsigned oc_mcenc_ysatd_check_bcandidate_fullpel(const oc_enc_ctx *_enc, + ptrdiff_t _frag_offs,int _dx,int _dy, + const unsigned char *_src,const unsigned char *_ref,int _ystride){ + return oc_enc_frag_satd_thresh(_enc, + _src+_frag_offs,_ref+_frag_offs+_dx+_dy*_ystride,_ystride,UINT_MAX); +} + +/*Perform a motion vector search for this macro block against a single + reference frame. + As a bonus, individual block motion vectors are computed as well, as much of + the work can be shared. + The actual motion vector is stored in the appropriate place in the + oc_mb_enc_info structure. + _mcenc: The motion compensation context. + _accum: Drop frame/golden MV accumulators. + _mbi: The macro block index. + _frame: The frame to search, either OC_FRAME_PREV or OC_FRAME_GOLD.*/ +void oc_mcenc_search_frame(oc_enc_ctx *_enc,int _accum[2],int _mbi,int _frame){ + /*Note: Traditionally this search is done using a rate-distortion objective + function of the form D+lambda*R. + However, xiphmont tested this and found it produced a small degredation, + while requiring extra computation. + This is most likely due to Theora's peculiar MV encoding scheme: MVs are + not coded relative to a predictor, and the only truly cheap way to use a + MV is in the LAST or LAST2 MB modes, which are not being considered here. + Therefore if we use the MV found here, it's only because both LAST and + LAST2 performed poorly, and therefore the MB is not likely to be uniform + or suffer from the aperture problem. + Furthermore we would like to re-use the MV found here for as many MBs as + possible, so picking a slightly sub-optimal vector to save a bit or two + may cause increased degredation in many blocks to come. + We could artificially reduce lambda to compensate, but it's faster to just + disable it entirely, and use D (the distortion) as the sole criterion.*/ + oc_mcenc_ctx mcenc; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *fragis; + const unsigned char *src; + const unsigned char *ref; + int ystride; + oc_mb_enc_info *embs; + ogg_int32_t hit_cache[31]; + ogg_int32_t hitbit; + unsigned best_block_err[4]; + unsigned block_err[4]; + unsigned best_err; + int best_vec[2]; + int best_block_vec[4][2]; + int candx; + int candy; + int bi; + embs=_enc->mb_info; + /*Find some candidate motion vectors.*/ + oc_mcenc_find_candidates(_enc,&mcenc,_accum,_mbi,_frame); + /*Clear the cache of locations we've examined.*/ + memset(hit_cache,0,sizeof(hit_cache)); + /*Start with the median predictor.*/ + candx=mcenc.candidates[0][0]; + candy=mcenc.candidates[0][1]; + hit_cache[candy+15]|=(ogg_int32_t)1<state.frag_buf_offs; + fragis=_enc->state.mb_maps[_mbi][0]; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[_frame]]; + ystride=_enc->state.ref_ystride[0]; + /*TODO: customize error function for speed/(quality+size) tradeoff.*/ + best_err=oc_mcenc_ysad_check_mbcandidate_fullpel(_enc, + frag_buf_offs,fragis,candx,candy,src,ref,ystride,block_err); + best_vec[0]=candx; + best_vec[1]=candy; + if(_frame==OC_FRAME_PREV){ + for(bi=0;bi<4;bi++){ + best_block_err[bi]=block_err[bi]; + best_block_vec[bi][0]=candx; + best_block_vec[bi][1]=candy; + } + } + /*If this predictor fails, move on to set A.*/ + if(best_err>OC_YSAD_THRESH1){ + unsigned err; + unsigned t2; + int ncs; + int ci; + /*Compute the early termination threshold for set A.*/ + t2=embs[_mbi].error[_frame]; + ncs=OC_MINI(3,embs[_mbi].ncneighbors); + for(ci=0;ci>OC_YSAD_THRESH2_SCALE_BITS)+OC_YSAD_THRESH2_OFFSET; + /*Examine the candidates in set A.*/ + for(ci=1;cit2){ + /*Examine the candidates in set B.*/ + for(;cit2){ + int best_site; + int nsites; + int sitei; + int site; + int b; + /*Square pattern search.*/ + for(;;){ + best_site=4; + /*Compose the bit flags for boundary conditions.*/ + b=OC_DIV16(-best_vec[0]+1)|OC_DIV16(best_vec[0]+1)<<1| + OC_DIV16(-best_vec[1]+1)<<2|OC_DIV16(best_vec[1]+1)<<3; + nsites=OC_SQUARE_NSITES[b]; + for(sitei=0;sitei>=2; + for(bi=0;bi<4;bi++){ + if(best_block_err[bi]>t2){ + /*Square pattern search. + We do this in a slightly interesting manner. + We continue to check the SAD of all four blocks in the + macro block. + This gives us two things: + 1) We can continue to use the hit_cache to avoid duplicate + checks. + Otherwise we could continue to read it, but not write to it + without saving and restoring it for each block. + Note that we could still eliminate a large number of + duplicate checks by taking into account the site we came + from when choosing the site list. + We can still do that to avoid extra hit_cache queries, and + it might even be a speed win. + 2) It gives us a slightly better chance of escaping local + minima. + We would not be here if we weren't doing a fairly bad job + in finding a good vector, and checking these vectors can + save us from 100 to several thousand points off our SAD 1 + in 15 times. + TODO: Is this a good idea? + Who knows. + It needs more testing.*/ + for(;;){ + int bestx; + int besty; + int bj; + bestx=best_block_vec[bi][0]; + besty=best_block_vec[bi][1]; + /*Compose the bit flags for boundary conditions.*/ + b=OC_DIV16(-bestx+1)|OC_DIV16(bestx+1)<<1| + OC_DIV16(-besty+1)<<2|OC_DIV16(besty+1)<<3; + nsites=OC_SQUARE_NSITES[b]; + for(sitei=0;siteimb_info[_mbi].analysis_mv; + if(_enc->prevframe_dropped){ + accum_p[0]=mvs[0][OC_FRAME_PREV][0]; + accum_p[1]=mvs[0][OC_FRAME_PREV][1]; + } + else accum_p[1]=accum_p[0]=0; + accum_g[0]=mvs[2][OC_FRAME_GOLD][0]; + accum_g[1]=mvs[2][OC_FRAME_GOLD][1]; + mvs[0][OC_FRAME_PREV][0]-=mvs[2][OC_FRAME_PREV][0]; + mvs[0][OC_FRAME_PREV][1]-=mvs[2][OC_FRAME_PREV][1]; + /*Move the motion vector predictors back a frame.*/ + memmove(mvs+1,mvs,2*sizeof(*mvs)); + /*Search the last frame.*/ + oc_mcenc_search_frame(_enc,accum_p,_mbi,OC_FRAME_PREV); + mvs[2][OC_FRAME_PREV][0]=accum_p[0]; + mvs[2][OC_FRAME_PREV][1]=accum_p[1]; + /*GOLDEN MVs are different from PREV MVs in that they're each absolute + offsets from some frame in the past rather than relative offsets from the + frame before. + For predictor calculation to make sense, we need them to be in the same + form as PREV MVs.*/ + mvs[1][OC_FRAME_GOLD][0]-=mvs[2][OC_FRAME_GOLD][0]; + mvs[1][OC_FRAME_GOLD][1]-=mvs[2][OC_FRAME_GOLD][1]; + mvs[2][OC_FRAME_GOLD][0]-=accum_g[0]; + mvs[2][OC_FRAME_GOLD][1]-=accum_g[1]; + /*Search the golden frame.*/ + oc_mcenc_search_frame(_enc,accum_g,_mbi,OC_FRAME_GOLD); + /*Put GOLDEN MVs back into absolute offset form. + The newest MV is already an absolute offset.*/ + mvs[2][OC_FRAME_GOLD][0]+=accum_g[0]; + mvs[2][OC_FRAME_GOLD][1]+=accum_g[1]; + mvs[1][OC_FRAME_GOLD][0]+=mvs[2][OC_FRAME_GOLD][0]; + mvs[1][OC_FRAME_GOLD][1]+=mvs[2][OC_FRAME_GOLD][1]; +} + +#if 0 +static int oc_mcenc_ysad_halfpel_mbrefine(const oc_enc_ctx *_enc,int _mbi, + int _vec[2],int _best_err,int _frame){ + const unsigned char *src; + const unsigned char *ref; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *fragis; + int offset_y[9]; + int ystride; + int mvoffset_base; + int best_site; + int sitei; + int err; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[_framei]]; + frag_buf_offs=_enc->state.frag_buf_offs; + fragis=_enc->state.mb_maps[_mbi][0]; + ystride=_enc->state.ref_ystride[0]; + mvoffset_base=_vec[0]+_vec[1]*ystride; + offset_y[0]=offset_y[1]=offset_y[2]=-ystride; + offset_y[3]=offset_y[5]=0; + offset_y[6]=offset_y[7]=offset_y[8]=ystride; + best_site=4; + for(sitei=0;sitei<8;sitei++){ + int site; + int xmask; + int ymask; + int dx; + int dy; + int mvoffset0; + int mvoffset1; + site=OC_SQUARE_SITES[0][sitei]; + dx=OC_SQUARE_DX[site]; + dy=OC_SQUARE_DY[site]; + /*The following code SHOULD be equivalent to + oc_state_get_mv_offsets(&_mcenc->enc.state,&mvoffset0,&mvoffset1, + (_vec[0]<<1)+dx,(_vec[1]<<1)+dy,ref_ystride,0); + However, it should also be much faster, as it involves no multiplies and + doesn't have to handle chroma vectors.*/ + xmask=OC_SIGNMASK(((_vec[0]<<1)+dx)^dx); + ymask=OC_SIGNMASK(((_vec[1]<<1)+dy)^dy); + mvoffset0=mvoffset_base+(dx&xmask)+(offset_y[site]&ymask); + mvoffset1=mvoffset_base+(dx&~xmask)+(offset_y[site]&~ymask); + err=oc_sad16_halfpel(_enc,frag_buf_offs,fragis, + mvoffset0,mvoffset1,src,ref,ystride,_best_err); + if(err<_best_err){ + _best_err=err; + best_site=site; + } + } + _vec[0]=(_vec[0]<<1)+OC_SQUARE_DX[best_site]; + _vec[1]=(_vec[1]<<1)+OC_SQUARE_DY[best_site]; + return _best_err; +} +#endif + +static unsigned oc_mcenc_ysatd_halfpel_mbrefine(const oc_enc_ctx *_enc, + int _mbi,int _vec[2],unsigned _best_err,int _frame){ + const unsigned char *src; + const unsigned char *ref; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *fragis; + int offset_y[9]; + int ystride; + int mvoffset_base; + int best_site; + int sitei; + int err; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[_frame]]; + frag_buf_offs=_enc->state.frag_buf_offs; + fragis=_enc->state.mb_maps[_mbi][0]; + ystride=_enc->state.ref_ystride[0]; + mvoffset_base=_vec[0]+_vec[1]*ystride; + offset_y[0]=offset_y[1]=offset_y[2]=-ystride; + offset_y[3]=offset_y[5]=0; + offset_y[6]=offset_y[7]=offset_y[8]=ystride; + best_site=4; + for(sitei=0;sitei<8;sitei++){ + int site; + int xmask; + int ymask; + int dx; + int dy; + int mvoffset0; + int mvoffset1; + site=OC_SQUARE_SITES[0][sitei]; + dx=OC_SQUARE_DX[site]; + dy=OC_SQUARE_DY[site]; + /*The following code SHOULD be equivalent to + oc_state_get_mv_offsets(&_mcenc->enc.state,&mvoffset0,&mvoffset1, + (_vec[0]<<1)+dx,(_vec[1]<<1)+dy,ref_ystride,0); + However, it should also be much faster, as it involves no multiplies and + doesn't have to handle chroma vectors.*/ + xmask=OC_SIGNMASK(((_vec[0]<<1)+dx)^dx); + ymask=OC_SIGNMASK(((_vec[1]<<1)+dy)^dy); + mvoffset0=mvoffset_base+(dx&xmask)+(offset_y[site]&ymask); + mvoffset1=mvoffset_base+(dx&~xmask)+(offset_y[site]&~ymask); + err=oc_satd16_halfpel(_enc,frag_buf_offs,fragis, + mvoffset0,mvoffset1,src,ref,ystride,_best_err); + if(err<_best_err){ + _best_err=err; + best_site=site; + } + } + _vec[0]=(_vec[0]<<1)+OC_SQUARE_DX[best_site]; + _vec[1]=(_vec[1]<<1)+OC_SQUARE_DY[best_site]; + return _best_err; +} + +void oc_mcenc_refine1mv(oc_enc_ctx *_enc,int _mbi,int _frame){ + oc_mb_enc_info *embs; + int vec[2]; + embs=_enc->mb_info; + vec[0]=OC_DIV2(embs[_mbi].analysis_mv[0][_frame][0]); + vec[1]=OC_DIV2(embs[_mbi].analysis_mv[0][_frame][1]); + embs[_mbi].satd[_frame]=oc_mcenc_ysatd_halfpel_mbrefine(_enc, + _mbi,vec,embs[_mbi].satd[_frame],_frame); + embs[_mbi].analysis_mv[0][_frame][0]=(signed char)vec[0]; + embs[_mbi].analysis_mv[0][_frame][1]=(signed char)vec[1]; +} + +#if 0 +static int oc_mcenc_ysad_halfpel_brefine(const oc_enc_ctx *_enc, + int _vec[2],const unsigned char *_src,const unsigned char *_ref,int _ystride, + int _offset_y[9],unsigned _best_err){ + int mvoffset_base; + int best_site; + int sitei; + mvoffset_base=_vec[0]+_vec[1]*_ystride; + best_site=4; + for(sitei=0;sitei<8;sitei++){ + unsigned err; + int site; + int xmask; + int ymask; + int dx; + int dy; + int mvoffset0; + int mvoffset1; + site=OC_SQUARE_SITES[0][sitei]; + dx=OC_SQUARE_DX[site]; + dy=OC_SQUARE_DY[site]; + /*The following code SHOULD be equivalent to + oc_state_get_mv_offsets(&_mcenc->enc.state,&mvoffset0,&mvoffset1, + (_vec[0]<<1)+dx,(_vec[1]<<1)+dy,ref_ystride,0); + However, it should also be much faster, as it involves no multiplies and + doesn't have to handle chroma vectors.*/ + xmask=OC_SIGNMASK(((_vec[0]<<1)+dx)^dx); + ymask=OC_SIGNMASK(((_vec[1]<<1)+dy)^dy); + mvoffset0=mvoffset_base+(dx&xmask)+(_offset_y[site]&ymask); + mvoffset1=mvoffset_base+(dx&~xmask)+(_offset_y[site]&~ymask); + err=oc_enc_frag_sad2_thresh(_enc,_src, + _ref+mvoffset0,_ref+mvoffset1,ystride,_best_err); + if(err<_best_err){ + _best_err=err; + best_site=site; + } + } + _vec[0]=(_vec[0]<<1)+OC_SQUARE_DX[best_site]; + _vec[1]=(_vec[1]<<1)+OC_SQUARE_DY[best_site]; + return _best_err; +} +#endif + +static unsigned oc_mcenc_ysatd_halfpel_brefine(const oc_enc_ctx *_enc, + int _vec[2],const unsigned char *_src,const unsigned char *_ref,int _ystride, + int _offset_y[9],unsigned _best_err){ + int mvoffset_base; + int best_site; + int sitei; + mvoffset_base=_vec[0]+_vec[1]*_ystride; + best_site=4; + for(sitei=0;sitei<8;sitei++){ + unsigned err; + int site; + int xmask; + int ymask; + int dx; + int dy; + int mvoffset0; + int mvoffset1; + site=OC_SQUARE_SITES[0][sitei]; + dx=OC_SQUARE_DX[site]; + dy=OC_SQUARE_DY[site]; + /*The following code SHOULD be equivalent to + oc_state_get_mv_offsets(&_enc->state,&mvoffsets,0, + (_vec[0]<<1)+dx,(_vec[1]<<1)+dy); + However, it should also be much faster, as it involves no multiplies and + doesn't have to handle chroma vectors.*/ + xmask=OC_SIGNMASK(((_vec[0]<<1)+dx)^dx); + ymask=OC_SIGNMASK(((_vec[1]<<1)+dy)^dy); + mvoffset0=mvoffset_base+(dx&xmask)+(_offset_y[site]&ymask); + mvoffset1=mvoffset_base+(dx&~xmask)+(_offset_y[site]&~ymask); + err=oc_enc_frag_satd2_thresh(_enc,_src, + _ref+mvoffset0,_ref+mvoffset1,_ystride,_best_err); + if(err<_best_err){ + _best_err=err; + best_site=site; + } + } + _vec[0]=(_vec[0]<<1)+OC_SQUARE_DX[best_site]; + _vec[1]=(_vec[1]<<1)+OC_SQUARE_DY[best_site]; + return _best_err; +} + +void oc_mcenc_refine4mv(oc_enc_ctx *_enc,int _mbi){ + oc_mb_enc_info *embs; + const ptrdiff_t *frag_buf_offs; + const ptrdiff_t *fragis; + const unsigned char *src; + const unsigned char *ref; + int offset_y[9]; + int ystride; + int bi; + ystride=_enc->state.ref_ystride[0]; + frag_buf_offs=_enc->state.frag_buf_offs; + fragis=_enc->state.mb_maps[_mbi][0]; + src=_enc->state.ref_frame_data[OC_FRAME_IO]; + ref=_enc->state.ref_frame_data[_enc->state.ref_frame_idx[OC_FRAME_PREV]]; + offset_y[0]=offset_y[1]=offset_y[2]=-ystride; + offset_y[3]=offset_y[5]=0; + offset_y[6]=offset_y[7]=offset_y[8]=ystride; + embs=_enc->mb_info; + for(bi=0;bi<4;bi++){ + ptrdiff_t frag_offs; + int vec[2]; + frag_offs=frag_buf_offs[fragis[bi]]; + vec[0]=OC_DIV2(embs[_mbi].block_mv[bi][0]); + vec[1]=OC_DIV2(embs[_mbi].block_mv[bi][1]); + embs[_mbi].block_satd[bi]=oc_mcenc_ysatd_halfpel_brefine(_enc,vec, + src+frag_offs,ref+frag_offs,ystride,offset_y,embs[_mbi].block_satd[bi]); + embs[_mbi].ref_mv[bi][0]=(signed char)vec[0]; + embs[_mbi].ref_mv[bi][1]=(signed char)vec[1]; + } +} diff --git a/libs/libtheora-1.1/lib/modedec.h b/libs/libtheora-1.1/lib/modedec.h new file mode 100644 index 00000000..ea12c64a --- /dev/null +++ b/libs/libtheora-1.1/lib/modedec.h @@ -0,0 +1,4027 @@ +/*File generated by libtheora with OC_COLLECT_METRICS defined at compile time.*/ +#if !defined(_modedec_H) +# define _modedec_H (1) + + + +# if defined(OC_COLLECT_METRICS) +typedef struct oc_mode_metrics oc_mode_metrics; +# endif +typedef struct oc_mode_rd oc_mode_rd; + + + +/*The number of extra bits of precision at which to store rate metrics.*/ +# define OC_BIT_SCALE (6) +/*The number of extra bits of precision at which to store RMSE metrics. + This must be at least half OC_BIT_SCALE (rounded up).*/ +# define OC_RMSE_SCALE (5) +/*The number of bins to partition statistics into.*/ +# define OC_SAD_BINS (24) +/*The number of bits of precision to drop from SAD scores to assign them to a + bin.*/ +# define OC_SAD_SHIFT (9) + + + +# if defined(OC_COLLECT_METRICS) +struct oc_mode_metrics{ + double fragw; + double satd; + double rate; + double rmse; + double satd2; + double satdrate; + double rate2; + double satdrmse; + double rmse2; +}; + + +int oc_has_mode_metrics; +oc_mode_metrics OC_MODE_METRICS[64][3][2][OC_SAD_BINS]; +# endif + + + +struct oc_mode_rd{ + ogg_int16_t rate; + ogg_int16_t rmse; +}; + + +# if !defined(OC_COLLECT_METRICS) +static const +# endif +oc_mode_rd OC_MODE_RD[64][3][2][OC_SAD_BINS]={ + { + { + /*Y' qi=0 INTRA*/ + { + { 87, -66},{ 132, 1611},{ 197, 3474},{ 285, 5130}, + { 376, 6419},{ 450, 7545},{ 521, 8587},{ 600, 9587}, + { 689,10498},{ 790,11348},{ 899,12158},{ 1030,12855}, + { 1166,13459},{ 1276,14052},{ 1353,14732},{ 1444,15425}, + { 1535,16101},{ 1609,16856},{ 1697,17532},{ 1823,17995}, + { 1962,18426},{ 2085,18919},{ 2201,19503},{ 2304,20307} + }, + /*Y' qi=0 INTER*/ + { + { 32, -105},{ 40, 1268},{ 54, 2919},{ 91, 4559}, + { 118, 6244},{ 132, 7932},{ 142, 9514},{ 149,10989}, + { 155,12375},{ 161,13679},{ 168,14958},{ 176,16215}, + { 187,17431},{ 196,18623},{ 207,19790},{ 218,20941}, + { 230,22083},{ 246,23213},{ 265,24333},{ 292,25439}, + { 328,26512},{ 372,27538},{ 427,28522},{ 494,29479} + } + }, + { + /*Cb qi=0 INTRA*/ + { + { 1, 6},{ 27, 368},{ 52, 738},{ 67, 1171}, + { 80, 1642},{ 99, 2134},{ 110, 2642},{ 112, 3144}, + { 126, 3578},{ 154, 3967},{ 167, 4387},{ 172, 4839}, + { 191, 5278},{ 208, 5666},{ 220, 6036},{ 223, 6398}, + { 227, 6814},{ 253, 7157},{ 284, 7403},{ 292, 7699}, + { 314, 7983},{ 339, 8203},{ 363, 8460},{ 399, 8919} + }, + /*Cb qi=0 INTER*/ + { + { 68, -55},{ 63, 275},{ 58, 602},{ 53, 936}, + { 50, 1290},{ 54, 1691},{ 58, 2116},{ 62, 2553}, + { 67, 2992},{ 72, 3422},{ 78, 3843},{ 84, 4253}, + { 89, 4658},{ 94, 5062},{ 98, 5455},{ 100, 5848}, + { 102, 6231},{ 104, 6604},{ 104, 6982},{ 105, 7359}, + { 105, 7733},{ 104, 8104},{ 105, 8465},{ 111, 8828} + } + }, + { + /*Cr qi=0 INTRA*/ + { + { 1, 8},{ 23, 375},{ 47, 759},{ 63, 1220}, + { 71, 1693},{ 82, 2171},{ 94, 2652},{ 109, 3103}, + { 125, 3567},{ 133, 3995},{ 151, 4375},{ 168, 4819}, + { 174, 5244},{ 190, 5635},{ 215, 6005},{ 242, 6347}, + { 257, 6758},{ 280, 7068},{ 311, 7336},{ 326, 7652}, + { 346, 7968},{ 372, 8213},{ 388, 8515},{ 408, 9060} + }, + /*Cr qi=0 INTER*/ + { + { 69, 0},{ 60, 314},{ 49, 624},{ 45, 943}, + { 45, 1285},{ 49, 1691},{ 55, 2130},{ 62, 2560}, + { 71, 2973},{ 79, 3385},{ 85, 3800},{ 89, 4207}, + { 92, 4620},{ 95, 5037},{ 96, 5436},{ 97, 5839}, + { 98, 6252},{ 99, 6653},{ 99, 7038},{ 103, 7426}, + { 107, 7810},{ 108, 8178},{ 107, 8539},{ 106, 8937} + } + } + }, + { + { + /*Y' qi=1 INTRA*/ + { + { 81, -71},{ 133, 1610},{ 203, 3460},{ 296, 5083}, + { 392, 6342},{ 467, 7454},{ 541, 8486},{ 625, 9466}, + { 716,10352},{ 823,11181},{ 940,11961},{ 1074,12643}, + { 1211,13233},{ 1324,13807},{ 1408,14489},{ 1504,15167}, + { 1598,15824},{ 1679,16544},{ 1788,17161},{ 1928,17579}, + { 2070,17991},{ 2202,18456},{ 2324,19021},{ 2425,19894} + }, + /*Y' qi=1 INTER*/ + { + { 34, 4},{ 40, 1307},{ 55, 2914},{ 93, 4555}, + { 120, 6243},{ 134, 7912},{ 144, 9468},{ 152,10918}, + { 158,12275},{ 164,13569},{ 171,14846},{ 180,16098}, + { 191,17310},{ 204,18484},{ 216,19636},{ 228,20779}, + { 242,21912},{ 261,23036},{ 286,24146},{ 320,25221}, + { 363,26265},{ 418,27261},{ 485,28203},{ 551,29148} + } + }, + { + /*Cb qi=1 INTRA*/ + { + { 1, 6},{ 28, 367},{ 52, 738},{ 68, 1172}, + { 86, 1644},{ 106, 2135},{ 115, 2642},{ 119, 3141}, + { 132, 3569},{ 157, 3951},{ 172, 4366},{ 177, 4819}, + { 194, 5258},{ 211, 5638},{ 224, 6006},{ 233, 6367}, + { 236, 6784},{ 258, 7121},{ 299, 7357},{ 319, 7637}, + { 337, 7921},{ 358, 8141},{ 381, 8367},{ 401, 8768} + }, + /*Cb qi=1 INTER*/ + { + { 95, -31},{ 81, 295},{ 67, 614},{ 53, 953}, + { 48, 1305},{ 51, 1700},{ 56, 2125},{ 61, 2563}, + { 67, 3008},{ 73, 3435},{ 79, 3844},{ 85, 4251}, + { 90, 4663},{ 95, 5073},{ 98, 5458},{ 100, 5844}, + { 101, 6231},{ 102, 6606},{ 102, 6980},{ 103, 7347}, + { 104, 7726},{ 105, 8096},{ 105, 8453},{ 105, 8789} + } + }, + { + /*Cr qi=1 INTRA*/ + { + { 1, 8},{ 25, 375},{ 50, 759},{ 65, 1221}, + { 74, 1695},{ 86, 2172},{ 101, 2651},{ 117, 3101}, + { 129, 3561},{ 135, 3985},{ 153, 4368},{ 171, 4807}, + { 182, 5223},{ 202, 5608},{ 225, 5964},{ 251, 6300}, + { 271, 6697},{ 295, 6978},{ 324, 7235},{ 348, 7558}, + { 367, 7877},{ 394, 8101},{ 413, 8386},{ 409, 8945} + }, + /*Cr qi=1 INTER*/ + { + { 66, 11},{ 59, 323},{ 51, 631},{ 44, 949}, + { 44, 1292},{ 49, 1703},{ 56, 2140},{ 62, 2566}, + { 69, 2991},{ 77, 3397},{ 84, 3799},{ 89, 4211}, + { 93, 4634},{ 94, 5049},{ 95, 5444},{ 96, 5854}, + { 94, 6260},{ 95, 6640},{ 96, 7032},{ 101, 7423}, + { 104, 7790},{ 105, 8158},{ 109, 8527},{ 108, 8872} + } + } + }, + { + { + /*Y' qi=2 INTRA*/ + { + { 87, -72},{ 139, 1607},{ 213, 3426},{ 315, 4992}, + { 416, 6217},{ 495, 7315},{ 574, 8317},{ 666, 9265}, + { 763,10124},{ 875,10906},{ 1001,11654},{ 1147,12305}, + { 1289,12865},{ 1407,13424},{ 1503,14076},{ 1610,14724}, + { 1720,15342},{ 1815,16020},{ 1937,16579},{ 2084,16981}, + { 2236,17371},{ 2385,17779},{ 2536,18250},{ 2689,18931} + }, + /*Y' qi=2 INTER*/ + { + { 30, -2},{ 40, 1308},{ 57, 2921},{ 96, 4567}, + { 122, 6260},{ 136, 7902},{ 148, 9418},{ 156,10826}, + { 162,12157},{ 169,13448},{ 177,14709},{ 188,15938}, + { 200,17133},{ 213,18295},{ 228,19433},{ 245,20564}, + { 264,21685},{ 289,22790},{ 323,23876},{ 368,24916}, + { 427,25906},{ 499,26837},{ 585,27700},{ 680,28514} + } + }, + { + /*Cb qi=2 INTRA*/ + { + { 1, 6},{ 30, 367},{ 58, 738},{ 77, 1172}, + { 93, 1645},{ 111, 2137},{ 123, 2642},{ 126, 3133}, + { 136, 3553},{ 162, 3934},{ 178, 4352},{ 183, 4803}, + { 199, 5231},{ 220, 5596},{ 235, 5957},{ 245, 6314}, + { 256, 6718},{ 286, 7048},{ 320, 7285},{ 336, 7568}, + { 366, 7829},{ 387, 8045},{ 405, 8261},{ 445, 8550} + }, + /*Cb qi=2 INTER*/ + { + { 115, -61},{ 93, 277},{ 71, 609},{ 54, 963}, + { 49, 1329},{ 53, 1715},{ 58, 2138},{ 63, 2583}, + { 69, 3017},{ 75, 3442},{ 81, 3857},{ 88, 4263}, + { 93, 4667},{ 96, 5065},{ 101, 5451},{ 101, 5832}, + { 102, 6213},{ 103, 6593},{ 103, 6968},{ 104, 7336}, + { 104, 7710},{ 105, 8076},{ 106, 8440},{ 106, 8822} + } + }, + { + /*Cr qi=2 INTRA*/ + { + { 1, 8},{ 27, 375},{ 54, 759},{ 70, 1222}, + { 79, 1696},{ 89, 2173},{ 106, 2652},{ 123, 3098}, + { 135, 3553},{ 143, 3972},{ 161, 4348},{ 181, 4782}, + { 194, 5189},{ 213, 5565},{ 235, 5907},{ 266, 6229}, + { 286, 6618},{ 311, 6897},{ 339, 7152},{ 362, 7454}, + { 392, 7721},{ 416, 7946},{ 429, 8227},{ 458, 8540} + }, + /*Cr qi=2 INTER*/ + { + { 74, 20},{ 63, 330},{ 51, 635},{ 44, 942}, + { 47, 1287},{ 54, 1710},{ 59, 2147},{ 65, 2571}, + { 72, 2996},{ 79, 3413},{ 86, 3820},{ 91, 4230}, + { 93, 4642},{ 95, 5046},{ 95, 5442},{ 95, 5839}, + { 96, 6243},{ 97, 6641},{ 99, 7021},{ 101, 7396}, + { 103, 7764},{ 106, 8138},{ 109, 8507},{ 114, 8851} + } + } + }, + { + { + /*Y' qi=3 INTRA*/ + { + { 91, -67},{ 141, 1606},{ 219, 3405},{ 328, 4929}, + { 433, 6122},{ 515, 7209},{ 598, 8204},{ 693, 9145}, + { 796, 9986},{ 912,10756},{ 1045,11471},{ 1200,12079}, + { 1345,12640},{ 1471,13179},{ 1571,13809},{ 1678,14450}, + { 1798,15047},{ 1905,15701},{ 2043,16205},{ 2202,16569}, + { 2351,16971},{ 2501,17393},{ 2660,17851},{ 2825,18455} + }, + /*Y' qi=3 INTER*/ + { + { 53, -164},{ 38, 1314},{ 59, 2917},{ 99, 4563}, + { 124, 6253},{ 139, 7882},{ 150, 9375},{ 159,10749}, + { 166,12059},{ 173,13349},{ 183,14608},{ 194,15826}, + { 208,17003},{ 223,18150},{ 240,19287},{ 259,20411}, + { 284,21508},{ 317,22593},{ 359,23656},{ 414,24671}, + { 483,25634},{ 569,26519},{ 670,27332},{ 786,28072} + } + }, + { + /*Cb qi=3 INTRA*/ + { + { 1, 5},{ 31, 367},{ 58, 739},{ 78, 1173}, + { 96, 1645},{ 113, 2134},{ 125, 2638},{ 133, 3127}, + { 148, 3542},{ 171, 3915},{ 184, 4328},{ 192, 4776}, + { 209, 5197},{ 230, 5556},{ 245, 5909},{ 252, 6261}, + { 272, 6641},{ 304, 6942},{ 330, 7184},{ 342, 7477}, + { 380, 7736},{ 404, 7962},{ 428, 8151},{ 469, 8430} + }, + /*Cb qi=3 INTER*/ + { + { 86, -29},{ 72, 296},{ 58, 618},{ 46, 964}, + { 47, 1338},{ 51, 1743},{ 56, 2158},{ 63, 2594}, + { 69, 3035},{ 77, 3455},{ 84, 3859},{ 89, 4266}, + { 94, 4673},{ 98, 5074},{ 101, 5460},{ 101, 5842}, + { 101, 6217},{ 101, 6593},{ 102, 6964},{ 104, 7325}, + { 103, 7696},{ 103, 8056},{ 104, 8430},{ 103, 8792} + } + }, + { + /*Cr qi=3 INTRA*/ + { + { 1, 8},{ 27, 374},{ 56, 759},{ 74, 1221}, + { 83, 1696},{ 96, 2173},{ 113, 2650},{ 127, 3091}, + { 140, 3542},{ 151, 3960},{ 164, 4334},{ 188, 4764}, + { 208, 5144},{ 224, 5493},{ 250, 5841},{ 278, 6162}, + { 298, 6548},{ 334, 6816},{ 365, 7045},{ 388, 7343}, + { 419, 7613},{ 443, 7836},{ 455, 8105},{ 484, 8445} + }, + /*Cr qi=3 INTER*/ + { + { 76, 26},{ 65, 332},{ 53, 638},{ 45, 945}, + { 45, 1304},{ 53, 1725},{ 60, 2153},{ 68, 2584}, + { 74, 3007},{ 81, 3425},{ 87, 3844},{ 91, 4253}, + { 94, 4657},{ 95, 5061},{ 94, 5462},{ 94, 5856}, + { 95, 6250},{ 96, 6635},{ 97, 7014},{ 101, 7393}, + { 104, 7761},{ 106, 8137},{ 109, 8506},{ 111, 8823} + } + } + }, + { + { + /*Y' qi=4 INTRA*/ + { + { 80, -67},{ 143, 1603},{ 227, 3378},{ 344, 4861}, + { 454, 6026},{ 537, 7104},{ 626, 8089},{ 725, 9006}, + { 830, 9827},{ 950,10581},{ 1089,11270},{ 1257,11826}, + { 1409,12366},{ 1535,12912},{ 1640,13528},{ 1753,14173}, + { 1884,14756},{ 2007,15368},{ 2148,15852},{ 2307,16212}, + { 2464,16591},{ 2614,17019},{ 2785,17455},{ 2970,17963} + }, + /*Y' qi=4 INTER*/ + { + { 50, -145},{ 38, 1324},{ 61, 2921},{ 102, 4566}, + { 127, 6248},{ 142, 7845},{ 154, 9300},{ 163,10656}, + { 169,11965},{ 177,13246},{ 188,14495},{ 202,15702}, + { 218,16864},{ 236,18003},{ 256,19124},{ 278,20233}, + { 307,21330},{ 347,22398},{ 398,23437},{ 463,24429}, + { 546,25343},{ 649,26170},{ 767,26935},{ 888,27674} + } + }, + { + /*Cb qi=4 INTRA*/ + { + { 1, 5},{ 33, 367},{ 61, 739},{ 80, 1173}, + { 98, 1646},{ 114, 2136},{ 126, 2639},{ 137, 3124}, + { 152, 3535},{ 176, 3903},{ 194, 4307},{ 206, 4753}, + { 222, 5165},{ 242, 5508},{ 260, 5857},{ 272, 6205}, + { 294, 6559},{ 332, 6848},{ 356, 7104},{ 364, 7389}, + { 396, 7637},{ 415, 7878},{ 446, 8064},{ 506, 8294} + }, + /*Cb qi=4 INTER*/ + { + { 86, -15},{ 73, 308},{ 60, 627},{ 46, 967}, + { 47, 1343},{ 51, 1754},{ 56, 2183},{ 63, 2615}, + { 70, 3044},{ 79, 3459},{ 85, 3866},{ 90, 4276}, + { 94, 4686},{ 97, 5088},{ 100, 5467},{ 102, 5837}, + { 102, 6205},{ 101, 6569},{ 103, 6939},{ 104, 7317}, + { 105, 7690},{ 107, 8043},{ 107, 8394},{ 111, 8736} + } + }, + { + /*Cr qi=4 INTRA*/ + { + { 1, 7},{ 28, 375},{ 57, 759},{ 79, 1221}, + { 92, 1697},{ 105, 2174},{ 122, 2648},{ 135, 3085}, + { 146, 3530},{ 157, 3947},{ 171, 4316},{ 195, 4737}, + { 218, 5117},{ 239, 5445},{ 268, 5767},{ 295, 6074}, + { 315, 6460},{ 355, 6735},{ 392, 6933},{ 418, 7218}, + { 448, 7495},{ 471, 7688},{ 481, 7954},{ 504, 8313} + }, + /*Cr qi=4 INTER*/ + { + { 68, 28},{ 57, 334},{ 47, 639},{ 43, 953}, + { 48, 1314},{ 54, 1736},{ 59, 2169},{ 69, 2592}, + { 78, 3017},{ 84, 3434},{ 88, 3850},{ 92, 4260}, + { 95, 4663},{ 96, 5068},{ 95, 5455},{ 95, 5839}, + { 96, 6243},{ 97, 6626},{ 98, 7006},{ 101, 7390}, + { 104, 7755},{ 108, 8115},{ 111, 8471},{ 110, 8825} + } + } + }, + { + { + /*Y' qi=5 INTRA*/ + { + { 84, -69},{ 147, 1599},{ 237, 3350},{ 360, 4796}, + { 475, 5934},{ 562, 6992},{ 657, 7953},{ 765, 8837}, + { 874, 9641},{ 998,10384},{ 1146,11047},{ 1322,11572}, + { 1484,12076},{ 1617,12609},{ 1731,13203},{ 1856,13806}, + { 1995,14367},{ 2132,14936},{ 2289,15386},{ 2460,15721}, + { 2635,16066},{ 2802,16442},{ 2980,16805},{ 3177,17272} + }, + /*Y' qi=5 INTER*/ + { + { 38, -86},{ 37, 1349},{ 64, 2920},{ 105, 4563}, + { 129, 6236},{ 145, 7809},{ 158, 9236},{ 167,10572}, + { 174,11871},{ 182,13141},{ 195,14368},{ 212,15558}, + { 230,16706},{ 250,17828},{ 274,18944},{ 303,20041}, + { 342,21116},{ 394,22152},{ 460,23144},{ 543,24073}, + { 648,24919},{ 773,25673},{ 922,26323},{ 1084,26924} + } + }, + { + /*Cb qi=5 INTRA*/ + { + { 1, 5},{ 34, 367},{ 63, 739},{ 82, 1174}, + { 102, 1647},{ 119, 2137},{ 134, 2639},{ 145, 3121}, + { 161, 3529},{ 189, 3891},{ 207, 4290},{ 216, 4721}, + { 232, 5113},{ 258, 5455},{ 277, 5798},{ 294, 6124}, + { 322, 6427},{ 352, 6697},{ 370, 6982},{ 384, 7283}, + { 423, 7529},{ 448, 7766},{ 478, 7943},{ 527, 8151} + }, + /*Cb qi=5 INTER*/ + { + { 83, -49},{ 69, 284},{ 55, 611},{ 48, 961}, + { 49, 1355},{ 52, 1769},{ 58, 2191},{ 65, 2616}, + { 73, 3041},{ 80, 3460},{ 87, 3868},{ 92, 4276}, + { 95, 4682},{ 98, 5077},{ 100, 5459},{ 102, 5827}, + { 102, 6200},{ 102, 6568},{ 103, 6930},{ 103, 7303}, + { 104, 7672},{ 106, 8032},{ 106, 8391},{ 106, 8727} + } + }, + { + /*Cr qi=5 INTRA*/ + { + { 1, 8},{ 28, 375},{ 57, 760},{ 81, 1222}, + { 99, 1696},{ 111, 2175},{ 125, 2648},{ 140, 3079}, + { 152, 3520},{ 162, 3927},{ 179, 4294},{ 203, 4714}, + { 225, 5080},{ 254, 5389},{ 286, 5703},{ 318, 5997}, + { 342, 6364},{ 380, 6640},{ 416, 6837},{ 445, 7103}, + { 473, 7370},{ 497, 7562},{ 514, 7811},{ 549, 8148} + }, + /*Cr qi=5 INTER*/ + { + { 60, 6},{ 54, 323},{ 46, 638},{ 43, 958}, + { 45, 1329},{ 54, 1749},{ 61, 2175},{ 70, 2600}, + { 79, 3021},{ 85, 3437},{ 89, 3847},{ 93, 4254}, + { 95, 4660},{ 96, 5065},{ 95, 5456},{ 95, 5849}, + { 96, 6243},{ 96, 6621},{ 97, 6996},{ 101, 7366}, + { 104, 7722},{ 107, 8088},{ 111, 8448},{ 119, 8816} + } + } + }, + { + { + /*Y' qi=6 INTRA*/ + { + { 88, -69},{ 151, 1593},{ 251, 3294},{ 387, 4681}, + { 507, 5790},{ 601, 6837},{ 702, 7787},{ 813, 8648}, + { 927, 9427},{ 1059,10152},{ 1213,10787},{ 1399,11284}, + { 1568,11781},{ 1705,12312},{ 1823,12890},{ 1957,13482}, + { 2106,14036},{ 2249,14600},{ 2411,15042},{ 2588,15359}, + { 2772,15699},{ 2947,16062},{ 3127,16429},{ 3320,16849} + }, + /*Y' qi=6 INTER*/ + { + { 44, -80},{ 36, 1346},{ 69, 2919},{ 111, 4563}, + { 136, 6216},{ 154, 7746},{ 168, 9139},{ 178,10461}, + { 185,11747},{ 195,13007},{ 211,14229},{ 230,15408}, + { 250,16547},{ 274,17663},{ 302,18769},{ 339,19851}, + { 386,20907},{ 446,21933},{ 527,22884},{ 631,23746}, + { 760,24512},{ 914,25178},{ 1087,25758},{ 1278,26262} + } + }, + { + /*Cb qi=6 INTRA*/ + { + { 1, 4},{ 36, 367},{ 66, 739},{ 84, 1174}, + { 105, 1648},{ 126, 2139},{ 140, 2639},{ 149, 3116}, + { 164, 3523},{ 194, 3880},{ 217, 4271},{ 226, 4694}, + { 243, 5077},{ 270, 5407},{ 291, 5742},{ 310, 6061}, + { 340, 6340},{ 373, 6609},{ 394, 6890},{ 409, 7189}, + { 444, 7434},{ 469, 7652},{ 499, 7853},{ 559, 8135} + }, + /*Cb qi=6 INTER*/ + { + { 68, -46},{ 60, 291},{ 50, 623},{ 49, 971}, + { 50, 1357},{ 55, 1781},{ 61, 2211},{ 69, 2634}, + { 78, 3052},{ 86, 3466},{ 91, 3882},{ 95, 4292}, + { 98, 4691},{ 101, 5080},{ 102, 5458},{ 103, 5830}, + { 103, 6192},{ 104, 6554},{ 104, 6916},{ 106, 7278}, + { 108, 7641},{ 110, 8004},{ 112, 8371},{ 112, 8758} + } + }, + { + /*Cr qi=6 INTRA*/ + { + { 1, 8},{ 29, 375},{ 59, 760},{ 84, 1223}, + { 99, 1698},{ 112, 2176},{ 129, 2647},{ 143, 3076}, + { 156, 3510},{ 168, 3906},{ 189, 4269},{ 220, 4682}, + { 241, 5047},{ 266, 5342},{ 299, 5649},{ 331, 5954}, + { 357, 6309},{ 393, 6579},{ 431, 6765},{ 467, 6997}, + { 501, 7276},{ 520, 7488},{ 525, 7749},{ 548, 8146} + }, + /*Cr qi=6 INTER*/ + { + { 94, 31},{ 69, 335},{ 47, 641},{ 43, 967}, + { 50, 1350},{ 57, 1772},{ 65, 2197},{ 74, 2625}, + { 83, 3043},{ 90, 3454},{ 94, 3867},{ 97, 4273}, + { 98, 4671},{ 99, 5068},{ 99, 5461},{ 98, 5857}, + { 98, 6245},{ 99, 6610},{ 103, 6975},{ 105, 7345}, + { 108, 7712},{ 111, 8073},{ 113, 8415},{ 119, 8768} + } + } + }, + { + { + /*Y' qi=7 INTRA*/ + { + { 92, -70},{ 156, 1590},{ 261, 3267},{ 403, 4618}, + { 529, 5704},{ 628, 6730},{ 736, 7657},{ 856, 8491}, + { 978, 9246},{ 1118, 9943},{ 1281,10550},{ 1472,11028}, + { 1645,11507},{ 1793,12008},{ 1924,12565},{ 2067,13130}, + { 2229,13638},{ 2388,14160},{ 2558,14584},{ 2744,14886}, + { 2932,15194},{ 3116,15531},{ 3311,15858},{ 3538,16197} + }, + /*Y' qi=7 INTER*/ + { + { 43, -8},{ 36, 1351},{ 71, 2923},{ 112, 4568}, + { 138, 6201},{ 157, 7705},{ 171, 9083},{ 181,10390}, + { 189,11664},{ 202,12910},{ 220,14121},{ 241,15281}, + { 266,16401},{ 295,17507},{ 328,18608},{ 371,19677}, + { 430,20701},{ 508,21676},{ 604,22588},{ 727,23397}, + { 878,24093},{ 1055,24690},{ 1263,25151},{ 1496,25504} + } + }, + { + /*Cb qi=7 INTRA*/ + { + { 1, 5},{ 40, 367},{ 72, 740},{ 89, 1175}, + { 108, 1649},{ 129, 2140},{ 143, 2637},{ 154, 3110}, + { 169, 3507},{ 198, 3860},{ 224, 4237},{ 235, 4652}, + { 253, 5037},{ 282, 5358},{ 307, 5674},{ 329, 5986}, + { 361, 6273},{ 393, 6527},{ 419, 6777},{ 435, 7078}, + { 467, 7342},{ 495, 7554},{ 529, 7757},{ 591, 8053} + }, + /*Cb qi=7 INTER*/ + { + { 79, -33},{ 68, 299},{ 56, 627},{ 50, 978}, + { 51, 1366},{ 55, 1786},{ 61, 2213},{ 70, 2642}, + { 80, 3062},{ 87, 3474},{ 92, 3886},{ 96, 4292}, + { 99, 4684},{ 102, 5072},{ 103, 5450},{ 104, 5814}, + { 104, 6176},{ 104, 6538},{ 107, 6905},{ 110, 7270}, + { 110, 7625},{ 110, 7978},{ 111, 8340},{ 117, 8674} + } + }, + { + /*Cr qi=7 INTRA*/ + { + { 2, 7},{ 31, 375},{ 62, 760},{ 87, 1223}, + { 103, 1698},{ 115, 2175},{ 131, 2644},{ 147, 3066}, + { 161, 3494},{ 175, 3889},{ 199, 4250},{ 229, 4653}, + { 250, 5001},{ 279, 5275},{ 311, 5577},{ 343, 5889}, + { 376, 6227},{ 417, 6486},{ 457, 6689},{ 484, 6925}, + { 518, 7174},{ 544, 7393},{ 549, 7662},{ 577, 8050} + }, + /*Cr qi=7 INTER*/ + { + { 89, 22},{ 62, 332},{ 45, 641},{ 47, 976}, + { 52, 1363},{ 59, 1779},{ 67, 2203},{ 76, 2628}, + { 84, 3046},{ 90, 3460},{ 94, 3875},{ 98, 4272}, + { 99, 4666},{ 98, 5063},{ 98, 5459},{ 98, 5849}, + { 99, 6226},{ 101, 6594},{ 104, 6957},{ 109, 7324}, + { 109, 7686},{ 111, 8042},{ 115, 8379},{ 119, 8699} + } + } + }, + { + { + /*Y' qi=8 INTRA*/ + { + { 91, -69},{ 160, 1585},{ 274, 3226},{ 423, 4538}, + { 557, 5596},{ 664, 6595},{ 778, 7506},{ 905, 8319}, + { 1038, 9035},{ 1186, 9701},{ 1355,10292},{ 1554,10754}, + { 1739,11196},{ 1904,11639},{ 2047,12184},{ 2194,12763}, + { 2361,13256},{ 2529,13753},{ 2709,14155},{ 2902,14433}, + { 3100,14723},{ 3292,15026},{ 3489,15327},{ 3714,15705} + }, + /*Y' qi=8 INTER*/ + { + { 32, -157},{ 33, 1346},{ 74, 2914},{ 116, 4554}, + { 142, 6172},{ 162, 7648},{ 177, 9004},{ 186,10300}, + { 196,11570},{ 210,12808},{ 231,14001},{ 256,15150}, + { 285,16259},{ 319,17352},{ 359,18435},{ 415,19475}, + { 489,20470},{ 584,21400},{ 703,22246},{ 852,22968}, + { 1038,23556},{ 1253,24032},{ 1503,24367},{ 1778,24628} + } + }, + { + /*Cb qi=8 INTRA*/ + { + { 1, 4},{ 42, 367},{ 75, 740},{ 93, 1176}, + { 111, 1649},{ 128, 2139},{ 144, 2635},{ 157, 3103}, + { 174, 3494},{ 206, 3844},{ 233, 4207},{ 251, 4605}, + { 277, 4980},{ 304, 5284},{ 335, 5584},{ 359, 5888}, + { 393, 6152},{ 432, 6398},{ 455, 6656},{ 471, 6956}, + { 502, 7193},{ 528, 7405},{ 562, 7630},{ 603, 7922} + }, + /*Cb qi=8 INTER*/ + { + { 77, -37},{ 68, 299},{ 58, 632},{ 50, 991}, + { 50, 1382},{ 55, 1799},{ 62, 2226},{ 73, 2647}, + { 82, 3066},{ 90, 3480},{ 94, 3891},{ 96, 4296}, + { 98, 4687},{ 101, 5073},{ 103, 5456},{ 104, 5817}, + { 105, 6170},{ 106, 6523},{ 107, 6886},{ 108, 7250}, + { 109, 7600},{ 110, 7955},{ 111, 8305},{ 112, 8641} + } + }, + { + /*Cr qi=8 INTRA*/ + { + { 2, 7},{ 33, 375},{ 64, 760},{ 92, 1224}, + { 111, 1700},{ 122, 2173},{ 137, 2637},{ 156, 3055}, + { 172, 3476},{ 186, 3856},{ 211, 4211},{ 242, 4597}, + { 263, 4939},{ 292, 5214},{ 335, 5489},{ 376, 5772}, + { 406, 6099},{ 440, 6378},{ 483, 6578},{ 517, 6797}, + { 550, 7049},{ 571, 7283},{ 583, 7560},{ 618, 7967} + }, + /*Cr qi=8 INTER*/ + { + { 74, 25},{ 58, 328},{ 43, 637},{ 45, 980}, + { 51, 1371},{ 59, 1788},{ 69, 2207},{ 79, 2630}, + { 86, 3051},{ 91, 3470},{ 95, 3880},{ 97, 4280}, + { 98, 4680},{ 97, 5074},{ 96, 5456},{ 97, 5839}, + { 99, 6219},{ 101, 6583},{ 103, 6945},{ 106, 7312}, + { 110, 7671},{ 114, 8009},{ 115, 8345},{ 117, 8686} + } + } + }, + { + { + /*Y' qi=9 INTRA*/ + { + { 104, -68},{ 164, 1580},{ 288, 3173},{ 448, 4439}, + { 587, 5485},{ 702, 6465},{ 824, 7351},{ 958, 8148}, + { 1096, 8845},{ 1253, 9480},{ 1432,10047},{ 1640,10494}, + { 1835,10926},{ 2015,11350},{ 2166,11871},{ 2321,12428}, + { 2508,12876},{ 2684,13345},{ 2866,13741},{ 3069,13991}, + { 3281,14243},{ 3487,14518},{ 3689,14813},{ 3911,15175} + }, + /*Y' qi=9 INTER*/ + { + { 47, -140},{ 34, 1348},{ 77, 2915},{ 119, 4552}, + { 145, 6150},{ 166, 7600},{ 182, 8936},{ 192,10221}, + { 203,11482},{ 220,12711},{ 244,13886},{ 274,15012}, + { 308,16111},{ 349,17190},{ 401,18244},{ 470,19257}, + { 561,20209},{ 680,21069},{ 830,21822},{ 1010,22463}, + { 1227,22971},{ 1482,23328},{ 1769,23544},{ 2077,23655} + } + }, + { + /*Cb qi=9 INTRA*/ + { + { 1, 5},{ 43, 367},{ 76, 740},{ 95, 1176}, + { 114, 1649},{ 135, 2138},{ 153, 2629},{ 165, 3091}, + { 184, 3481},{ 217, 3831},{ 244, 4187},{ 260, 4572}, + { 290, 4930},{ 320, 5231},{ 351, 5521},{ 379, 5812}, + { 414, 6055},{ 452, 6307},{ 483, 6564},{ 502, 6848}, + { 525, 7115},{ 554, 7321},{ 589, 7533},{ 626, 7833} + }, + /*Cb qi=9 INTER*/ + { + { 101, -43},{ 81, 298},{ 62, 637},{ 49, 989}, + { 51, 1381},{ 56, 1806},{ 65, 2231},{ 74, 2653}, + { 84, 3071},{ 91, 3482},{ 95, 3892},{ 97, 4293}, + { 99, 4684},{ 101, 5066},{ 103, 5437},{ 103, 5793}, + { 103, 6148},{ 104, 6511},{ 105, 6867},{ 107, 7221}, + { 110, 7572},{ 111, 7926},{ 112, 8283},{ 116, 8625} + } + }, + { + /*Cr qi=9 INTRA*/ + { + { 2, 7},{ 35, 375},{ 66, 761},{ 93, 1224}, + { 112, 1700},{ 126, 2173},{ 144, 2633},{ 165, 3047}, + { 183, 3458},{ 199, 3835},{ 224, 4191},{ 257, 4558}, + { 283, 4887},{ 309, 5176},{ 351, 5446},{ 397, 5713}, + { 433, 6017},{ 469, 6283},{ 508, 6480},{ 546, 6687}, + { 579, 6945},{ 600, 7182},{ 610, 7434},{ 623, 7793} + }, + /*Cr qi=9 INTER*/ + { + { 77, 15},{ 57, 330},{ 45, 640},{ 48, 980}, + { 54, 1380},{ 61, 1802},{ 70, 2220},{ 80, 2639}, + { 87, 3057},{ 92, 3474},{ 94, 3882},{ 98, 4282}, + { 98, 4675},{ 97, 5062},{ 97, 5450},{ 98, 5829}, + { 100, 6197},{ 101, 6561},{ 104, 6927},{ 107, 7289}, + { 113, 7638},{ 117, 7978},{ 119, 8311},{ 117, 8629} + } + } + }, + { + { + /*Y' qi=10 INTRA*/ + { + { 101, -69},{ 168, 1574},{ 299, 3143},{ 465, 4386}, + { 610, 5410},{ 736, 6353},{ 866, 7207},{ 1006, 7982}, + { 1153, 8655},{ 1319, 9261},{ 1504, 9812},{ 1719,10248}, + { 1928,10653},{ 2116,11056},{ 2282,11550},{ 2458,12070}, + { 2654,12492},{ 2846,12923},{ 3043,13291},{ 3249,13537}, + { 3466,13764},{ 3682,13999},{ 3896,14268},{ 4145,14548} + }, + /*Y' qi=10 INTER*/ + { + { 48, -94},{ 34, 1355},{ 81, 2920},{ 124, 4545}, + { 151, 6113},{ 174, 7532},{ 190, 8850},{ 201,10125}, + { 214,11379},{ 235,12591},{ 264,13745},{ 299,14859}, + { 338,15948},{ 388,17008},{ 456,18029},{ 546,18988}, + { 661,19877},{ 808,20666},{ 993,21321},{ 1218,21835}, + { 1481,22203},{ 1783,22420},{ 2117,22504},{ 2469,22481} + } + }, + { + /*Cb qi=10 INTRA*/ + { + { 2, 4},{ 44, 367},{ 79, 740},{ 99, 1178}, + { 117, 1652},{ 137, 2141},{ 156, 2630},{ 170, 3089}, + { 192, 3474},{ 227, 3813},{ 259, 4157},{ 282, 4526}, + { 310, 4860},{ 342, 5140},{ 377, 5425},{ 400, 5714}, + { 436, 5952},{ 475, 6194},{ 496, 6468},{ 522, 6748}, + { 559, 6996},{ 587, 7216},{ 617, 7433},{ 673, 7678} + }, + /*Cb qi=10 INTER*/ + { + { 87, -37},{ 72, 301},{ 58, 636},{ 49, 995}, + { 51, 1394},{ 57, 1819},{ 66, 2241},{ 78, 2660}, + { 87, 3074},{ 93, 3482},{ 97, 3891},{ 99, 4294}, + { 101, 4678},{ 103, 5050},{ 105, 5414},{ 106, 5773}, + { 107, 6134},{ 108, 6485},{ 110, 6832},{ 113, 7187}, + { 113, 7547},{ 114, 7887},{ 117, 8230},{ 112, 8590} + } + }, + { + /*Cr qi=10 INTRA*/ + { + { 2, 7},{ 38, 375},{ 69, 761},{ 96, 1224}, + { 116, 1701},{ 131, 2175},{ 148, 2634},{ 168, 3041}, + { 190, 3439},{ 211, 3802},{ 238, 4151},{ 271, 4506}, + { 297, 4824},{ 331, 5103},{ 373, 5360},{ 415, 5632}, + { 459, 5928},{ 500, 6176},{ 535, 6386},{ 573, 6586}, + { 608, 6834},{ 629, 7079},{ 642, 7337},{ 686, 7680} + }, + /*Cr qi=10 INTER*/ + { + { 81, 34},{ 63, 333},{ 50, 633},{ 48, 987}, + { 53, 1397},{ 61, 1820},{ 71, 2237},{ 83, 2651}, + { 91, 3065},{ 95, 3479},{ 98, 3882},{ 100, 4279}, + { 101, 4673},{ 101, 5054},{ 100, 5429},{ 101, 5801}, + { 102, 6173},{ 104, 6541},{ 108, 6904},{ 110, 7264}, + { 114, 7609},{ 119, 7945},{ 123, 8275},{ 128, 8615} + } + } + }, + { + { + /*Y' qi=11 INTRA*/ + { + { 110, -66},{ 176, 1564},{ 316, 3087},{ 492, 4296}, + { 645, 5299},{ 781, 6217},{ 924, 7039},{ 1075, 7776}, + { 1232, 8421},{ 1410, 9005},{ 1607, 9532},{ 1834, 9929}, + { 2053,10300},{ 2249,10697},{ 2427,11184},{ 2619,11682}, + { 2826,12083},{ 3019,12508},{ 3225,12869},{ 3452,13064}, + { 3670,13280},{ 3890,13519},{ 4123,13750},{ 4367,14059} + }, + /*Y' qi=11 INTER*/ + { + { 72, -115},{ 32, 1354},{ 83, 2911},{ 126, 4534}, + { 154, 6080},{ 178, 7475},{ 194, 8779},{ 205,10047}, + { 222,11290},{ 246,12488},{ 281,13621},{ 322,14714}, + { 372,15786},{ 436,16821},{ 519,17813},{ 628,18728}, + { 770,19549},{ 950,20254},{ 1175,20800},{ 1443,21197}, + { 1752,21446},{ 2095,21555},{ 2457,21553},{ 2808,21544} + } + }, + { + /*Cb qi=11 INTRA*/ + { + { 2, 4},{ 45, 367},{ 81, 740},{ 101, 1177}, + { 121, 1650},{ 142, 2136},{ 159, 2621},{ 174, 3075}, + { 199, 3451},{ 234, 3778},{ 265, 4117},{ 297, 4473}, + { 333, 4789},{ 367, 5054},{ 402, 5319},{ 427, 5613}, + { 462, 5871},{ 503, 6107},{ 532, 6336},{ 560, 6584}, + { 601, 6842},{ 631, 7092},{ 662, 7292},{ 721, 7497} + }, + /*Cb qi=11 INTER*/ + { + { 117, -24},{ 93, 308},{ 69, 638},{ 52, 993}, + { 52, 1395},{ 58, 1822},{ 68, 2246},{ 80, 2665}, + { 89, 3082},{ 94, 3492},{ 96, 3900},{ 98, 4299}, + { 101, 4679},{ 103, 5047},{ 104, 5405},{ 106, 5763}, + { 106, 6120},{ 107, 6474},{ 109, 6823},{ 112, 7163}, + { 115, 7516},{ 117, 7868},{ 118, 8213},{ 119, 8561} + } + }, + { + /*Cr qi=11 INTRA*/ + { + { 2, 7},{ 40, 375},{ 75, 761},{ 100, 1224}, + { 119, 1700},{ 137, 2169},{ 154, 2622},{ 178, 3025}, + { 198, 3416},{ 220, 3770},{ 255, 4114},{ 294, 4459}, + { 323, 4756},{ 359, 5028},{ 399, 5292},{ 438, 5556}, + { 483, 5827},{ 518, 6073},{ 551, 6298},{ 598, 6501}, + { 634, 6754},{ 652, 6997},{ 670, 7211},{ 689, 7560} + }, + /*Cr qi=11 INTER*/ + { + { 75, 30},{ 61, 334},{ 51, 639},{ 49, 995}, + { 53, 1403},{ 62, 1821},{ 73, 2237},{ 84, 2654}, + { 91, 3070},{ 95, 3485},{ 96, 3890},{ 98, 4287}, + { 98, 4672},{ 99, 5050},{ 99, 5427},{ 100, 5798}, + { 103, 6169},{ 105, 6528},{ 107, 6881},{ 113, 7233}, + { 118, 7580},{ 121, 7916},{ 125, 8240},{ 130, 8551} + } + } + }, + { + { + /*Y' qi=12 INTRA*/ + { + { 104, -69},{ 182, 1557},{ 335, 3040},{ 521, 4205}, + { 684, 5178},{ 831, 6068},{ 986, 6854},{ 1151, 7559}, + { 1323, 8169},{ 1523, 8704},{ 1736, 9192},{ 1978, 9558}, + { 2213, 9908},{ 2421,10298},{ 2613,10757},{ 2822,11208}, + { 3042,11585},{ 3250,11991},{ 3474,12308},{ 3710,12480}, + { 3939,12687},{ 4174,12902},{ 4416,13102},{ 4672,13369} + }, + /*Y' qi=12 INTER*/ + { + { 52, -91},{ 34, 1355},{ 86, 2911},{ 129, 4518}, + { 159, 6037},{ 184, 7405},{ 200, 8694},{ 213, 9955}, + { 232,11185},{ 263,12360},{ 304,13479},{ 354,14555}, + { 415,15601},{ 495,16608},{ 601,17549},{ 738,18400}, + { 915,19136},{ 1139,19724},{ 1414,20150},{ 1731,20412}, + { 2090,20520},{ 2473,20509},{ 2851,20442},{ 3227,20328} + } + }, + { + /*Cb qi=12 INTRA*/ + { + { 1, 4},{ 46, 367},{ 85, 740},{ 109, 1178}, + { 126, 1650},{ 145, 2134},{ 165, 2617},{ 182, 3061}, + { 209, 3428},{ 245, 3749},{ 281, 4077},{ 316, 4417}, + { 354, 4718},{ 392, 4970},{ 430, 5217},{ 456, 5501}, + { 490, 5771},{ 534, 5996},{ 571, 6207},{ 600, 6458}, + { 644, 6697},{ 675, 6942},{ 707, 7151},{ 766, 7342} + }, + /*Cb qi=12 INTER*/ + { + { 84, -24},{ 73, 311},{ 60, 644},{ 52, 998}, + { 53, 1398},{ 60, 1825},{ 71, 2249},{ 83, 2665}, + { 90, 3081},{ 94, 3490},{ 97, 3893},{ 99, 4286}, + { 102, 4663},{ 104, 5032},{ 105, 5393},{ 106, 5751}, + { 107, 6102},{ 108, 6445},{ 111, 6788},{ 113, 7136}, + { 114, 7483},{ 117, 7828},{ 121, 8163},{ 122, 8496} + } + }, + { + /*Cr qi=12 INTRA*/ + { + { 3, 7},{ 41, 375},{ 78, 761},{ 106, 1225}, + { 124, 1700},{ 140, 2167},{ 163, 2616},{ 188, 3010}, + { 213, 3385},{ 240, 3718},{ 271, 4062},{ 309, 4406}, + { 345, 4691},{ 387, 4956},{ 430, 5212},{ 469, 5467}, + { 513, 5729},{ 554, 5970},{ 587, 6176},{ 633, 6395}, + { 673, 6659},{ 692, 6868},{ 712, 7061},{ 758, 7259} + }, + /*Cr qi=12 INTER*/ + { + { 73, 31},{ 59, 335},{ 48, 638},{ 50, 998}, + { 56, 1410},{ 65, 1827},{ 75, 2240},{ 85, 2657}, + { 92, 3073},{ 95, 3485},{ 97, 3888},{ 99, 4279}, + { 98, 4663},{ 99, 5042},{ 101, 5412},{ 102, 5779}, + { 105, 6142},{ 107, 6498},{ 108, 6848},{ 113, 7198}, + { 118, 7540},{ 121, 7867},{ 127, 8188},{ 132, 8508} + } + } + }, + { + { + /*Y' qi=13 INTRA*/ + { + { 109, -68},{ 187, 1551},{ 347, 3010},{ 541, 4153}, + { 709, 5107},{ 864, 5975},{ 1026, 6745},{ 1194, 7433}, + { 1375, 8021},{ 1581, 8550},{ 1803, 9026},{ 2054, 9371}, + { 2301, 9713},{ 2522,10082},{ 2728,10515},{ 2949,10956}, + { 3184,11297},{ 3408,11653},{ 3643,11946},{ 3886,12100}, + { 4124,12277},{ 4377,12459},{ 4632,12635},{ 4898,12861} + }, + /*Y' qi=13 INTER*/ + { + { 48, -78},{ 35, 1357},{ 89, 2914},{ 133, 4512}, + { 164, 6004},{ 190, 7348},{ 207, 8627},{ 222, 9881}, + { 247,11096},{ 284,12251},{ 333,13350},{ 392,14407}, + { 466,15426},{ 565,16391},{ 696,17279},{ 865,18058}, + { 1085,18689},{ 1358,19156},{ 1684,19456},{ 2050,19605}, + { 2447,19614},{ 2855,19524},{ 3243,19398},{ 3611,19201} + } + }, + { + /*Cb qi=13 INTRA*/ + { + { 2, 4},{ 47, 367},{ 86, 741},{ 108, 1179}, + { 127, 1651},{ 150, 2133},{ 173, 2611},{ 194, 3050}, + { 222, 3417},{ 262, 3733},{ 303, 4048},{ 337, 4375}, + { 378, 4657},{ 420, 4897},{ 456, 5148},{ 486, 5422}, + { 518, 5682},{ 558, 5903},{ 592, 6113},{ 623, 6372}, + { 662, 6628},{ 700, 6833},{ 751, 6989},{ 805, 7147} + }, + /*Cb qi=13 INTER*/ + { + { 94, -34},{ 78, 303},{ 60, 638},{ 51, 994}, + { 54, 1406},{ 61, 1836},{ 73, 2253},{ 84, 2668}, + { 92, 3082},{ 96, 3492},{ 99, 3894},{ 101, 4284}, + { 103, 4659},{ 105, 5023},{ 106, 5376},{ 108, 5726}, + { 109, 6070},{ 110, 6418},{ 113, 6765},{ 117, 7105}, + { 119, 7448},{ 122, 7784},{ 126, 8119},{ 131, 8463} + } + }, + { + /*Cr qi=13 INTRA*/ + { + { 3, 7},{ 43, 375},{ 80, 762},{ 110, 1226}, + { 131, 1701},{ 149, 2166},{ 172, 2610},{ 196, 2999}, + { 221, 3359},{ 254, 3679},{ 292, 4005},{ 332, 4329}, + { 369, 4612},{ 408, 4880},{ 456, 5139},{ 500, 5388}, + { 544, 5631},{ 581, 5877},{ 615, 6101},{ 660, 6316}, + { 692, 6594},{ 714, 6795},{ 736, 6997},{ 789, 7290} + }, + /*Cr qi=13 INTER*/ + { + { 73, 28},{ 61, 336},{ 46, 642},{ 50, 1003}, + { 58, 1414},{ 67, 1832},{ 79, 2245},{ 87, 2660}, + { 93, 3075},{ 97, 3484},{ 99, 3888},{ 100, 4277}, + { 100, 4651},{ 100, 5027},{ 101, 5403},{ 102, 5765}, + { 105, 6116},{ 109, 6470},{ 113, 6825},{ 119, 7163}, + { 124, 7497},{ 127, 7827},{ 131, 8137},{ 135, 8437} + } + } + }, + { + { + /*Y' qi=14 INTRA*/ + { + { 113, -68},{ 191, 1545},{ 358, 2981},{ 559, 4104}, + { 733, 5044},{ 896, 5890},{ 1066, 6636},{ 1241, 7304}, + { 1428, 7886},{ 1642, 8402},{ 1872, 8871},{ 2128, 9219}, + { 2380, 9547},{ 2609, 9908},{ 2825,10321},{ 3055,10728}, + { 3294,11076},{ 3523,11425},{ 3766,11689},{ 4013,11845}, + { 4254,12022},{ 4506,12209},{ 4759,12383},{ 5013,12637} + }, + /*Y' qi=14 INTER*/ + { + { 58, -82},{ 38, 1362},{ 93, 2914},{ 138, 4492}, + { 171, 5962},{ 198, 7289},{ 216, 8559},{ 234, 9804}, + { 263,11005},{ 306,12143},{ 363,13222},{ 434,14259}, + { 523,15255},{ 639,16188},{ 794,17021},{ 1000,17717}, + { 1262,18260},{ 1575,18645},{ 1943,18841},{ 2356,18872}, + { 2782,18802},{ 3194,18682},{ 3576,18559},{ 3923,18447} + } + }, + { + /*Cb qi=14 INTRA*/ + { + { 2, 3},{ 50, 367},{ 91, 741},{ 114, 1180}, + { 134, 1651},{ 157, 2131},{ 181, 2601},{ 208, 3028}, + { 239, 3391},{ 279, 3706},{ 322, 4000},{ 361, 4309}, + { 406, 4587},{ 445, 4822},{ 482, 5067},{ 515, 5344}, + { 546, 5612},{ 589, 5821},{ 626, 6020},{ 655, 6276}, + { 701, 6523},{ 748, 6717},{ 796, 6876},{ 815, 7151} + }, + /*Cb qi=14 INTER*/ + { + { 80, -43},{ 68, 301},{ 56, 644},{ 50, 1004}, + { 54, 1412},{ 63, 1836},{ 75, 2253},{ 87, 2670}, + { 94, 3083},{ 98, 3487},{ 101, 3885},{ 103, 4271}, + { 106, 4645},{ 107, 5004},{ 108, 5358},{ 109, 5705}, + { 112, 6047},{ 115, 6388},{ 118, 6731},{ 121, 7081}, + { 126, 7421},{ 129, 7747},{ 132, 8076},{ 137, 8419} + } + }, + { + /*Cr qi=14 INTRA*/ + { + { 3, 6},{ 45, 375},{ 85, 762},{ 116, 1226}, + { 138, 1700},{ 158, 2163},{ 180, 2602},{ 206, 2985}, + { 236, 3333},{ 270, 3639},{ 310, 3956},{ 359, 4258}, + { 397, 4524},{ 430, 4802},{ 478, 5068},{ 527, 5316}, + { 572, 5560},{ 613, 5802},{ 654, 6012},{ 699, 6216}, + { 734, 6489},{ 755, 6707},{ 775, 6898},{ 841, 7111} + }, + /*Cr qi=14 INTER*/ + { + { 78, 0},{ 59, 322},{ 46, 649},{ 51, 1016}, + { 58, 1422},{ 68, 1839},{ 81, 2253},{ 90, 2666}, + { 95, 3080},{ 98, 3486},{ 101, 3881},{ 102, 4268}, + { 102, 4644},{ 103, 5017},{ 105, 5382},{ 106, 5743}, + { 108, 6093},{ 112, 6442},{ 118, 6791},{ 124, 7130}, + { 127, 7463},{ 133, 7784},{ 138, 8085},{ 142, 8395} + } + } + }, + { + { + /*Y' qi=15 INTRA*/ + { + { 111, -66},{ 197, 1538},{ 370, 2949},{ 579, 4050}, + { 762, 4968},{ 933, 5798},{ 1112, 6520},{ 1299, 7161}, + { 1497, 7725},{ 1723, 8219},{ 1967, 8654},{ 2234, 8990}, + { 2499, 9302},{ 2740, 9637},{ 2968,10039},{ 3215,10414}, + { 3473,10709},{ 3721,11015},{ 3971,11270},{ 4228,11402}, + { 4487,11543},{ 4752,11707},{ 5011,11871},{ 5290,12099} + }, + /*Y' qi=15 INTER*/ + { + { 59, -113},{ 37, 1349},{ 95, 2904},{ 139, 4478}, + { 174, 5929},{ 201, 7244},{ 220, 8505},{ 241, 9736}, + { 275,10922},{ 327,12040},{ 395,13097},{ 477,14114}, + { 585,15071},{ 730,15947},{ 917,16714},{ 1162,17326}, + { 1468,17770},{ 1833,18029},{ 2251,18111},{ 2694,18068}, + { 3125,17968},{ 3529,17845},{ 3908,17713},{ 4260,17587} + } + }, + { + /*Cb qi=15 INTRA*/ + { + { 2, 3},{ 51, 367},{ 94, 741},{ 120, 1180}, + { 140, 1651},{ 160, 2129},{ 184, 2591},{ 213, 3010}, + { 246, 3371},{ 289, 3680},{ 335, 3969},{ 374, 4274}, + { 418, 4546},{ 460, 4783},{ 498, 5019},{ 532, 5280}, + { 565, 5553},{ 608, 5765},{ 647, 5958},{ 683, 6193}, + { 732, 6433},{ 782, 6620},{ 832, 6769},{ 848, 7027} + }, + /*Cb qi=15 INTER*/ + { + { 71, -52},{ 63, 296},{ 54, 644},{ 50, 1010}, + { 53, 1417},{ 64, 1837},{ 77, 2253},{ 88, 2666}, + { 95, 3079},{ 98, 3487},{ 100, 3882},{ 103, 4264}, + { 106, 4633},{ 108, 4991},{ 109, 5343},{ 109, 5693}, + { 112, 6038},{ 114, 6371},{ 119, 6709},{ 123, 7051}, + { 125, 7385},{ 130, 7716},{ 135, 8050},{ 140, 8374} + } + }, + { + /*Cr qi=15 INTRA*/ + { + { 2, 6},{ 47, 375},{ 87, 763},{ 119, 1225}, + { 143, 1699},{ 162, 2158},{ 185, 2595},{ 213, 2971}, + { 246, 3315},{ 279, 3618},{ 320, 3920},{ 372, 4210}, + { 409, 4480},{ 446, 4756},{ 496, 5017},{ 542, 5263}, + { 590, 5487},{ 639, 5721},{ 687, 5923},{ 724, 6132}, + { 753, 6417},{ 781, 6622},{ 805, 6806},{ 856, 6977} + }, + /*Cr qi=15 INTER*/ + { + { 71, 3},{ 61, 326},{ 52, 651},{ 50, 1017}, + { 58, 1422},{ 69, 1837},{ 82, 2251},{ 90, 2668}, + { 95, 3080},{ 98, 3484},{ 101, 3877},{ 102, 4257}, + { 102, 4632},{ 101, 5005},{ 103, 5370},{ 106, 5733}, + { 110, 6082},{ 116, 6424},{ 120, 6774},{ 124, 7106}, + { 130, 7427},{ 135, 7748},{ 141, 8052},{ 147, 8333} + } + } + }, + { + { + /*Y' qi=16 INTRA*/ + { + { 114, -63},{ 206, 1525},{ 396, 2887},{ 618, 3945}, + { 816, 4832},{ 1002, 5626},{ 1196, 6319},{ 1401, 6923}, + { 1616, 7458},{ 1857, 7928},{ 2121, 8334},{ 2405, 8645}, + { 2685, 8934},{ 2938, 9255},{ 3175, 9638},{ 3433, 9990}, + { 3707,10263},{ 3958,10577},{ 4218,10807},{ 4488,10906}, + { 4760,11028},{ 5037,11148},{ 5306,11286},{ 5625,11463} + }, + /*Y' qi=16 INTER*/ + { + { 69, -153},{ 39, 1348},{ 98, 2894},{ 144, 4448}, + { 181, 5872},{ 209, 7167},{ 228, 8422},{ 254, 9644}, + { 297,10810},{ 359,11908},{ 438,12944},{ 539,13930}, + { 672,14842},{ 850,15650},{ 1085,16318},{ 1391,16793}, + { 1769,17082},{ 2200,17198},{ 2659,17174},{ 3116,17072}, + { 3547,16948},{ 3943,16819},{ 4299,16701},{ 4611,16644} + } + }, + { + /*Cb qi=16 INTRA*/ + { + { 3, 4},{ 54, 367},{ 97, 742},{ 122, 1181}, + { 143, 1651},{ 168, 2123},{ 197, 2575},{ 226, 2985}, + { 263, 3338},{ 314, 3631},{ 367, 3903},{ 409, 4200}, + { 453, 4468},{ 491, 4703},{ 528, 4932},{ 566, 5188}, + { 601, 5459},{ 647, 5672},{ 693, 5844},{ 734, 6058}, + { 784, 6305},{ 836, 6460},{ 882, 6602},{ 905, 6891} + }, + /*Cb qi=16 INTER*/ + { + { 75, -64},{ 67, 292},{ 56, 645},{ 51, 1016}, + { 54, 1421},{ 66, 1842},{ 79, 2257},{ 89, 2670}, + { 95, 3082},{ 98, 3488},{ 101, 3879},{ 104, 4258}, + { 106, 4623},{ 108, 4974},{ 109, 5321},{ 113, 5664}, + { 116, 6001},{ 117, 6341},{ 123, 6677},{ 128, 7004}, + { 130, 7336},{ 136, 7671},{ 143, 7996},{ 148, 8310} + } + }, + { + /*Cr qi=16 INTRA*/ + { + { 4, 7},{ 50, 375},{ 90, 763},{ 124, 1225}, + { 148, 1698},{ 168, 2154},{ 195, 2582},{ 227, 2948}, + { 263, 3279},{ 302, 3575},{ 343, 3865},{ 394, 4137}, + { 439, 4402},{ 482, 4672},{ 533, 4925},{ 579, 5165}, + { 626, 5382},{ 675, 5616},{ 725, 5812},{ 769, 5991}, + { 810, 6242},{ 848, 6430},{ 868, 6615},{ 944, 6732} + }, + /*Cr qi=16 INTER*/ + { + { 78, 11},{ 62, 327},{ 49, 650},{ 50, 1025}, + { 59, 1431},{ 72, 1841},{ 83, 2253},{ 90, 2671}, + { 95, 3084},{ 98, 3487},{ 100, 3879},{ 101, 4254}, + { 102, 4625},{ 103, 4994},{ 106, 5355},{ 108, 5708}, + { 111, 6058},{ 115, 6400},{ 121, 6733},{ 128, 7058}, + { 134, 7374},{ 140, 7691},{ 146, 7993},{ 146, 8317} + } + } + }, + { + { + /*Y' qi=17 INTRA*/ + { + { 112, -59},{ 210, 1515},{ 409, 2850},{ 640, 3882}, + { 844, 4748},{ 1038, 5529},{ 1240, 6206},{ 1452, 6803}, + { 1676, 7330},{ 1925, 7792},{ 2194, 8201},{ 2483, 8512}, + { 2766, 8801},{ 3027, 9121},{ 3279, 9482},{ 3548, 9810}, + { 3825,10069},{ 4088,10345},{ 4362,10544},{ 4638,10644}, + { 4915,10744},{ 5196,10850},{ 5471,10981},{ 5802,11136} + }, + /*Y' qi=17 INTER*/ + { + { 70, -147},{ 45, 1349},{ 106, 2894},{ 155, 4425}, + { 195, 5818},{ 225, 7099},{ 247, 8348},{ 278, 9565}, + { 328,10717},{ 399,11794},{ 491,12807},{ 609,13760}, + { 766,14623},{ 984,15349},{ 1274,15902},{ 1642,16256}, + { 2082,16411},{ 2563,16409},{ 3048,16315},{ 3508,16194}, + { 3924,16064},{ 4306,15938},{ 4656,15828},{ 4966,15733} + } + }, + { + /*Cb qi=17 INTRA*/ + { + { 3, 4},{ 57, 367},{ 101, 742},{ 126, 1182}, + { 148, 1650},{ 175, 2118},{ 207, 2565},{ 241, 2966}, + { 279, 3307},{ 331, 3588},{ 389, 3845},{ 435, 4132}, + { 474, 4408},{ 517, 4641},{ 560, 4869},{ 602, 5122}, + { 638, 5389},{ 672, 5610},{ 716, 5787},{ 758, 6002}, + { 817, 6226},{ 869, 6393},{ 916, 6530},{ 950, 6799} + }, + /*Cb qi=17 INTER*/ + { + { 105, -65},{ 86, 288},{ 66, 638},{ 54, 1014}, + { 59, 1427},{ 71, 1844},{ 86, 2257},{ 95, 2668}, + { 100, 3075},{ 103, 3476},{ 106, 3867},{ 110, 4241}, + { 112, 4598},{ 114, 4948},{ 117, 5294},{ 121, 5633}, + { 123, 5968},{ 126, 6301},{ 131, 6637},{ 136, 6968}, + { 144, 7287},{ 152, 7606},{ 158, 7931},{ 162, 8262} + } + }, + { + /*Cr qi=17 INTRA*/ + { + { 4, 6},{ 55, 376},{ 97, 765},{ 128, 1226}, + { 152, 1696},{ 175, 2144},{ 204, 2568},{ 241, 2928}, + { 282, 3250},{ 323, 3530},{ 368, 3811},{ 420, 4089}, + { 463, 4347},{ 505, 4609},{ 562, 4860},{ 609, 5094}, + { 655, 5303},{ 709, 5535},{ 759, 5740},{ 803, 5913}, + { 844, 6153},{ 879, 6350},{ 905, 6527},{ 972, 6637} + }, + /*Cr qi=17 INTER*/ + { + { 88, 8},{ 68, 330},{ 51, 653},{ 54, 1028}, + { 65, 1433},{ 77, 1845},{ 89, 2257},{ 96, 2669}, + { 100, 3081},{ 102, 3481},{ 105, 3867},{ 106, 4245}, + { 108, 4613},{ 110, 4971},{ 112, 5328},{ 115, 5679}, + { 120, 6019},{ 127, 6355},{ 133, 6686},{ 140, 7007}, + { 149, 7316},{ 158, 7618},{ 166, 7924},{ 170, 8232} + } + } + }, + { + { + /*Y' qi=18 INTRA*/ + { + { 122, -58},{ 216, 1506},{ 425, 2815},{ 665, 3822}, + { 882, 4666},{ 1088, 5425},{ 1301, 6084},{ 1529, 6653}, + { 1766, 7162},{ 2026, 7611},{ 2312, 7987},{ 2612, 8278}, + { 2913, 8551},{ 3196, 8840},{ 3454, 9184},{ 3734, 9490}, + { 4030, 9725},{ 4305, 9973},{ 4585,10162},{ 4864,10251}, + { 5150,10324},{ 5443,10420},{ 5727,10536},{ 6053,10682} + }, + /*Y' qi=18 INTER*/ + { + { 66, -143},{ 47, 1351},{ 108, 2886},{ 158, 4401}, + { 200, 5775},{ 232, 7044},{ 256, 8288},{ 292, 9493}, + { 351,10625},{ 434,11679},{ 541,12665},{ 681,13578}, + { 875,14379},{ 1136,15025},{ 1483,15475},{ 1914,15709}, + { 2399,15767},{ 2907,15699},{ 3400,15579},{ 3852,15453}, + { 4259,15332},{ 4630,15221},{ 4976,15121},{ 5294,15061} + } + }, + { + /*Cb qi=18 INTRA*/ + { + { 2, 3},{ 61, 367},{ 107, 743},{ 131, 1182}, + { 155, 1648},{ 183, 2110},{ 220, 2542},{ 260, 2927}, + { 303, 3265},{ 359, 3540},{ 416, 3785},{ 462, 4063}, + { 506, 4334},{ 553, 4567},{ 595, 4797},{ 636, 5049}, + { 676, 5304},{ 717, 5516},{ 759, 5698},{ 801, 5904}, + { 861, 6133},{ 911, 6311},{ 962, 6443},{ 1021, 6645} + }, + /*Cb qi=18 INTER*/ + { + { 126, 5},{ 95, 326},{ 66, 643},{ 55, 1015}, + { 60, 1427},{ 73, 1843},{ 87, 2256},{ 96, 2667}, + { 101, 3073},{ 104, 3470},{ 108, 3853},{ 111, 4226}, + { 114, 4584},{ 117, 4928},{ 119, 5274},{ 122, 5612}, + { 126, 5942},{ 130, 6271},{ 136, 6606},{ 141, 6931}, + { 148, 7247},{ 156, 7568},{ 164, 7891},{ 173, 8211} + } + }, + { + /*Cr qi=18 INTRA*/ + { + { 4, 6},{ 59, 376},{ 104, 765},{ 133, 1226}, + { 156, 1692},{ 184, 2136},{ 218, 2548},{ 260, 2893}, + { 308, 3204},{ 348, 3481},{ 397, 3751},{ 448, 4024}, + { 490, 4281},{ 541, 4523},{ 593, 4776},{ 634, 5022}, + { 685, 5236},{ 748, 5455},{ 812, 5638},{ 856, 5818}, + { 891, 6048},{ 928, 6230},{ 961, 6405},{ 1055, 6449} + }, + /*Cr qi=18 INTER*/ + { + { 81, 34},{ 68, 342},{ 57, 652},{ 59, 1027}, + { 67, 1439},{ 80, 1848},{ 91, 2257},{ 97, 2670}, + { 100, 3076},{ 103, 3473},{ 106, 3857},{ 108, 4231}, + { 109, 4599},{ 110, 4958},{ 113, 5307},{ 119, 5650}, + { 125, 5991},{ 130, 6325},{ 138, 6651},{ 147, 6971}, + { 153, 7278},{ 162, 7578},{ 172, 7874},{ 177, 8156} + } + } + }, + { + { + /*Y' qi=19 INTRA*/ + { + { 128, -55},{ 228, 1495},{ 448, 2775},{ 699, 3758}, + { 931, 4571},{ 1154, 5296},{ 1386, 5914},{ 1636, 6450}, + { 1894, 6930},{ 2177, 7342},{ 2479, 7698},{ 2792, 7976}, + { 3099, 8235},{ 3392, 8517},{ 3658, 8853},{ 3938, 9155}, + { 4242, 9371},{ 4527, 9605},{ 4810, 9781},{ 5089, 9853}, + { 5378, 9920},{ 5674,10009},{ 5972,10110},{ 6336,10196} + }, + /*Y' qi=19 INTER*/ + { + { 69, -147},{ 49, 1353},{ 111, 2883},{ 162, 4381}, + { 205, 5737},{ 237, 6996},{ 264, 8232},{ 307, 9421}, + { 376,10534},{ 472,11567},{ 596,12525},{ 761,13395}, + { 990,14130},{ 1298,14694},{ 1695,15053},{ 2172,15195}, + { 2696,15173},{ 3213,15075},{ 3696,14948},{ 4141,14829}, + { 4541,14721},{ 4910,14609},{ 5245,14506},{ 5536,14399} + } + }, + { + /*Cb qi=19 INTRA*/ + { + { 3, 3},{ 61, 367},{ 109, 743},{ 135, 1182}, + { 161, 1646},{ 191, 2101},{ 229, 2524},{ 273, 2898}, + { 318, 3221},{ 376, 3490},{ 436, 3731},{ 487, 3994}, + { 539, 4251},{ 584, 4485},{ 621, 4721},{ 664, 4967}, + { 709, 5225},{ 752, 5431},{ 801, 5595},{ 846, 5796}, + { 912, 6011},{ 959, 6193},{ 1015, 6321},{ 1121, 6504} + }, + /*Cb qi=19 INTER*/ + { + { 126, 4},{ 97, 329},{ 69, 649},{ 56, 1017}, + { 61, 1432},{ 74, 1846},{ 88, 2255},{ 98, 2663}, + { 103, 3065},{ 106, 3460},{ 110, 3844},{ 114, 4211}, + { 117, 4564},{ 120, 4911},{ 122, 5253},{ 125, 5588}, + { 129, 5916},{ 135, 6241},{ 142, 6567},{ 149, 6885}, + { 155, 7206},{ 163, 7527},{ 174, 7843},{ 188, 8145} + } + }, + { + /*Cr qi=19 INTRA*/ + { + { 5, 6},{ 61, 376},{ 106, 765},{ 135, 1225}, + { 160, 1689},{ 192, 2126},{ 229, 2531},{ 271, 2869}, + { 321, 3168},{ 370, 3433},{ 421, 3704},{ 476, 3965}, + { 520, 4212},{ 572, 4452},{ 629, 4691},{ 671, 4939}, + { 724, 5152},{ 792, 5347},{ 858, 5510},{ 895, 5696}, + { 939, 5905},{ 991, 6056},{ 1027, 6244},{ 1127, 6333} + }, + /*Cr qi=19 INTER*/ + { + { 80, 45},{ 66, 344},{ 55, 654},{ 56, 1030}, + { 66, 1440},{ 80, 1850},{ 91, 2259},{ 98, 2668}, + { 102, 3072},{ 104, 3466},{ 107, 3845},{ 109, 4215}, + { 110, 4578},{ 112, 4933},{ 116, 5283},{ 122, 5625}, + { 129, 5963},{ 136, 6287},{ 143, 6611},{ 151, 6927}, + { 160, 7229},{ 170, 7528},{ 181, 7818},{ 191, 8092} + } + } + }, + { + { + /*Y' qi=20 INTRA*/ + { + { 129, -50},{ 238, 1481},{ 469, 2728},{ 730, 3684}, + { 974, 4473},{ 1213, 5171},{ 1463, 5763},{ 1729, 6281}, + { 2002, 6744},{ 2299, 7146},{ 2613, 7492},{ 2940, 7746}, + { 3265, 7978},{ 3571, 8228},{ 3853, 8543},{ 4156, 8815}, + { 4476, 9001},{ 4775, 9218},{ 5070, 9373},{ 5352, 9446}, + { 5649, 9510},{ 5956, 9580},{ 6268, 9660},{ 6647, 9705} + }, + /*Y' qi=20 INTER*/ + { + { 64, -93},{ 52, 1340},{ 116, 2862},{ 170, 4344}, + { 216, 5678},{ 249, 6928},{ 281, 8155},{ 333, 9326}, + { 418,10410},{ 533,11411},{ 683,12329},{ 890,13127}, + { 1183,13750},{ 1579,14162},{ 2066,14357},{ 2611,14370}, + { 3159,14284},{ 3675,14167},{ 4142,14053},{ 4568,13953}, + { 4961,13852},{ 5320,13755},{ 5649,13675},{ 5933,13610} + } + }, + { + /*Cb qi=20 INTRA*/ + { + { 3, 3},{ 62, 367},{ 112, 743},{ 140, 1183}, + { 165, 1646},{ 196, 2099},{ 235, 2517},{ 284, 2883}, + { 334, 3198},{ 393, 3460},{ 457, 3690},{ 509, 3945}, + { 560, 4198},{ 605, 4435},{ 647, 4658},{ 699, 4888}, + { 742, 5155},{ 788, 5350},{ 835, 5517},{ 880, 5730}, + { 956, 5914},{ 1007, 6060},{ 1053, 6199},{ 1158, 6358} + }, + /*Cb qi=20 INTER*/ + { + { 128, -6},{ 96, 322},{ 66, 653},{ 54, 1025}, + { 63, 1431},{ 79, 1844},{ 91, 2256},{ 99, 2665}, + { 104, 3065},{ 107, 3455},{ 111, 3831},{ 115, 4189}, + { 120, 4539},{ 123, 4885},{ 126, 5219},{ 130, 5548}, + { 135, 5876},{ 141, 6199},{ 149, 6519},{ 156, 6837}, + { 166, 7153},{ 179, 7468},{ 189, 7784},{ 194, 8102} + } + }, + { + /*Cr qi=20 INTRA*/ + { + { 4, 6},{ 63, 376},{ 109, 765},{ 139, 1225}, + { 165, 1689},{ 199, 2124},{ 239, 2523},{ 285, 2852}, + { 340, 3140},{ 388, 3398},{ 438, 3662},{ 499, 3914}, + { 547, 4155},{ 596, 4392},{ 652, 4634},{ 699, 4877}, + { 759, 5074},{ 824, 5257},{ 883, 5428},{ 936, 5589}, + { 986, 5790},{ 1030, 5960},{ 1074, 6119},{ 1172, 6191} + }, + /*Cr qi=20 INTER*/ + { + { 92, 40},{ 70, 345},{ 55, 658},{ 57, 1034}, + { 69, 1441},{ 84, 1852},{ 94, 2261},{ 98, 2669}, + { 102, 3074},{ 105, 3465},{ 107, 3841},{ 110, 4206}, + { 112, 4562},{ 116, 4915},{ 121, 5260},{ 127, 5591}, + { 134, 5920},{ 142, 6246},{ 153, 6562},{ 163, 6870}, + { 173, 7170},{ 186, 7463},{ 198, 7746},{ 199, 8030} + } + } + }, + { + { + /*Y' qi=21 INTRA*/ + { + { 130, -51},{ 244, 1476},{ 483, 2705},{ 756, 3635}, + { 1013, 4396},{ 1266, 5070},{ 1530, 5647},{ 1806, 6153}, + { 2093, 6600},{ 2411, 6976},{ 2739, 7299},{ 3079, 7534}, + { 3422, 7744},{ 3738, 7987},{ 4032, 8274},{ 4348, 8533}, + { 4675, 8721},{ 4989, 8909},{ 5291, 9051},{ 5577, 9111}, + { 5879, 9163},{ 6190, 9228},{ 6506, 9286},{ 6899, 9295} + }, + /*Y' qi=21 INTER*/ + { + { 64, -56},{ 55, 1341},{ 119, 2859},{ 174, 4324}, + { 223, 5640},{ 258, 6880},{ 295, 8096},{ 359, 9246}, + { 460,10302},{ 595,11268},{ 778,12131},{ 1032,12857}, + { 1387,13385},{ 1850,13683},{ 2399,13774},{ 2976,13729}, + { 3527,13619},{ 4034,13504},{ 4492,13401},{ 4912,13291}, + { 5298,13209},{ 5648,13137},{ 5974,13046},{ 6308,12977} + } + }, + { + /*Cb qi=21 INTRA*/ + { + { 4, 3},{ 64, 367},{ 114, 743},{ 141, 1183}, + { 166, 1645},{ 201, 2092},{ 247, 2502},{ 299, 2856}, + { 352, 3158},{ 413, 3412},{ 480, 3642},{ 536, 3893}, + { 588, 4137},{ 637, 4367},{ 678, 4598},{ 725, 4834}, + { 774, 5083},{ 827, 5269},{ 883, 5420},{ 930, 5633}, + { 999, 5829},{ 1057, 5959},{ 1113, 6082},{ 1200, 6265} + }, + /*Cb qi=21 INTER*/ + { + { 109, -8},{ 84, 321},{ 62, 654},{ 54, 1028}, + { 64, 1434},{ 80, 1847},{ 92, 2259},{ 100, 2664}, + { 105, 3060},{ 109, 3445},{ 114, 3815},{ 118, 4172}, + { 122, 4519},{ 126, 4861},{ 128, 5194},{ 133, 5520}, + { 139, 5847},{ 146, 6169},{ 155, 6487},{ 166, 6801}, + { 177, 7114},{ 189, 7423},{ 201, 7729},{ 208, 8035} + } + }, + { + /*Cr qi=21 INTRA*/ + { + { 4, 6},{ 64, 377},{ 111, 766},{ 144, 1225}, + { 174, 1683},{ 206, 2114},{ 248, 2506},{ 302, 2824}, + { 357, 3099},{ 404, 3357},{ 455, 3622},{ 519, 3867}, + { 573, 4098},{ 625, 4331},{ 683, 4571},{ 733, 4802}, + { 793, 4994},{ 863, 5173},{ 926, 5337},{ 978, 5492}, + { 1030, 5685},{ 1079, 5856},{ 1126, 6027},{ 1217, 6159} + }, + /*Cr qi=21 INTER*/ + { + { 82, 29},{ 67, 341},{ 55, 660},{ 58, 1038}, + { 71, 1443},{ 85, 1851},{ 95, 2258},{ 99, 2666}, + { 103, 3069},{ 107, 3456},{ 110, 3826},{ 112, 4188}, + { 114, 4544},{ 118, 4891},{ 124, 5231},{ 132, 5567}, + { 139, 5894},{ 148, 6210},{ 159, 6520},{ 171, 6822}, + { 185, 7111},{ 196, 7403},{ 209, 7691},{ 225, 7945} + } + } + }, + { + { + /*Y' qi=22 INTRA*/ + { + { 128, -45},{ 254, 1463},{ 507, 2662},{ 794, 3562}, + { 1070, 4292},{ 1340, 4941},{ 1622, 5492},{ 1920, 5968}, + { 2229, 6387},{ 2565, 6742},{ 2911, 7047},{ 3263, 7264}, + { 3615, 7464},{ 3944, 7689},{ 4258, 7950},{ 4591, 8183}, + { 4934, 8347},{ 5259, 8517},{ 5573, 8634},{ 5870, 8683}, + { 6186, 8723},{ 6508, 8762},{ 6831, 8801},{ 7232, 8830} + }, + /*Y' qi=22 INTER*/ + { + { 77, -48},{ 57, 1343},{ 122, 2853},{ 180, 4299}, + { 231, 5597},{ 269, 6826},{ 314, 8025},{ 393, 9150}, + { 512,10179},{ 673,11103},{ 894,11908},{ 1207,12542}, + { 1635,12956},{ 2166,13148},{ 2755,13167},{ 3345,13088}, + { 3895,12966},{ 4386,12848},{ 4832,12746},{ 5252,12647}, + { 5634,12563},{ 5978,12497},{ 6299,12412},{ 6633,12338} + } + }, + { + /*Cb qi=22 INTRA*/ + { + { 4, 3},{ 66, 367},{ 122, 744},{ 153, 1182}, + { 177, 1640},{ 213, 2080},{ 263, 2475},{ 323, 2811}, + { 382, 3103},{ 451, 3346},{ 522, 3568},{ 581, 3814}, + { 633, 4054},{ 674, 4288},{ 719, 4523},{ 768, 4756}, + { 823, 4979},{ 883, 5162},{ 937, 5325},{ 996, 5510}, + { 1070, 5687},{ 1129, 5807},{ 1193, 5929},{ 1311, 6099} + }, + /*Cb qi=22 INTER*/ + { + { 107, -5},{ 83, 322},{ 61, 653},{ 55, 1030}, + { 66, 1436},{ 81, 1845},{ 94, 2253},{ 102, 2656}, + { 107, 3050},{ 111, 3435},{ 115, 3804},{ 119, 4158}, + { 124, 4501},{ 128, 4835},{ 132, 5164},{ 138, 5490}, + { 146, 5812},{ 154, 6128},{ 163, 6442},{ 174, 6754}, + { 188, 7060},{ 205, 7361},{ 219, 7662},{ 233, 7953} + } + }, + { + /*Cr qi=22 INTRA*/ + { + { 4, 6},{ 67, 378},{ 118, 767},{ 151, 1222}, + { 182, 1675},{ 221, 2097},{ 269, 2476},{ 329, 2774}, + { 389, 3039},{ 444, 3292},{ 500, 3545},{ 560, 3788}, + { 615, 4020},{ 671, 4251},{ 734, 4484},{ 781, 4712}, + { 850, 4887},{ 925, 5060},{ 981, 5229},{ 1031, 5369}, + { 1092, 5549},{ 1148, 5715},{ 1200, 5861},{ 1291, 5943} + }, + /*Cr qi=22 INTER*/ + { + { 88, 34},{ 69, 340},{ 57, 657},{ 60, 1039}, + { 73, 1445},{ 87, 1851},{ 96, 2257},{ 100, 2662}, + { 103, 3058},{ 107, 3442},{ 111, 3812},{ 115, 4172}, + { 118, 4524},{ 123, 4864},{ 129, 5199},{ 136, 5531}, + { 145, 5855},{ 156, 6168},{ 170, 6468},{ 184, 6765}, + { 193, 7066},{ 207, 7353},{ 222, 7628},{ 230, 7900} + } + } + }, + { + { + /*Y' qi=23 INTRA*/ + { + { 126, -40},{ 257, 1458},{ 521, 2636},{ 825, 3501}, + { 1111, 4207},{ 1391, 4842},{ 1684, 5385},{ 1992, 5858}, + { 2311, 6277},{ 2653, 6626},{ 3005, 6929},{ 3366, 7134}, + { 3729, 7311},{ 4071, 7526},{ 4396, 7770},{ 4734, 7986}, + { 5086, 8131},{ 5421, 8286},{ 5735, 8404},{ 6033, 8456}, + { 6357, 8486},{ 6682, 8525},{ 7003, 8573},{ 7387, 8604} + }, + /*Y' qi=23 INTER*/ + { + { 64, -57},{ 60, 1345},{ 124, 2853},{ 185, 4284}, + { 239, 5565},{ 282, 6783},{ 336, 7967},{ 429, 9069}, + { 568,10063},{ 758,10943},{ 1028,11679},{ 1407,12216}, + { 1909,12520},{ 2502,12616},{ 3126,12573},{ 3722,12461}, + { 4258,12344},{ 4742,12236},{ 5185,12136},{ 5590,12052}, + { 5970,11980},{ 6315,11901},{ 6631,11826},{ 6954,11769} + } + }, + { + /*Cb qi=23 INTRA*/ + { + { 3, 3},{ 70, 367},{ 124, 744},{ 151, 1182}, + { 181, 1637},{ 222, 2071},{ 276, 2460},{ 343, 2785}, + { 403, 3072},{ 468, 3317},{ 542, 3534},{ 605, 3773}, + { 659, 4009},{ 703, 4243},{ 747, 4479},{ 795, 4707}, + { 852, 4923},{ 908, 5105},{ 972, 5254},{ 1043, 5423}, + { 1118, 5594},{ 1172, 5731},{ 1240, 5853},{ 1365, 6005} + }, + /*Cb qi=23 INTER*/ + { + { 109, -10},{ 87, 325},{ 63, 650},{ 57, 1031}, + { 67, 1439},{ 83, 1847},{ 96, 2253},{ 103, 2652}, + { 109, 3041},{ 114, 3421},{ 117, 3789},{ 122, 4141}, + { 128, 4480},{ 134, 4811},{ 139, 5138},{ 144, 5463}, + { 152, 5781},{ 161, 6096},{ 174, 6404},{ 185, 6714}, + { 198, 7023},{ 216, 7320},{ 233, 7621},{ 245, 7935} + } + }, + { + /*Cr qi=23 INTRA*/ + { + { 5, 6},{ 70, 379},{ 122, 768},{ 155, 1222}, + { 187, 1671},{ 231, 2088},{ 283, 2459},{ 346, 2750}, + { 411, 3009},{ 465, 3261},{ 523, 3509},{ 585, 3746}, + { 639, 3980},{ 695, 4219},{ 754, 4449},{ 803, 4671}, + { 873, 4840},{ 953, 5001},{ 1015, 5156},{ 1071, 5286}, + { 1137, 5464},{ 1191, 5629},{ 1249, 5782},{ 1359, 5885} + }, + /*Cr qi=23 INTER*/ + { + { 84, 29},{ 69, 343},{ 58, 660},{ 62, 1041}, + { 75, 1448},{ 88, 1853},{ 97, 2258},{ 102, 2659}, + { 105, 3050},{ 108, 3430},{ 113, 3799},{ 116, 4155}, + { 121, 4505},{ 126, 4845},{ 132, 5176},{ 142, 5504}, + { 153, 5826},{ 165, 6133},{ 180, 6432},{ 197, 6722}, + { 212, 7005},{ 226, 7287},{ 244, 7555},{ 258, 7828} + } + } + }, + { + { + /*Y' qi=24 INTRA*/ + { + { 125, -34},{ 268, 1444},{ 547, 2590},{ 866, 3422}, + { 1172, 4098},{ 1476, 4702},{ 1790, 5222},{ 2117, 5678}, + { 2453, 6080},{ 2811, 6418},{ 3178, 6700},{ 3552, 6895}, + { 3928, 7055},{ 4286, 7243},{ 4627, 7477},{ 4981, 7674}, + { 5344, 7802},{ 5683, 7944},{ 6009, 8043},{ 6313, 8082}, + { 6633, 8111},{ 6959, 8151},{ 7280, 8197},{ 7660, 8221} + }, + /*Y' qi=24 INTER*/ + { + { 62, -63},{ 68, 1345},{ 134, 2840},{ 199, 4245}, + { 256, 5508},{ 304, 6715},{ 371, 7880},{ 484, 8950}, + { 652, 9899},{ 892,10709},{ 1238,11334},{ 1722,11722}, + { 2326,11875},{ 2983,11864},{ 3616,11783},{ 4189,11678}, + { 4707,11570},{ 5178,11476},{ 5617,11395},{ 6017,11319}, + { 6380,11252},{ 6720,11185},{ 7044,11126},{ 7377,11118} + } + }, + { + /*Cb qi=24 INTRA*/ + { + { 4, 3},{ 75, 367},{ 132, 745},{ 159, 1182}, + { 187, 1634},{ 230, 2061},{ 289, 2439},{ 361, 2753}, + { 425, 3034},{ 492, 3278},{ 566, 3490},{ 630, 3720}, + { 686, 3956},{ 732, 4190},{ 777, 4420},{ 829, 4637}, + { 894, 4840},{ 958, 5012},{ 1023, 5155},{ 1090, 5326}, + { 1165, 5502},{ 1226, 5622},{ 1299, 5717},{ 1408, 5887} + }, + /*Cb qi=24 INTER*/ + { + { 110, 35},{ 92, 337},{ 70, 651},{ 63, 1033}, + { 74, 1440},{ 91, 1846},{ 102, 2248},{ 109, 2644}, + { 114, 3031},{ 120, 3404},{ 127, 3762},{ 133, 4109}, + { 138, 4445},{ 144, 4772},{ 151, 5094},{ 159, 5411}, + { 168, 5728},{ 180, 6037},{ 195, 6338},{ 210, 6640}, + { 227, 6944},{ 249, 7236},{ 272, 7528},{ 299, 7809} + } + }, + { + /*Cr qi=24 INTRA*/ + { + { 5, 6},{ 72, 380},{ 124, 770},{ 158, 1222}, + { 195, 1668},{ 240, 2079},{ 297, 2438},{ 367, 2715}, + { 433, 2966},{ 488, 3218},{ 549, 3467},{ 609, 3701}, + { 664, 3935},{ 728, 4165},{ 792, 4379},{ 845, 4586}, + { 917, 4744},{ 995, 4898},{ 1063, 5049},{ 1120, 5187}, + { 1190, 5359},{ 1249, 5522},{ 1304, 5672},{ 1397, 5806} + }, + /*Cr qi=24 INTER*/ + { + { 91, 56},{ 73, 353},{ 61, 664},{ 66, 1045}, + { 80, 1449},{ 95, 1851},{ 103, 2250},{ 107, 2648}, + { 111, 3038},{ 116, 3413},{ 120, 3774},{ 124, 4128}, + { 130, 4471},{ 138, 4802},{ 145, 5130},{ 156, 5453}, + { 171, 5764},{ 187, 6061},{ 204, 6355},{ 220, 6643}, + { 238, 6923},{ 254, 7204},{ 275, 7475},{ 289, 7752} + } + } + }, + { + { + /*Y' qi=25 INTRA*/ + { + { 125, -28},{ 285, 1426},{ 582, 2540},{ 917, 3351}, + { 1244, 3997},{ 1569, 4570},{ 1903, 5071},{ 2258, 5498}, + { 2626, 5866},{ 3002, 6182},{ 3382, 6448},{ 3770, 6623}, + { 4162, 6760},{ 4528, 6934},{ 4882, 7144},{ 5249, 7328}, + { 5610, 7453},{ 5958, 7578},{ 6291, 7672},{ 6597, 7708}, + { 6928, 7715},{ 7258, 7737},{ 7575, 7781},{ 7950, 7829} + }, + /*Y' qi=25 INTER*/ + { + { 64, -16},{ 72, 1348},{ 139, 2832},{ 206, 4218}, + { 268, 5465},{ 322, 6659},{ 403, 7803},{ 540, 8838}, + { 747, 9734},{ 1044,10465},{ 1473,10981},{ 2048,11249}, + { 2717,11311},{ 3397,11257},{ 4025,11161},{ 4589,11052}, + { 5099,10947},{ 5560,10859},{ 5989,10786},{ 6389,10717}, + { 6753,10652},{ 7078,10592},{ 7389,10535},{ 7697,10460} + } + }, + { + /*Cb qi=25 INTRA*/ + { + { 3, 3},{ 78, 368},{ 133, 745},{ 159, 1180}, + { 193, 1627},{ 242, 2046},{ 304, 2411},{ 381, 2714}, + { 456, 2983},{ 527, 3224},{ 598, 3437},{ 667, 3655}, + { 726, 3888},{ 776, 4117},{ 826, 4333},{ 883, 4543}, + { 954, 4727},{ 1019, 4878},{ 1095, 5014},{ 1171, 5187}, + { 1255, 5342},{ 1319, 5458},{ 1396, 5546},{ 1536, 5678} + }, + /*Cb qi=25 INTER*/ + { + { 117, 32},{ 89, 342},{ 67, 660},{ 64, 1037}, + { 77, 1441},{ 93, 1845},{ 105, 2243},{ 113, 2633}, + { 120, 3016},{ 125, 3387},{ 131, 3739},{ 137, 4080}, + { 144, 4416},{ 152, 4741},{ 160, 5057},{ 169, 5369}, + { 180, 5680},{ 193, 5990},{ 209, 6294},{ 227, 6594}, + { 249, 6888},{ 269, 7180},{ 294, 7467},{ 317, 7768} + } + }, + { + /*Cr qi=25 INTRA*/ + { + { 6, 6},{ 74, 380},{ 129, 770},{ 165, 1220}, + { 201, 1658},{ 253, 2061},{ 315, 2410},{ 388, 2676}, + { 462, 2920},{ 523, 3166},{ 584, 3404},{ 647, 3637}, + { 701, 3870},{ 769, 4086},{ 838, 4296},{ 898, 4491}, + { 980, 4627},{ 1065, 4759},{ 1126, 4920},{ 1187, 5058}, + { 1283, 5180},{ 1347, 5332},{ 1404, 5475},{ 1527, 5534} + }, + /*Cr qi=25 INTER*/ + { + { 92, 41},{ 75, 347},{ 64, 664},{ 70, 1045}, + { 85, 1448},{ 98, 1849},{ 105, 2245},{ 110, 2637}, + { 115, 3023},{ 120, 3395},{ 126, 3753},{ 131, 4102}, + { 136, 4439},{ 145, 4768},{ 156, 5094},{ 168, 5410}, + { 184, 5717},{ 203, 6010},{ 221, 6300},{ 239, 6577}, + { 262, 6847},{ 282, 7123},{ 303, 7390},{ 322, 7665} + } + } + }, + { + { + /*Y' qi=26 INTRA*/ + { + { 130, -24},{ 292, 1423},{ 594, 2525},{ 943, 3307}, + { 1289, 3921},{ 1633, 4467},{ 1991, 4943},{ 2368, 5348}, + { 2753, 5696},{ 3148, 5991},{ 3545, 6247},{ 3942, 6415}, + { 4342, 6535},{ 4726, 6690},{ 5093, 6883},{ 5466, 7047}, + { 5840, 7159},{ 6202, 7274},{ 6545, 7351},{ 6855, 7375}, + { 7186, 7384},{ 7517, 7416},{ 7840, 7447},{ 8238, 7450} + }, + /*Y' qi=26 INTER*/ + { + { 52, 16},{ 75, 1336},{ 143, 2815},{ 213, 4191}, + { 278, 5427},{ 339, 6611},{ 436, 7734},{ 600, 8732}, + { 843, 9579},{ 1195,10243},{ 1702,10660},{ 2355,10825}, + { 3070,10820},{ 3755,10743},{ 4372,10643},{ 4925,10538}, + { 5426,10440},{ 5882,10354},{ 6296,10290},{ 6686,10224}, + { 7049,10163},{ 7380,10113},{ 7672,10062},{ 7937,10021} + } + }, + { + /*Cb qi=26 INTRA*/ + { + { 4, 3},{ 79, 368},{ 138, 745},{ 167, 1180}, + { 200, 1623},{ 252, 2034},{ 322, 2389},{ 403, 2682}, + { 480, 2941},{ 558, 3176},{ 631, 3393},{ 700, 3608}, + { 766, 3825},{ 819, 4046},{ 868, 4265},{ 926, 4472}, + { 1002, 4645},{ 1070, 4800},{ 1151, 4924},{ 1242, 5063}, + { 1325, 5221},{ 1393, 5338},{ 1464, 5431},{ 1595, 5559} + }, + /*Cb qi=26 INTER*/ + { + { 98, 33},{ 83, 343},{ 65, 662},{ 65, 1037}, + { 80, 1437},{ 96, 1839},{ 107, 2238},{ 115, 2628}, + { 122, 3007},{ 128, 3373},{ 134, 3722},{ 142, 4060}, + { 149, 4390},{ 158, 4713},{ 167, 5029},{ 178, 5341}, + { 191, 5647},{ 208, 5948},{ 227, 6244},{ 247, 6539}, + { 269, 6833},{ 295, 7114},{ 328, 7388},{ 369, 7658} + } + }, + { + /*Cr qi=26 INTRA*/ + { + { 5, 6},{ 75, 380},{ 133, 769},{ 172, 1217}, + { 212, 1652},{ 266, 2048},{ 333, 2384},{ 412, 2643}, + { 490, 2880},{ 552, 3124},{ 616, 3365},{ 681, 3594}, + { 739, 3816},{ 810, 4024},{ 880, 4224},{ 945, 4405}, + { 1029, 4538},{ 1114, 4674},{ 1183, 4822},{ 1254, 4946}, + { 1346, 5063},{ 1417, 5201},{ 1478, 5345},{ 1597, 5411} + }, + /*Cr qi=26 INTER*/ + { + { 97, 29},{ 75, 342},{ 62, 667},{ 70, 1047}, + { 87, 1447},{ 100, 1846},{ 107, 2242},{ 113, 2633}, + { 118, 3016},{ 123, 3382},{ 128, 3737},{ 135, 4082}, + { 142, 4417},{ 151, 4746},{ 162, 5066},{ 176, 5377}, + { 194, 5679},{ 217, 5963},{ 239, 6244},{ 260, 6522}, + { 284, 6789},{ 309, 7052},{ 335, 7313},{ 355, 7582} + } + } + }, + { + { + /*Y' qi=27 INTRA*/ + { + { 118, -10},{ 308, 1404},{ 630, 2473},{ 997, 3227}, + { 1360, 3819},{ 1719, 4354},{ 2086, 4829},{ 2470, 5233}, + { 2863, 5576},{ 3267, 5870},{ 3677, 6117},{ 4085, 6268}, + { 4499, 6376},{ 4888, 6521},{ 5257, 6705},{ 5638, 6865}, + { 6020, 6962},{ 6394, 7056},{ 6744, 7130},{ 7051, 7158}, + { 7386, 7164},{ 7717, 7185},{ 8042, 7209},{ 8444, 7206} + }, + /*Y' qi=27 INTER*/ + { + { 54, 19},{ 77, 1333},{ 147, 2806},{ 221, 4166}, + { 290, 5390},{ 360, 6564},{ 474, 7665},{ 664, 8630}, + { 949, 9423},{ 1370,10002},{ 1958,10323},{ 2670,10414}, + { 3406,10375},{ 4086,10285},{ 4691,10182},{ 5233,10085}, + { 5724, 9994},{ 6169, 9918},{ 6582, 9863},{ 6962, 9813}, + { 7316, 9759},{ 7645, 9707},{ 7948, 9660},{ 8262, 9623} + } + }, + { + /*Cb qi=27 INTRA*/ + { + { 4, 3},{ 79, 368},{ 137, 745},{ 166, 1180}, + { 200, 1622},{ 253, 2030},{ 324, 2381},{ 407, 2671}, + { 487, 2925},{ 567, 3156},{ 640, 3372},{ 712, 3580}, + { 782, 3792},{ 833, 4015},{ 887, 4227},{ 954, 4422}, + { 1031, 4592},{ 1103, 4738},{ 1187, 4856},{ 1280, 4990}, + { 1371, 5135},{ 1442, 5244},{ 1520, 5321},{ 1684, 5398} + }, + /*Cb qi=27 INTER*/ + { + { 113, 20},{ 90, 338},{ 66, 661},{ 67, 1034}, + { 82, 1438},{ 97, 1842},{ 108, 2238},{ 115, 2624}, + { 123, 3000},{ 130, 3361},{ 138, 3708},{ 146, 4040}, + { 155, 4367},{ 164, 4688},{ 174, 4999},{ 186, 5306}, + { 203, 5609},{ 222, 5908},{ 243, 6202},{ 268, 6494}, + { 295, 6781},{ 326, 7058},{ 367, 7319},{ 420, 7551} + } + }, + { + /*Cr qi=27 INTRA*/ + { + { 5, 6},{ 75, 380},{ 133, 770},{ 173, 1217}, + { 214, 1650},{ 268, 2040},{ 337, 2375},{ 418, 2631}, + { 496, 2862},{ 558, 3104},{ 625, 3346},{ 692, 3571}, + { 753, 3786},{ 825, 3989},{ 896, 4182},{ 969, 4352}, + { 1059, 4479},{ 1144, 4614},{ 1212, 4757},{ 1284, 4871}, + { 1380, 4982},{ 1457, 5125},{ 1528, 5267},{ 1651, 5346} + }, + /*Cr qi=27 INTER*/ + { + { 92, 24},{ 74, 341},{ 61, 669},{ 71, 1049}, + { 88, 1448},{ 100, 1849},{ 107, 2243},{ 113, 2631}, + { 119, 3010},{ 125, 3373},{ 131, 3723},{ 137, 4064}, + { 146, 4396},{ 159, 4720},{ 172, 5033},{ 189, 5340}, + { 210, 5636},{ 233, 5920},{ 256, 6197},{ 282, 6465}, + { 310, 6730},{ 332, 7000},{ 359, 7259},{ 385, 7515} + } + } + }, + { + { + /*Y' qi=28 INTRA*/ + { + { 116, -8},{ 314, 1400},{ 640, 2458},{ 1013, 3197}, + { 1386, 3768},{ 1762, 4279},{ 2151, 4733},{ 2558, 5117}, + { 2970, 5442},{ 3393, 5714},{ 3820, 5935},{ 4243, 6069}, + { 4671, 6161},{ 5074, 6289},{ 5456, 6457},{ 5849, 6598}, + { 6244, 6689},{ 6632, 6777},{ 6984, 6833},{ 7294, 6855}, + { 7625, 6862},{ 7961, 6875},{ 8302, 6890},{ 8720, 6883} + }, + /*Y' qi=28 INTER*/ + { + { 54, 8},{ 81, 1333},{ 154, 2793},{ 231, 4138}, + { 304, 5352},{ 384, 6512},{ 519, 7585},{ 743, 8508}, + { 1082, 9236},{ 1587, 9717},{ 2267, 9928},{ 3034, 9944}, + { 3775, 9878},{ 4438, 9786},{ 5031, 9686},{ 5563, 9601}, + { 6042, 9523},{ 6481, 9456},{ 6890, 9405},{ 7266, 9356}, + { 7614, 9313},{ 7933, 9265},{ 8238, 9220},{ 8545, 9193} + } + }, + { + /*Cb qi=28 INTRA*/ + { + { 3, 3},{ 80, 368},{ 138, 746},{ 168, 1179}, + { 208, 1615},{ 268, 2014},{ 345, 2354},{ 432, 2637}, + { 515, 2884},{ 595, 3108},{ 669, 3323},{ 745, 3533}, + { 818, 3740},{ 876, 3953},{ 932, 4160},{ 1003, 4349}, + { 1088, 4501},{ 1154, 4648},{ 1241, 4768},{ 1349, 4889}, + { 1441, 5023},{ 1524, 5113},{ 1611, 5187},{ 1783, 5283} + }, + /*Cb qi=28 INTER*/ + { + { 117, 29},{ 91, 341},{ 65, 663},{ 68, 1038}, + { 85, 1440},{ 100, 1841},{ 110, 2234},{ 119, 2616}, + { 127, 2985},{ 135, 3342},{ 142, 3685},{ 151, 4015}, + { 162, 4337},{ 174, 4652},{ 186, 4960},{ 201, 5264}, + { 218, 5567},{ 239, 5863},{ 266, 6149},{ 295, 6434}, + { 328, 6715},{ 371, 6976},{ 409, 7239},{ 460, 7477} + } + }, + { + /*Cr qi=28 INTRA*/ + { + { 6, 7},{ 79, 381},{ 138, 771},{ 178, 1215}, + { 222, 1644},{ 285, 2026},{ 359, 2347},{ 441, 2597}, + { 521, 2827},{ 588, 3066},{ 655, 3303},{ 725, 3523}, + { 791, 3728},{ 870, 3920},{ 950, 4103},{ 1030, 4265}, + { 1121, 4388},{ 1198, 4520},{ 1266, 4659},{ 1356, 4759}, + { 1461, 4865},{ 1540, 4993},{ 1619, 5115},{ 1786, 5160} + }, + /*Cr qi=28 INTER*/ + { + { 96, 18},{ 78, 340},{ 66, 672},{ 74, 1051}, + { 90, 1450},{ 103, 1845},{ 110, 2235},{ 116, 2619}, + { 122, 2995},{ 129, 3356},{ 137, 3702},{ 146, 4038}, + { 156, 4365},{ 168, 4684},{ 182, 4995},{ 203, 5297}, + { 227, 5588},{ 253, 5866},{ 282, 6131},{ 311, 6394}, + { 339, 6664},{ 366, 6918},{ 400, 7171},{ 424, 7450} + } + } + }, + { + { + /*Y' qi=29 INTRA*/ + { + { 112, 7},{ 334, 1382},{ 681, 2410},{ 1081, 3112}, + { 1484, 3650},{ 1894, 4128},{ 2316, 4547},{ 2749, 4905}, + { 3188, 5208},{ 3634, 5458},{ 4079, 5666},{ 4517, 5791}, + { 4952, 5870},{ 5359, 5983},{ 5754, 6137},{ 6165, 6268}, + { 6568, 6351},{ 6958, 6423},{ 7320, 6471},{ 7638, 6490}, + { 7979, 6490},{ 8313, 6499},{ 8651, 6517},{ 9085, 6499} + }, + /*Y' qi=29 INTER*/ + { + { 55, 15},{ 85, 1336},{ 160, 2780},{ 242, 4104}, + { 323, 5302},{ 418, 6443},{ 586, 7480},{ 859, 8342}, + { 1278, 8982},{ 1888, 9347},{ 2658, 9457},{ 3457, 9425}, + { 4192, 9343},{ 4842, 9247},{ 5417, 9162},{ 5935, 9086}, + { 6404, 9011},{ 6841, 8952},{ 7241, 8907},{ 7609, 8867}, + { 7953, 8832},{ 8267, 8792},{ 8562, 8740},{ 8836, 8701} + } + }, + { + /*Cb qi=29 INTRA*/ + { + { 5, 3},{ 84, 368},{ 144, 746},{ 176, 1175}, + { 219, 1604},{ 285, 1991},{ 372, 2318},{ 462, 2591}, + { 546, 2833},{ 628, 3058},{ 704, 3274},{ 788, 3473}, + { 870, 3664},{ 935, 3865},{ 995, 4059},{ 1072, 4239}, + { 1167, 4388},{ 1248, 4518},{ 1334, 4634},{ 1429, 4765}, + { 1536, 4884},{ 1628, 4964},{ 1716, 5038},{ 1885, 5128} + }, + /*Cb qi=29 INTER*/ + { + { 126, 25},{ 95, 340},{ 69, 662},{ 71, 1039}, + { 88, 1440},{ 102, 1839},{ 113, 2227},{ 122, 2604}, + { 132, 2969},{ 141, 3320},{ 151, 3659},{ 161, 3985}, + { 172, 4301},{ 186, 4612},{ 200, 4917},{ 219, 5213}, + { 241, 5509},{ 265, 5800},{ 296, 6081},{ 329, 6360}, + { 369, 6633},{ 414, 6899},{ 465, 7148},{ 520, 7387} + } + }, + { + /*Cr qi=29 INTRA*/ + { + { 6, 7},{ 82, 382},{ 142, 772},{ 185, 1211}, + { 233, 1632},{ 303, 2000},{ 388, 2306},{ 475, 2550}, + { 556, 2779},{ 627, 3007},{ 707, 3237},{ 778, 3459}, + { 843, 3654},{ 927, 3834},{ 1012, 4012},{ 1101, 4152}, + { 1197, 4262},{ 1275, 4399},{ 1359, 4511},{ 1455, 4596}, + { 1562, 4708},{ 1644, 4833},{ 1719, 4954},{ 1888, 4988} + }, + /*Cr qi=29 INTER*/ + { + { 101, 28},{ 81, 343},{ 67, 673},{ 75, 1053}, + { 93, 1450},{ 106, 1844},{ 113, 2230},{ 119, 2610}, + { 127, 2980},{ 135, 3334},{ 143, 3676},{ 153, 4007}, + { 165, 4330},{ 180, 4645},{ 201, 4951},{ 224, 5243}, + { 253, 5522},{ 284, 5794},{ 314, 6060},{ 345, 6322}, + { 381, 6578},{ 419, 6828},{ 455, 7073},{ 495, 7316} + } + } + }, + { + { + /*Y' qi=30 INTRA*/ + { + { 112, 8},{ 335, 1380},{ 682, 2401},{ 1083, 3093}, + { 1489, 3619},{ 1902, 4092},{ 2332, 4511},{ 2777, 4865}, + { 3231, 5156},{ 3693, 5394},{ 4153, 5585},{ 4605, 5689}, + { 5049, 5764},{ 5468, 5871},{ 5875, 6004},{ 6295, 6120}, + { 6706, 6201},{ 7099, 6273},{ 7461, 6311},{ 7785, 6320}, + { 8128, 6322},{ 8469, 6331},{ 8806, 6342},{ 9220, 6338} + }, + /*Y' qi=30 INTER*/ + { + { 58, 8},{ 90, 1340},{ 169, 2771},{ 257, 4079}, + { 345, 5266},{ 459, 6387},{ 660, 7383},{ 990, 8180}, + { 1496, 8726},{ 2203, 8992},{ 3029, 9038},{ 3833, 8984}, + { 4549, 8900},{ 5183, 8813},{ 5745, 8735},{ 6250, 8674}, + { 6715, 8619},{ 7138, 8565},{ 7529, 8528},{ 7899, 8495}, + { 8234, 8465},{ 8550, 8429},{ 8856, 8395},{ 9160, 8374} + } + }, + { + /*Cb qi=30 INTRA*/ + { + { 7, 3},{ 88, 369},{ 149, 747},{ 185, 1175}, + { 232, 1599},{ 304, 1976},{ 392, 2293},{ 486, 2557}, + { 573, 2797},{ 656, 3027},{ 735, 3243},{ 819, 3442}, + { 903, 3629},{ 966, 3828},{ 1025, 4027},{ 1105, 4204}, + { 1201, 4343},{ 1282, 4469},{ 1379, 4575},{ 1486, 4689}, + { 1588, 4813},{ 1678, 4900},{ 1767, 4969},{ 1911, 5080} + }, + /*Cb qi=30 INTER*/ + { + { 120, 23},{ 96, 336},{ 72, 661},{ 75, 1043}, + { 91, 1441},{ 105, 1837},{ 117, 2221},{ 127, 2592}, + { 137, 2953},{ 148, 3301},{ 159, 3635},{ 170, 3959}, + { 184, 4271},{ 199, 4578},{ 216, 4879},{ 238, 5175}, + { 262, 5466},{ 294, 5750},{ 332, 6027},{ 373, 6298}, + { 421, 6559},{ 473, 6805},{ 526, 7053},{ 587, 7298} + } + }, + { + /*Cr qi=30 INTRA*/ + { + { 10, 7},{ 89, 384},{ 147, 773},{ 192, 1211}, + { 245, 1627},{ 322, 1984},{ 412, 2280},{ 501, 2520}, + { 583, 2750},{ 654, 2982},{ 736, 3207},{ 810, 3419}, + { 873, 3614},{ 957, 3794},{ 1048, 3965},{ 1139, 4102}, + { 1237, 4208},{ 1327, 4328},{ 1408, 4448},{ 1496, 4545}, + { 1604, 4652},{ 1699, 4760},{ 1780, 4877},{ 1937, 4942} + }, + /*Cr qi=30 INTER*/ + { + { 115, 26},{ 89, 342},{ 70, 672},{ 79, 1055}, + { 96, 1451},{ 108, 1841},{ 116, 2222},{ 124, 2599}, + { 132, 2965},{ 141, 3316},{ 151, 3655},{ 163, 3984}, + { 178, 4301},{ 197, 4609},{ 219, 4909},{ 247, 5195}, + { 280, 5469},{ 317, 5734},{ 351, 5991},{ 383, 6248}, + { 423, 6500},{ 467, 6744},{ 502, 6995},{ 558, 7226} + } + } + }, + { + { + /*Y' qi=31 INTRA*/ + { + { 116, 20},{ 359, 1361},{ 732, 2350},{ 1162, 3010}, + { 1597, 3507},{ 2042, 3950},{ 2503, 4339},{ 2974, 4670}, + { 3446, 4951},{ 3922, 5179},{ 4394, 5357},{ 4858, 5454}, + { 5313, 5519},{ 5734, 5626},{ 6154, 5755},{ 6585, 5859}, + { 7004, 5928},{ 7408, 5998},{ 7775, 6039},{ 8102, 6048}, + { 8442, 6051},{ 8790, 6054},{ 9136, 6057},{ 9554, 6041} + }, + /*Y' qi=31 INTER*/ + { + { 53, 12},{ 90, 1340},{ 169, 2765},{ 259, 4062}, + { 353, 5236},{ 483, 6340},{ 713, 7305},{ 1086, 8059}, + { 1651, 8548},{ 2423, 8751},{ 3288, 8754},{ 4106, 8674}, + { 4827, 8572},{ 5451, 8482},{ 6007, 8407},{ 6514, 8344}, + { 6970, 8282},{ 7397, 8225},{ 7795, 8193},{ 8159, 8161}, + { 8498, 8120},{ 8814, 8093},{ 9127, 8066},{ 9432, 8040} + } + }, + { + /*Cb qi=31 INTRA*/ + { + { 7, 3},{ 88, 369},{ 149, 746},{ 185, 1173}, + { 234, 1595},{ 308, 1967},{ 399, 2278},{ 494, 2537}, + { 583, 2774},{ 669, 2997},{ 755, 3204},{ 847, 3390}, + { 936, 3569},{ 1008, 3759},{ 1078, 3942},{ 1162, 4104}, + { 1262, 4238},{ 1352, 4364},{ 1442, 4470},{ 1557, 4567}, + { 1676, 4674},{ 1759, 4781},{ 1850, 4853},{ 2043, 4897} + }, + /*Cb qi=31 INTER*/ + { + { 121, 23},{ 96, 335},{ 72, 660},{ 74, 1043}, + { 90, 1440},{ 105, 1834},{ 116, 2217},{ 127, 2586}, + { 138, 2945},{ 148, 3293},{ 159, 3626},{ 172, 3945}, + { 185, 4256},{ 202, 4559},{ 223, 4856},{ 245, 5150}, + { 272, 5440},{ 306, 5719},{ 346, 5989},{ 391, 6253}, + { 443, 6511},{ 510, 6743},{ 583, 6965},{ 651, 7182} + } + }, + { + /*Cr qi=31 INTRA*/ + { + { 10, 7},{ 88, 384},{ 147, 773},{ 192, 1209}, + { 247, 1622},{ 326, 1974},{ 417, 2262},{ 509, 2500}, + { 596, 2726},{ 670, 2949},{ 754, 3170},{ 836, 3370}, + { 912, 3548},{ 999, 3724},{ 1093, 3888},{ 1198, 4000}, + { 1304, 4095},{ 1384, 4230},{ 1470, 4347},{ 1577, 4422}, + { 1696, 4513},{ 1798, 4620},{ 1869, 4746},{ 1991, 4798} + }, + /*Cr qi=31 INTER*/ + { + { 113, 32},{ 88, 345},{ 69, 674},{ 79, 1055}, + { 96, 1451},{ 108, 1839},{ 115, 2218},{ 123, 2592}, + { 132, 2957},{ 141, 3308},{ 151, 3643},{ 163, 3968}, + { 179, 4285},{ 200, 4590},{ 225, 4886},{ 254, 5169}, + { 291, 5436},{ 330, 5696},{ 368, 5951},{ 409, 6200}, + { 452, 6448},{ 493, 6695},{ 536, 6940},{ 571, 7204} + } + } + }, + { + { + /*Y' qi=32 INTRA*/ + { + { 123, 26},{ 370, 1356},{ 756, 2321},{ 1211, 2944}, + { 1674, 3408},{ 2148, 3826},{ 2639, 4193},{ 3138, 4504}, + { 3634, 4765},{ 4133, 4973},{ 4625, 5137},{ 5101, 5225}, + { 5567, 5274},{ 6002, 5363},{ 6437, 5482},{ 6885, 5566}, + { 7312, 5625},{ 7723, 5686},{ 8101, 5721},{ 8429, 5732}, + { 8769, 5728},{ 9120, 5726},{ 9472, 5723},{ 9918, 5700} + }, + /*Y' qi=32 INTER*/ + { + { 54, -3},{ 95, 1343},{ 179, 2750},{ 276, 4027}, + { 382, 5185},{ 543, 6256},{ 830, 7161},{ 1301, 7815}, + { 2003, 8172},{ 2883, 8266},{ 3779, 8217},{ 4578, 8127}, + { 5274, 8035},{ 5886, 7952},{ 6430, 7887},{ 6929, 7835}, + { 7380, 7779},{ 7796, 7737},{ 8190, 7705},{ 8552, 7672}, + { 8896, 7640},{ 9210, 7612},{ 9510, 7589},{ 9746, 7552} + } + }, + { + /*Cb qi=32 INTRA*/ + { + { 6, 3},{ 89, 369},{ 153, 746},{ 193, 1167}, + { 247, 1577},{ 330, 1935},{ 429, 2236},{ 528, 2494}, + { 620, 2732},{ 712, 2948},{ 801, 3146},{ 898, 3325}, + { 999, 3489},{ 1078, 3664},{ 1155, 3832},{ 1251, 3985}, + { 1360, 4115},{ 1451, 4236},{ 1549, 4338},{ 1667, 4433}, + { 1797, 4522},{ 1891, 4613},{ 1989, 4687},{ 2162, 4776} + }, + /*Cb qi=32 INTER*/ + { + { 116, -1},{ 98, 321},{ 80, 656},{ 80, 1042}, + { 96, 1438},{ 110, 1827},{ 122, 2205},{ 133, 2570}, + { 144, 2925},{ 157, 3268},{ 170, 3597},{ 185, 3911}, + { 202, 4216},{ 221, 4516},{ 244, 4809},{ 273, 5096}, + { 308, 5376},{ 350, 5644},{ 401, 5907},{ 459, 6160}, + { 520, 6401},{ 592, 6630},{ 676, 6837},{ 758, 7050} + } + }, + { + /*Cr qi=32 INTRA*/ + { + { 12, 7},{ 91, 386},{ 152, 773},{ 201, 1202}, + { 261, 1603},{ 347, 1942},{ 447, 2223},{ 540, 2460}, + { 626, 2684},{ 711, 2901},{ 801, 3115},{ 887, 3312}, + { 969, 3480},{ 1068, 3633},{ 1176, 3779},{ 1283, 3885}, + { 1392, 3969},{ 1485, 4090},{ 1573, 4206},{ 1686, 4274}, + { 1813, 4354},{ 1911, 4459},{ 2004, 4563},{ 2162, 4590} + }, + /*Cr qi=32 INTER*/ + { + { 129, 5},{ 98, 334},{ 75, 673},{ 84, 1055}, + { 101, 1448},{ 113, 1832},{ 121, 2206},{ 129, 2577}, + { 140, 2937},{ 151, 3282},{ 163, 3614},{ 179, 3932}, + { 198, 4240},{ 221, 4542},{ 252, 4830},{ 290, 5102}, + { 329, 5364},{ 373, 5618},{ 420, 5864},{ 468, 6105}, + { 513, 6351},{ 564, 6587},{ 624, 6810},{ 697, 7017} + } + } + }, + { + { + /*Y' qi=33 INTRA*/ + { + { 115, 36},{ 388, 1338},{ 791, 2289},{ 1258, 2899}, + { 1732, 3352},{ 2220, 3760},{ 2730, 4117},{ 3244, 4415}, + { 3751, 4662},{ 4261, 4858},{ 4766, 5012},{ 5249, 5094}, + { 5719, 5141},{ 6159, 5225},{ 6597, 5333},{ 7044, 5416}, + { 7474, 5472},{ 7893, 5531},{ 8268, 5570},{ 8591, 5580}, + { 8931, 5578},{ 9283, 5579},{ 9634, 5582},{10067, 5560} + }, + /*Y' qi=33 INTER*/ + { + { 65, -14},{ 102, 1345},{ 190, 2736},{ 294, 3999}, + { 411, 5146},{ 597, 6192},{ 934, 7045},{ 1488, 7622}, + { 2281, 7895},{ 3213, 7937},{ 4108, 7871},{ 4883, 7784}, + { 5556, 7709},{ 6150, 7643},{ 6685, 7585},{ 7176, 7539}, + { 7620, 7502},{ 8034, 7466},{ 8427, 7435},{ 8793, 7409}, + { 9136, 7386},{ 9446, 7364},{ 9743, 7339},{10025, 7303} + } + }, + { + /*Cb qi=33 INTRA*/ + { + { 5, 3},{ 92, 369},{ 159, 746},{ 203, 1163}, + { 263, 1564},{ 353, 1911},{ 458, 2204},{ 557, 2460}, + { 650, 2697},{ 744, 2913},{ 836, 3110},{ 934, 3292}, + { 1036, 3454},{ 1125, 3616},{ 1204, 3781},{ 1298, 3932}, + { 1410, 4058},{ 1507, 4170},{ 1606, 4265},{ 1725, 4358}, + { 1853, 4445},{ 1955, 4535},{ 2067, 4597},{ 2258, 4663} + }, + /*Cb qi=33 INTER*/ + { + { 109, 37},{ 94, 343},{ 81, 662},{ 85, 1042}, + { 102, 1436},{ 116, 1823},{ 128, 2195},{ 141, 2554}, + { 154, 2906},{ 167, 3246},{ 183, 3570},{ 202, 3881}, + { 220, 4185},{ 241, 4482},{ 268, 4772},{ 302, 5053}, + { 341, 5328},{ 388, 5592},{ 446, 5846},{ 507, 6096}, + { 581, 6328},{ 670, 6534},{ 762, 6731},{ 842, 6922} + } + }, + { + /*Cr qi=33 INTRA*/ + { + { 11, 7},{ 93, 387},{ 158, 774},{ 211, 1197}, + { 278, 1589},{ 372, 1917},{ 475, 2191},{ 569, 2429}, + { 658, 2655},{ 744, 2868},{ 835, 3083},{ 926, 3271}, + { 1010, 3430},{ 1110, 3586},{ 1224, 3724},{ 1336, 3826}, + { 1449, 3908},{ 1547, 4021},{ 1636, 4136},{ 1751, 4200}, + { 1886, 4277},{ 1977, 4384},{ 2070, 4474},{ 2232, 4510} + }, + /*Cr qi=33 INTER*/ + { + { 77, 9},{ 90, 347},{ 80, 674},{ 91, 1053}, + { 107, 1444},{ 119, 1825},{ 127, 2196},{ 137, 2563}, + { 149, 2919},{ 161, 3259},{ 176, 3588},{ 194, 3905}, + { 217, 4209},{ 246, 4504},{ 280, 4786},{ 320, 5055}, + { 364, 5316},{ 409, 5565},{ 460, 5804},{ 517, 6039}, + { 578, 6264},{ 640, 6489},{ 701, 6721},{ 772, 6948} + } + } + }, + { + { + /*Y' qi=34 INTRA*/ + { + { 124, 40},{ 401, 1333},{ 823, 2262},{ 1318, 2842}, + { 1823, 3265},{ 2339, 3650},{ 2872, 3991},{ 3405, 4274}, + { 3926, 4513},{ 4448, 4704},{ 4961, 4845},{ 5450, 4921}, + { 5925, 4971},{ 6372, 5053},{ 6813, 5160},{ 7264, 5242}, + { 7704, 5291},{ 8124, 5346},{ 8500, 5382},{ 8831, 5384}, + { 9178, 5380},{ 9525, 5387},{ 9869, 5389},{10310, 5356} + }, + /*Y' qi=34 INTER*/ + { + { 64, -17},{ 101, 1344},{ 190, 2730},{ 299, 3981}, + { 430, 5110},{ 648, 6127},{ 1036, 6933},{ 1664, 7445}, + { 2535, 7652},{ 3504, 7653},{ 4402, 7572},{ 5173, 7479}, + { 5843, 7400},{ 6441, 7334},{ 6976, 7280},{ 7464, 7231}, + { 7910, 7189},{ 8332, 7157},{ 8730, 7125},{ 9091, 7103}, + { 9422, 7086},{ 9753, 7061},{10067, 7036},{10316, 7029} + } + }, + { + /*Cb qi=34 INTRA*/ + { + { 5, 3},{ 91, 369},{ 158, 746},{ 204, 1162}, + { 266, 1561},{ 358, 1903},{ 466, 2189},{ 570, 2439}, + { 665, 2671},{ 765, 2880},{ 864, 3069},{ 970, 3238}, + { 1079, 3392},{ 1174, 3545},{ 1265, 3693},{ 1360, 3841}, + { 1471, 3968},{ 1572, 4083},{ 1675, 4181},{ 1804, 4255}, + { 1939, 4332},{ 2048, 4411},{ 2155, 4484},{ 2339, 4584} + }, + /*Cb qi=34 INTER*/ + { + { 99, 44},{ 92, 345},{ 82, 661},{ 86, 1043}, + { 101, 1436},{ 116, 1821},{ 128, 2191},{ 140, 2549}, + { 154, 2898},{ 168, 3235},{ 185, 3556},{ 203, 3865}, + { 224, 4166},{ 248, 4457},{ 278, 4741},{ 315, 5021}, + { 361, 5289},{ 416, 5546},{ 483, 5792},{ 559, 6025}, + { 651, 6237},{ 752, 6432},{ 849, 6626},{ 967, 6790} + } + }, + { + /*Cr qi=34 INTRA*/ + { + { 11, 7},{ 93, 387},{ 158, 773},{ 212, 1195}, + { 282, 1584},{ 378, 1909},{ 483, 2179},{ 578, 2414}, + { 671, 2633},{ 766, 2837},{ 866, 3038},{ 960, 3223}, + { 1049, 3376},{ 1158, 3520},{ 1285, 3644},{ 1400, 3740}, + { 1505, 3828},{ 1616, 3928},{ 1713, 4030},{ 1820, 4104}, + { 1957, 4185},{ 2063, 4280},{ 2160, 4355},{ 2320, 4341} + }, + /*Cr qi=34 INTER*/ + { + { 78, 11},{ 89, 347},{ 79, 674},{ 90, 1053}, + { 106, 1444},{ 117, 1823},{ 127, 2192},{ 137, 2558}, + { 149, 2912},{ 163, 3249},{ 178, 3574},{ 197, 3888}, + { 222, 4189},{ 252, 4481},{ 293, 4755},{ 341, 5013}, + { 386, 5268},{ 436, 5512},{ 498, 5743},{ 563, 5970}, + { 622, 6200},{ 694, 6415},{ 776, 6622},{ 871, 6818} + } + } + }, + { + { + /*Y' qi=35 INTRA*/ + { + { 116, 51},{ 433, 1312},{ 881, 2221},{ 1406, 2771}, + { 1948, 3156},{ 2511, 3501},{ 3085, 3811},{ 3654, 4066}, + { 4212, 4273},{ 4763, 4444},{ 5298, 4572},{ 5799, 4638}, + { 6285, 4678},{ 6747, 4746},{ 7203, 4838},{ 7673, 4905}, + { 8124, 4950},{ 8552, 5003},{ 8938, 5027},{ 9275, 5026}, + { 9628, 5019},{ 9981, 5024},{10331, 5030},{10795, 5000} + }, + /*Y' qi=35 INTER*/ + { + { 71, -10},{ 108, 1348},{ 203, 2710},{ 325, 3938}, + { 485, 5040},{ 766, 6000},{ 1267, 6706},{ 2048, 7089}, + { 3037, 7191},{ 4032, 7146},{ 4903, 7061},{ 5648, 6977}, + { 6301, 6912},{ 6884, 6857},{ 7413, 6812},{ 7898, 6775}, + { 8342, 6739},{ 8764, 6710},{ 9160, 6688},{ 9519, 6668}, + { 9859, 6646},{10190, 6625},{10492, 6612},{10755, 6595} + } + }, + { + /*Cb qi=35 INTRA*/ + { + { 6, 3},{ 95, 369},{ 164, 746},{ 214, 1156}, + { 287, 1542},{ 390, 1869},{ 504, 2143},{ 611, 2388}, + { 712, 2613},{ 822, 2811},{ 937, 2987},{ 1055, 3147}, + { 1174, 3285},{ 1286, 3420},{ 1386, 3560},{ 1488, 3698}, + { 1604, 3814},{ 1714, 3916},{ 1825, 4008},{ 1958, 4088}, + { 2101, 4159},{ 2224, 4226},{ 2339, 4292},{ 2538, 4383} + }, + /*Cb qi=35 INTER*/ + { + { 98, 41},{ 90, 348},{ 86, 665},{ 92, 1042}, + { 108, 1432},{ 122, 1812},{ 136, 2175},{ 151, 2528}, + { 165, 2872},{ 182, 3202},{ 202, 3516},{ 225, 3819}, + { 251, 4112},{ 281, 4398},{ 320, 4675},{ 367, 4944}, + { 421, 5204},{ 493, 5450},{ 579, 5679},{ 672, 5892}, + { 785, 6082},{ 906, 6258},{ 1026, 6432},{ 1153, 6592} + } + }, + { + /*Cr qi=35 INTRA*/ + { + { 12, 7},{ 98, 388},{ 166, 773},{ 226, 1187}, + { 306, 1563},{ 411, 1874},{ 524, 2134},{ 622, 2365}, + { 721, 2577},{ 826, 2768},{ 947, 2946},{ 1066, 3106}, + { 1163, 3250},{ 1274, 3395},{ 1417, 3508},{ 1539, 3590}, + { 1639, 3671},{ 1754, 3765},{ 1865, 3855},{ 1979, 3921}, + { 2127, 3998},{ 2249, 4085},{ 2346, 4172},{ 2473, 4210} + }, + /*Cr qi=35 INTER*/ + { + { 86, 12},{ 94, 354},{ 85, 677},{ 96, 1052}, + { 113, 1439},{ 125, 1811},{ 135, 2177},{ 147, 2537}, + { 160, 2884},{ 177, 3215},{ 195, 3535},{ 219, 3842}, + { 252, 4133},{ 292, 4413},{ 339, 4680},{ 396, 4928}, + { 455, 5169},{ 514, 5408},{ 588, 5626},{ 672, 5835}, + { 750, 6051},{ 837, 6257},{ 943, 6442},{ 1073, 6595} + } + } + }, + { + { + /*Y' qi=36 INTRA*/ + { + { 116, 52},{ 432, 1312},{ 881, 2215},{ 1407, 2759}, + { 1948, 3140},{ 2511, 3484},{ 3090, 3789},{ 3672, 4036}, + { 4243, 4236},{ 4803, 4397},{ 5346, 4517},{ 5856, 4581}, + { 6350, 4614},{ 6821, 4675},{ 7286, 4763},{ 7754, 4832}, + { 8201, 4875},{ 8631, 4922},{ 9015, 4948},{ 9351, 4945}, + { 9706, 4941},{10061, 4948},{10408, 4949},{10878, 4923} + }, + /*Y' qi=36 INTER*/ + { + { 63, -16},{ 114, 1332},{ 216, 2690},{ 343, 3914}, + { 515, 5009},{ 829, 5939},{ 1399, 6586},{ 2263, 6901}, + { 3290, 6967},{ 4272, 6920},{ 5115, 6847},{ 5839, 6779}, + { 6478, 6726},{ 7051, 6685},{ 7571, 6649},{ 8050, 6614}, + { 8495, 6587},{ 8908, 6567},{ 9298, 6550},{ 9673, 6530}, + {10005, 6512},{10324, 6499},{10640, 6483},{10936, 6487} + } + }, + { + /*Cb qi=36 INTRA*/ + { + { 6, 3},{ 98, 370},{ 170, 746},{ 225, 1150}, + { 306, 1527},{ 416, 1845},{ 534, 2116},{ 642, 2363}, + { 743, 2591},{ 851, 2794},{ 964, 2972},{ 1081, 3133}, + { 1198, 3275},{ 1311, 3410},{ 1411, 3547},{ 1519, 3680}, + { 1642, 3789},{ 1750, 3892},{ 1860, 3982},{ 1998, 4054}, + { 2141, 4129},{ 2256, 4204},{ 2372, 4278},{ 2567, 4356} + }, + /*Cb qi=36 INTER*/ + { + { 107, 30},{ 96, 346},{ 88, 667},{ 100, 1039}, + { 115, 1426},{ 128, 1804},{ 142, 2164},{ 158, 2512}, + { 176, 2851},{ 195, 3178},{ 218, 3491},{ 243, 3791}, + { 270, 4084},{ 307, 4365},{ 348, 4638},{ 397, 4908}, + { 464, 5157},{ 545, 5392},{ 635, 5620},{ 734, 5831}, + { 854, 6015},{ 993, 6170},{ 1124, 6327},{ 1234, 6502} + } + }, + { + /*Cr qi=36 INTRA*/ + { + { 12, 7},{ 102, 388},{ 172, 773},{ 239, 1182}, + { 328, 1546},{ 439, 1848},{ 554, 2106},{ 651, 2341}, + { 747, 2561},{ 850, 2757},{ 972, 2934},{ 1086, 3097}, + { 1182, 3245},{ 1302, 3382},{ 1447, 3491},{ 1572, 3567}, + { 1677, 3641},{ 1793, 3733},{ 1899, 3828},{ 2013, 3894}, + { 2163, 3967},{ 2283, 4059},{ 2387, 4142},{ 2559, 4145} + }, + /*Cr qi=36 INTER*/ + { + { 98, -10},{ 96, 347},{ 89, 676},{ 102, 1048}, + { 118, 1433},{ 130, 1804},{ 141, 2167},{ 154, 2523}, + { 171, 2866},{ 190, 3194},{ 212, 3508},{ 240, 3809}, + { 276, 4099},{ 320, 4377},{ 372, 4638},{ 428, 4887}, + { 492, 5122},{ 560, 5353},{ 638, 5572},{ 725, 5779}, + { 814, 5985},{ 902, 6192},{ 1013, 6377},{ 1155, 6527} + } + } + }, + { + { + /*Y' qi=37 INTRA*/ + { + { 109, 58},{ 445, 1302},{ 927, 2177},{ 1489, 2689}, + { 2053, 3052},{ 2632, 3387},{ 3230, 3683},{ 3830, 3922}, + { 4417, 4114},{ 4992, 4266},{ 5546, 4375},{ 6067, 4430}, + { 6571, 4459},{ 7046, 4516},{ 7513, 4599},{ 7991, 4663}, + { 8445, 4706},{ 8883, 4749},{ 9273, 4771},{ 9612, 4770}, + { 9970, 4765},{10325, 4773},{10672, 4778},{11106, 4758} + }, + /*Y' qi=37 INTER*/ + { + { 56, -14},{ 114, 1333},{ 218, 2683},{ 354, 3894}, + { 550, 4966},{ 916, 5854},{ 1569, 6437},{ 2520, 6685}, + { 3596, 6704},{ 4585, 6635},{ 5424, 6556},{ 6147, 6489}, + { 6787, 6437},{ 7358, 6395},{ 7876, 6358},{ 8361, 6325}, + { 8807, 6294},{ 9229, 6271},{ 9631, 6253},{10002, 6238}, + {10356, 6228},{10678, 6212},{10975, 6197},{11274, 6185} + } + }, + { + /*Cb qi=37 INTRA*/ + { + { 6, 3},{ 99, 370},{ 171, 746},{ 227, 1149}, + { 309, 1522},{ 421, 1836},{ 541, 2104},{ 652, 2347}, + { 757, 2572},{ 871, 2768},{ 989, 2936},{ 1111, 3087}, + { 1238, 3223},{ 1357, 3352},{ 1465, 3486},{ 1576, 3612}, + { 1709, 3705},{ 1828, 3801},{ 1937, 3895},{ 2076, 3967}, + { 2220, 4035},{ 2345, 4104},{ 2466, 4173},{ 2680, 4265} + }, + /*Cb qi=37 INTER*/ + { + { 111, 27},{ 97, 344},{ 87, 667},{ 99, 1038}, + { 115, 1425},{ 128, 1802},{ 143, 2160},{ 159, 2506}, + { 176, 2843},{ 198, 3167},{ 220, 3477},{ 247, 3774}, + { 280, 4061},{ 321, 4338},{ 368, 4608},{ 427, 4867}, + { 501, 5109},{ 595, 5332},{ 701, 5544},{ 818, 5738}, + { 956, 5905},{ 1105, 6066},{ 1248, 6217},{ 1381, 6353} + } + }, + { + /*Cr qi=37 INTRA*/ + { + { 12, 7},{ 102, 388},{ 173, 773},{ 242, 1180}, + { 331, 1541},{ 444, 1839},{ 562, 2095},{ 662, 2326}, + { 763, 2540},{ 871, 2728},{ 1003, 2892},{ 1130, 3045}, + { 1230, 3188},{ 1350, 3321},{ 1503, 3418},{ 1634, 3492}, + { 1737, 3568},{ 1856, 3653},{ 1970, 3744},{ 2091, 3802}, + { 2247, 3871},{ 2371, 3962},{ 2477, 4041},{ 2655, 4052} + }, + /*Cr qi=37 INTER*/ + { + { 89, -9},{ 97, 347},{ 88, 677},{ 102, 1048}, + { 118, 1432},{ 130, 1802},{ 141, 2163},{ 154, 2517}, + { 172, 2857},{ 192, 3181},{ 216, 3494},{ 246, 3793}, + { 286, 4074},{ 337, 4343},{ 395, 4600},{ 464, 4837}, + { 534, 5066},{ 608, 5289},{ 694, 5501},{ 788, 5704}, + { 893, 5901},{ 1010, 6088},{ 1151, 6249},{ 1331, 6374} + } + } + }, + { + { + /*Y' qi=38 INTRA*/ + { + { 107, 65},{ 476, 1286},{ 968, 2148},{ 1548, 2641}, + { 2141, 2979},{ 2757, 3289},{ 3390, 3564},{ 4020, 3784}, + { 4632, 3957},{ 5224, 4097},{ 5794, 4201},{ 6326, 4250}, + { 6828, 4274},{ 7309, 4322},{ 7790, 4401},{ 8271, 4463}, + { 8729, 4498},{ 9165, 4540},{ 9552, 4566},{ 9901, 4560}, + {10266, 4552},{10617, 4563},{10964, 4572},{11393, 4567} + }, + /*Y' qi=38 INTER*/ + { + { 57, -13},{ 118, 1332},{ 233, 2665},{ 386, 3856}, + { 620, 4899},{ 1070, 5722},{ 1849, 6211},{ 2898, 6384}, + { 3989, 6376},{ 4947, 6311},{ 5754, 6249},{ 6454, 6199}, + { 7077, 6161},{ 7640, 6132},{ 8159, 6101},{ 8639, 6076}, + { 9081, 6054},{ 9502, 6037},{ 9900, 6027},{10274, 6012}, + {10621, 5999},{10938, 5991},{11237, 5977},{11557, 5966} + } + }, + { + /*Cb qi=38 INTRA*/ + { + { 8, 3},{ 104, 370},{ 179, 744},{ 243, 1139}, + { 338, 1498},{ 458, 1801},{ 584, 2060},{ 700, 2297}, + { 812, 2514},{ 935, 2699},{ 1061, 2858},{ 1189, 3007}, + { 1321, 3141},{ 1446, 3266},{ 1563, 3388},{ 1684, 3512}, + { 1816, 3614},{ 1942, 3702},{ 2055, 3793},{ 2201, 3857}, + { 2357, 3923},{ 2477, 3994},{ 2593, 4061},{ 2768, 4178} + }, + /*Cb qi=38 INTER*/ + { + { 118, 24},{ 102, 342},{ 91, 663},{ 101, 1040}, + { 116, 1427},{ 131, 1799},{ 147, 2152},{ 168, 2491}, + { 191, 2822},{ 215, 3139},{ 244, 3441},{ 276, 3731}, + { 316, 4013},{ 363, 4286},{ 423, 4546},{ 495, 4795}, + { 584, 5028},{ 691, 5242},{ 814, 5439},{ 959, 5608}, + { 1119, 5759},{ 1277, 5906},{ 1449, 6035},{ 1655, 6144} + } + }, + { + /*Cr qi=38 INTRA*/ + { + { 12, 6},{ 106, 387},{ 182, 771},{ 261, 1168}, + { 364, 1514},{ 483, 1802},{ 603, 2053},{ 707, 2282}, + { 817, 2489},{ 933, 2670},{ 1074, 2825},{ 1210, 2967}, + { 1320, 3104},{ 1444, 3229},{ 1599, 3324},{ 1735, 3396}, + { 1846, 3464},{ 1971, 3547},{ 2086, 3646},{ 2206, 3711}, + { 2366, 3773},{ 2499, 3859},{ 2603, 3945},{ 2766, 3952} + }, + /*Cr qi=38 INTER*/ + { + { 86, -9},{ 91, 352},{ 85, 680},{ 102, 1053}, + { 119, 1435},{ 132, 1799},{ 146, 2153},{ 162, 2501}, + { 183, 2835},{ 209, 3154},{ 240, 3458},{ 278, 3751}, + { 327, 4025},{ 388, 4284},{ 455, 4532},{ 529, 4766}, + { 616, 4980},{ 711, 5188},{ 815, 5386},{ 920, 5583}, + { 1042, 5770},{ 1186, 5936},{ 1348, 6080},{ 1542, 6196} + } + } + }, + { + { + /*Y' qi=39 INTRA*/ + { + { 103, 66},{ 479, 1283},{ 998, 2125},{ 1610, 2591}, + { 2223, 2913},{ 2855, 3214},{ 3501, 3482},{ 4146, 3698}, + { 4772, 3868},{ 5376, 3999},{ 5956, 4095},{ 6496, 4140}, + { 7008, 4162},{ 7499, 4209},{ 7987, 4282},{ 8478, 4338}, + { 8947, 4374},{ 9385, 4417},{ 9783, 4437},{10143, 4433}, + {10504, 4424},{10866, 4435},{11225, 4444},{11665, 4430} + }, + /*Y' qi=39 INTER*/ + { + { 56, 2},{ 118, 1332},{ 235, 2660},{ 395, 3843}, + { 653, 4867},{ 1153, 5652},{ 2003, 6089},{ 3113, 6214}, + { 4228, 6178},{ 5189, 6102},{ 6002, 6031},{ 6707, 5976}, + { 7336, 5936},{ 7901, 5900},{ 8424, 5870},{ 8915, 5844}, + { 9361, 5822},{ 9784, 5807},{10187, 5794},{10571, 5778}, + {10931, 5763},{11264, 5751},{11582, 5742},{11916, 5730} + } + }, + { + /*Cb qi=39 INTRA*/ + { + { 8, 3},{ 104, 370},{ 179, 744},{ 244, 1138}, + { 340, 1496},{ 461, 1796},{ 588, 2053},{ 705, 2288}, + { 820, 2503},{ 945, 2684},{ 1073, 2840},{ 1210, 2981}, + { 1352, 3106},{ 1480, 3225},{ 1603, 3342},{ 1728, 3464}, + { 1865, 3559},{ 1990, 3645},{ 2106, 3734},{ 2258, 3796}, + { 2413, 3856},{ 2540, 3920},{ 2667, 3986},{ 2887, 4060} + }, + /*Cb qi=39 INTER*/ + { + { 119, 19},{ 103, 340},{ 90, 664},{ 100, 1040}, + { 115, 1426},{ 131, 1797},{ 148, 2148},{ 169, 2486}, + { 192, 2816},{ 217, 3131},{ 247, 3432},{ 282, 3721}, + { 324, 3999},{ 374, 4268},{ 435, 4526},{ 520, 4766}, + { 621, 4990},{ 738, 5194},{ 878, 5376},{ 1035, 5543}, + { 1202, 5686},{ 1374, 5819},{ 1545, 5950},{ 1729, 6064} + } + }, + { + /*Cr qi=39 INTRA*/ + { + { 12, 6},{ 106, 387},{ 182, 771},{ 262, 1167}, + { 365, 1512},{ 486, 1798},{ 608, 2047},{ 713, 2274}, + { 824, 2479},{ 945, 2655},{ 1091, 2804},{ 1231, 2941}, + { 1346, 3073},{ 1475, 3194},{ 1633, 3282},{ 1778, 3345}, + { 1891, 3414},{ 2013, 3501},{ 2138, 3584},{ 2266, 3640}, + { 2428, 3701},{ 2568, 3782},{ 2674, 3863},{ 2816, 3894} + }, + /*Cr qi=39 INTER*/ + { + { 88, -7},{ 92, 352},{ 85, 680},{ 102, 1053}, + { 119, 1434},{ 132, 1797},{ 146, 2151},{ 163, 2498}, + { 185, 2830},{ 211, 3147},{ 243, 3451},{ 285, 3735}, + { 337, 4005},{ 401, 4260},{ 477, 4499},{ 565, 4721}, + { 655, 4937},{ 749, 5148},{ 858, 5344},{ 979, 5529}, + { 1110, 5710},{ 1264, 5871},{ 1460, 5990},{ 1677, 6086} + } + } + }, + { + { + /*Y' qi=40 INTRA*/ + { + { 98, 71},{ 491, 1274},{ 1023, 2103},{ 1641, 2559}, + { 2257, 2877},{ 2898, 3171},{ 3566, 3429},{ 4233, 3629}, + { 4881, 3784},{ 5499, 3906},{ 6088, 3997},{ 6631, 4040}, + { 7145, 4060},{ 7640, 4107},{ 8128, 4178},{ 8618, 4233}, + { 9077, 4267},{ 9514, 4304},{ 9919, 4324},{10277, 4317}, + {10635, 4312},{10985, 4324},{11338, 4331},{11792, 4334} + }, + /*Y' qi=40 INTER*/ + { + { 63, -26},{ 125, 1331},{ 256, 2640},{ 439, 3801}, + { 757, 4782},{ 1391, 5474},{ 2399, 5805},{ 3582, 5870}, + { 4678, 5824},{ 5600, 5763},{ 6386, 5710},{ 7076, 5667}, + { 7693, 5637},{ 8252, 5610},{ 8775, 5586},{ 9255, 5571}, + { 9694, 5556},{10115, 5541},{10530, 5530},{10903, 5522}, + {11242, 5515},{11596, 5501},{11904, 5482},{12205, 5475} + } + }, + { + /*Cb qi=40 INTRA*/ + { + { 8, 3},{ 108, 371},{ 189, 743},{ 265, 1128}, + { 371, 1475},{ 499, 1767},{ 628, 2022},{ 746, 2256}, + { 864, 2467},{ 991, 2647},{ 1124, 2801},{ 1270, 2933}, + { 1412, 3054},{ 1547, 3165},{ 1677, 3277},{ 1804, 3393}, + { 1946, 3483},{ 2078, 3569},{ 2201, 3651},{ 2352, 3711}, + { 2513, 3766},{ 2643, 3826},{ 2775, 3880},{ 3025, 3919} + }, + /*Cb qi=40 INTER*/ + { + { 114, 35},{ 104, 349},{ 96, 667},{ 106, 1040}, + { 121, 1423},{ 138, 1789},{ 158, 2132},{ 184, 2464}, + { 212, 2787},{ 242, 3095},{ 279, 3389},{ 321, 3671}, + { 374, 3941},{ 438, 4199},{ 517, 4446},{ 617, 4673}, + { 740, 4881},{ 891, 5064},{ 1058, 5225},{ 1239, 5372}, + { 1441, 5499},{ 1638, 5610},{ 1840, 5719},{ 2076, 5814} + } + }, + { + /*Cr qi=40 INTRA*/ + { + { 14, 7},{ 114, 389},{ 193, 771},{ 283, 1156}, + { 399, 1488},{ 523, 1768},{ 643, 2018},{ 752, 2245}, + { 865, 2450},{ 984, 2626},{ 1139, 2763},{ 1290, 2887}, + { 1413, 3014},{ 1550, 3128},{ 1711, 3211},{ 1865, 3268}, + { 1981, 3334},{ 2103, 3415},{ 2237, 3486},{ 2365, 3543}, + { 2529, 3610},{ 2666, 3700},{ 2775, 3779},{ 2929, 3803} + }, + /*Cr qi=40 INTER*/ + { + { 89, -8},{ 95, 353},{ 90, 681},{ 107, 1053}, + { 124, 1430},{ 139, 1787},{ 156, 2136},{ 177, 2477}, + { 203, 2803},{ 237, 3112},{ 276, 3406},{ 329, 3683}, + { 395, 3942},{ 475, 4182},{ 567, 4407},{ 665, 4624}, + { 767, 4834},{ 879, 5032},{ 1011, 5213},{ 1169, 5375}, + { 1348, 5525},{ 1547, 5654},{ 1785, 5743},{ 2066, 5787} + } + } + }, + { + { + /*Y' qi=41 INTRA*/ + { + { 98, 71},{ 495, 1272},{ 1040, 2090},{ 1675, 2533}, + { 2302, 2842},{ 2953, 3132},{ 3631, 3381},{ 4309, 3574}, + { 4966, 3726},{ 5593, 3846},{ 6189, 3934},{ 6738, 3972}, + { 7256, 3991},{ 7754, 4036},{ 8250, 4099},{ 8747, 4150}, + { 9207, 4185},{ 9650, 4222},{10057, 4242},{10411, 4237}, + {10771, 4230},{11127, 4244},{11486, 4254},{11933, 4252} + }, + /*Y' qi=41 INTER*/ + { + { 65, -25},{ 125, 1331},{ 260, 2633},{ 457, 3782}, + { 807, 4740},{ 1499, 5397},{ 2562, 5693},{ 3766, 5743}, + { 4859, 5695},{ 5776, 5638},{ 6556, 5590},{ 7243, 5554}, + { 7859, 5529},{ 8417, 5506},{ 8935, 5486},{ 9419, 5473}, + { 9869, 5460},{10296, 5446},{10711, 5436},{11089, 5430}, + {11445, 5421},{11802, 5412},{12129, 5404},{12465, 5393} + } + }, + { + /*Cb qi=41 INTRA*/ + { + { 8, 3},{ 108, 371},{ 189, 743},{ 267, 1126}, + { 374, 1471},{ 504, 1760},{ 635, 2011},{ 758, 2241}, + { 881, 2447},{ 1013, 2621},{ 1147, 2773},{ 1293, 2906}, + { 1441, 3023},{ 1580, 3131},{ 1712, 3243},{ 1844, 3360}, + { 1985, 3451},{ 2114, 3532},{ 2240, 3613},{ 2390, 3680}, + { 2550, 3740},{ 2687, 3800},{ 2825, 3862},{ 3052, 3944} + }, + /*Cb qi=41 INTER*/ + { + { 104, 39},{ 100, 350},{ 95, 667},{ 105, 1040}, + { 121, 1422},{ 137, 1787},{ 159, 2129},{ 185, 2459}, + { 216, 2778},{ 249, 3083},{ 287, 3374},{ 335, 3653}, + { 393, 3920},{ 462, 4175},{ 549, 4414},{ 660, 4636}, + { 791, 4839},{ 952, 5014},{ 1135, 5166},{ 1337, 5297}, + { 1552, 5411},{ 1752, 5530},{ 1972, 5634},{ 2224, 5724} + } + }, + { + /*Cr qi=41 INTRA*/ + { + { 15, 7},{ 115, 389},{ 193, 770},{ 284, 1154}, + { 401, 1484},{ 528, 1761},{ 652, 2005},{ 764, 2228}, + { 882, 2427},{ 1008, 2599},{ 1167, 2734},{ 1320, 2859}, + { 1443, 2990},{ 1580, 3103},{ 1743, 3181},{ 1894, 3241}, + { 2012, 3309},{ 2141, 3385},{ 2272, 3459},{ 2398, 3519}, + { 2566, 3584},{ 2707, 3680},{ 2816, 3762},{ 2991, 3770} + }, + /*Cr qi=41 INTER*/ + { + { 92, -9},{ 98, 354},{ 90, 682},{ 107, 1052}, + { 124, 1429},{ 139, 1786},{ 156, 2132},{ 178, 2471}, + { 207, 2794},{ 241, 3100},{ 285, 3391},{ 345, 3662}, + { 417, 3915},{ 503, 4151},{ 600, 4375},{ 703, 4589}, + { 815, 4791},{ 942, 4981},{ 1088, 5155},{ 1250, 5316}, + { 1432, 5462},{ 1653, 5575},{ 1930, 5639},{ 2250, 5655} + } + } + }, + { + { + /*Y' qi=42 INTRA*/ + { + { 109, 75},{ 534, 1257},{ 1114, 2047},{ 1793, 2456}, + { 2461, 2735},{ 3157, 2994},{ 3879, 3221},{ 4595, 3396}, + { 5282, 3531},{ 5931, 3638},{ 6546, 3714},{ 7105, 3749}, + { 7633, 3766},{ 8147, 3803},{ 8652, 3865},{ 9148, 3915}, + { 9613, 3946},{10075, 3976},{10489, 3997},{10835, 3994}, + {11195, 3985},{11553, 3997},{11909, 4004},{12369, 3990} + }, + /*Y' qi=42 INTER*/ + { + { 69, -23},{ 134, 1332},{ 287, 2611},{ 521, 3730}, + { 970, 4624},{ 1827, 5176},{ 3028, 5382},{ 4262, 5389}, + { 5325, 5338},{ 6214, 5291},{ 6976, 5255},{ 7651, 5228}, + { 8260, 5206},{ 8821, 5190},{ 9343, 5177},{ 9823, 5165}, + {10273, 5152},{10709, 5143},{11121, 5136},{11502, 5129}, + {11857, 5125},{12193, 5115},{12520, 5107},{12802, 5097} + } + }, + { + /*Cb qi=42 INTRA*/ + { + { 9, 3},{ 113, 371},{ 199, 743},{ 279, 1123}, + { 390, 1462},{ 525, 1743},{ 662, 1986},{ 789, 2208}, + { 916, 2406},{ 1057, 2571},{ 1204, 2712},{ 1362, 2835}, + { 1524, 2943},{ 1676, 3040},{ 1815, 3145},{ 1959, 3249}, + { 2117, 3325},{ 2249, 3406},{ 2377, 3488},{ 2537, 3547}, + { 2706, 3597},{ 2854, 3646},{ 2999, 3705},{ 3236, 3759} + }, + /*Cb qi=42 INTER*/ + { + { 114, 44},{ 107, 353},{ 101, 670},{ 111, 1041}, + { 129, 1418},{ 148, 1775},{ 174, 2110},{ 208, 2432}, + { 244, 2746},{ 283, 3046},{ 330, 3330},{ 388, 3602}, + { 460, 3858},{ 546, 4101},{ 655, 4326},{ 793, 4530}, + { 966, 4703},{ 1165, 4851},{ 1388, 4980},{ 1630, 5088}, + { 1869, 5189},{ 2122, 5268},{ 2403, 5328},{ 2667, 5417} + } + }, + { + /*Cr qi=42 INTRA*/ + { + { 15, 7},{ 120, 390},{ 202, 771},{ 298, 1150}, + { 421, 1473},{ 553, 1743},{ 681, 1982},{ 796, 2199}, + { 923, 2388},{ 1062, 2547},{ 1225, 2678},{ 1392, 2792}, + { 1531, 2907},{ 1682, 3007},{ 1856, 3074},{ 2009, 3134}, + { 2138, 3192},{ 2274, 3257},{ 2407, 3333},{ 2536, 3393}, + { 2711, 3455},{ 2875, 3531},{ 3000, 3598},{ 3186, 3599} + }, + /*Cr qi=42 INTER*/ + { + { 87, -4},{ 95, 358},{ 97, 683},{ 113, 1052}, + { 131, 1423},{ 148, 1774},{ 170, 2116},{ 198, 2448}, + { 234, 2762},{ 276, 3062},{ 331, 3343},{ 404, 3603}, + { 494, 3844},{ 598, 4067},{ 715, 4276},{ 842, 4471}, + { 977, 4661},{ 1128, 4840},{ 1311, 4991},{ 1516, 5127}, + { 1759, 5233},{ 2050, 5300},{ 2377, 5323},{ 2710, 5304} + } + } + }, + { + { + /*Y' qi=43 INTRA*/ + { + { 99, 79},{ 557, 1244},{ 1175, 2016},{ 1882, 2408}, + { 2570, 2677},{ 3288, 2926},{ 4030, 3141},{ 4760, 3307}, + { 5458, 3435},{ 6115, 3537},{ 6743, 3608},{ 7312, 3636}, + { 7841, 3652},{ 8357, 3687},{ 8870, 3742},{ 9376, 3788}, + { 9850, 3821},{10315, 3853},{10734, 3873},{11084, 3870}, + {11442, 3862},{11800, 3874},{12160, 3879},{12618, 3876} + }, + /*Y' qi=43 INTER*/ + { + { 69, -22},{ 134, 1331},{ 294, 2601},{ 551, 3703}, + { 1056, 4563},{ 2003, 5061},{ 3276, 5215},{ 4534, 5194}, + { 5599, 5133},{ 6488, 5083},{ 7257, 5044},{ 7938, 5014}, + { 8556, 4992},{ 9124, 4975},{ 9648, 4960},{10138, 4948}, + {10594, 4939},{11039, 4926},{11462, 4919},{11847, 4912}, + {12216, 4904},{12570, 4896},{12883, 4889},{13189, 4879} + } + }, + { + /*Cb qi=43 INTRA*/ + { + { 9, 3},{ 114, 371},{ 202, 740},{ 294, 1110}, + { 417, 1440},{ 558, 1716},{ 700, 1956},{ 833, 2172}, + { 966, 2365},{ 1116, 2524},{ 1269, 2661},{ 1431, 2781}, + { 1599, 2885},{ 1756, 2980},{ 1902, 3082},{ 2051, 3185}, + { 2209, 3261},{ 2337, 3342},{ 2464, 3420},{ 2633, 3475}, + { 2809, 3525},{ 2948, 3579},{ 3094, 3633},{ 3347, 3678} + }, + /*Cb qi=43 INTER*/ + { + { 111, 44},{ 106, 353},{ 102, 670},{ 112, 1040}, + { 128, 1416},{ 148, 1771},{ 176, 2104},{ 211, 2424}, + { 250, 2734},{ 293, 3030},{ 347, 3309},{ 411, 3575}, + { 490, 3828},{ 589, 4064},{ 716, 4278},{ 869, 4472}, + { 1050, 4640},{ 1264, 4781},{ 1512, 4895},{ 1775, 4991}, + { 2042, 5069},{ 2310, 5141},{ 2593, 5207},{ 2912, 5239} + } + }, + { + /*Cr qi=43 INTRA*/ + { + { 15, 7},{ 121, 390},{ 208, 767},{ 315, 1135}, + { 449, 1449},{ 586, 1715},{ 718, 1950},{ 843, 2158}, + { 977, 2342},{ 1120, 2501},{ 1290, 2632},{ 1466, 2739}, + { 1613, 2845},{ 1763, 2945},{ 1937, 3015},{ 2093, 3070}, + { 2225, 3126},{ 2366, 3194},{ 2501, 3267},{ 2634, 3324}, + { 2815, 3385},{ 2964, 3466},{ 3087, 3538},{ 3263, 3555} + }, + /*Cr qi=43 INTER*/ + { + { 84, -4},{ 93, 358},{ 95, 683},{ 113, 1052}, + { 131, 1421},{ 148, 1770},{ 171, 2110},{ 201, 2439}, + { 240, 2750},{ 287, 3046},{ 348, 3322},{ 429, 3576}, + { 527, 3811},{ 641, 4029},{ 767, 4230},{ 904, 4422}, + { 1053, 4603},{ 1225, 4765},{ 1433, 4903},{ 1661, 5030}, + { 1928, 5121},{ 2252, 5160},{ 2604, 5164},{ 2979, 5125} + } + } + }, + { + { + /*Y' qi=44 INTRA*/ + { + { 103, 80},{ 560, 1244},{ 1183, 2009},{ 1891, 2391}, + { 2586, 2649},{ 3324, 2884},{ 4093, 3089},{ 4850, 3243}, + { 5575, 3358},{ 6252, 3452},{ 6886, 3518},{ 7459, 3546}, + { 7993, 3562},{ 8515, 3594},{ 9030, 3645},{ 9534, 3691}, + {10004, 3723},{10469, 3750},{10887, 3765},{11236, 3766}, + {11596, 3762},{11960, 3775},{12317, 3784},{12766, 3789} + }, + /*Y' qi=44 INTER*/ + { + { 77, -24},{ 145, 1332},{ 332, 2580},{ 642, 3649}, + { 1270, 4438},{ 2360, 4860},{ 3685, 4982},{ 4910, 4966}, + { 5929, 4928},{ 6785, 4900},{ 7529, 4880},{ 8198, 4863}, + { 8804, 4850},{ 9361, 4842},{ 9882, 4836},{10371, 4830}, + {10827, 4822},{11262, 4816},{11672, 4811},{12052, 4807}, + {12431, 4806},{12780, 4798},{13095, 4792},{13401, 4791} + } + }, + { + /*Cb qi=44 INTRA*/ + { + { 9, 2},{ 122, 371},{ 214, 741},{ 307, 1109}, + { 433, 1432},{ 576, 1704},{ 718, 1939},{ 855, 2152}, + { 991, 2340},{ 1141, 2497},{ 1298, 2632},{ 1463, 2749}, + { 1636, 2851},{ 1796, 2944},{ 1947, 3041},{ 2101, 3140}, + { 2260, 3219},{ 2392, 3297},{ 2527, 3366},{ 2693, 3424}, + { 2872, 3477},{ 3025, 3525},{ 3175, 3584},{ 3451, 3626} + }, + /*Cb qi=44 INTER*/ + { + { 111, 14},{ 110, 339},{ 109, 671},{ 120, 1040}, + { 139, 1410},{ 162, 1758},{ 197, 2084},{ 243, 2397}, + { 291, 2702},{ 342, 2992},{ 405, 3265},{ 484, 3521}, + { 584, 3760},{ 705, 3983},{ 855, 4185},{ 1048, 4356}, + { 1274, 4500},{ 1531, 4617},{ 1816, 4707},{ 2111, 4783}, + { 2409, 4846},{ 2720, 4901},{ 3044, 4957},{ 3391, 4985} + } + }, + { + /*Cr qi=44 INTRA*/ + { + { 17, 7},{ 128, 392},{ 219, 770},{ 329, 1135}, + { 465, 1442},{ 601, 1703},{ 734, 1935},{ 862, 2142}, + { 998, 2325},{ 1147, 2482},{ 1321, 2606},{ 1496, 2710}, + { 1649, 2813},{ 1809, 2908},{ 1984, 2977},{ 2143, 3032}, + { 2279, 3087},{ 2423, 3152},{ 2559, 3225},{ 2684, 3288}, + { 2866, 3351},{ 3025, 3426},{ 3161, 3492},{ 3372, 3500} + }, + /*Cr qi=44 INTER*/ + { + { 89, 0},{ 101, 352},{ 104, 683},{ 121, 1051}, + { 141, 1414},{ 163, 1757},{ 192, 2092},{ 231, 2415}, + { 278, 2720},{ 336, 3007},{ 412, 3273},{ 510, 3516}, + { 633, 3733},{ 769, 3936},{ 914, 4130},{ 1076, 4307}, + { 1256, 4472},{ 1469, 4617},{ 1723, 4732},{ 2012, 4822}, + { 2347, 4871},{ 2716, 4875},{ 3082, 4866},{ 3422, 4826} + } + } + }, + { + { + /*Y' qi=45 INTRA*/ + { + { 119, 78},{ 610, 1226},{ 1271, 1965},{ 2026, 2319}, + { 2768, 2550},{ 3556, 2757},{ 4369, 2938},{ 5157, 3076}, + { 5901, 3182},{ 6598, 3268},{ 7253, 3326},{ 7844, 3343}, + { 8392, 3356},{ 8922, 3386},{ 9453, 3433},{ 9973, 3474}, + {10457, 3503},{10929, 3530},{11351, 3543},{11709, 3541}, + {12068, 3537},{12434, 3547},{12805, 3555},{13268, 3563} + }, + /*Y' qi=45 INTER*/ + { + { 77, -20},{ 146, 1330},{ 342, 2566},{ 699, 3604}, + { 1439, 4332},{ 2669, 4672},{ 4075, 4727},{ 5318, 4679}, + { 6345, 4630},{ 7209, 4595},{ 7963, 4570},{ 8644, 4551}, + { 9262, 4535},{ 9831, 4525},{10370, 4515},{10872, 4506}, + {11334, 4500},{11783, 4492},{12219, 4489},{12617, 4483}, + {12995, 4477},{13350, 4472},{13674, 4466},{13968, 4468} + } + }, + { + /*Cb qi=45 INTRA*/ + { + { 9, 2},{ 122, 370},{ 219, 735},{ 324, 1096}, + { 465, 1414},{ 619, 1679},{ 771, 1905},{ 920, 2103}, + { 1070, 2276},{ 1236, 2419},{ 1410, 2539},{ 1595, 2644}, + { 1784, 2736},{ 1949, 2831},{ 2104, 2931},{ 2275, 3021}, + { 2443, 3092},{ 2586, 3166},{ 2735, 3234},{ 2904, 3288}, + { 3093, 3338},{ 3262, 3382},{ 3419, 3427},{ 3708, 3456} + }, + /*Cb qi=45 INTER*/ + { + { 103, 0},{ 109, 339},{ 109, 670},{ 119, 1039}, + { 137, 1408},{ 162, 1754},{ 199, 2076},{ 248, 2386}, + { 301, 2684},{ 360, 2967},{ 433, 3234},{ 525, 3481}, + { 640, 3713},{ 780, 3924},{ 956, 4110},{ 1176, 4266}, + { 1438, 4390},{ 1736, 4481},{ 2057, 4553},{ 2385, 4613}, + { 2718, 4656},{ 3056, 4698},{ 3416, 4733},{ 3799, 4755} + } + }, + { + /*Cr qi=45 INTRA*/ + { + { 16, 7},{ 128, 391},{ 225, 763},{ 350, 1120}, + { 500, 1420},{ 649, 1673},{ 792, 1893},{ 929, 2089}, + { 1084, 2257},{ 1250, 2401},{ 1440, 2518},{ 1633, 2614}, + { 1799, 2708},{ 1968, 2798},{ 2151, 2863},{ 2314, 2914}, + { 2453, 2968},{ 2611, 3025},{ 2759, 3095},{ 2887, 3160}, + { 3082, 3210},{ 3259, 3278},{ 3403, 3342},{ 3593, 3354} + }, + /*Cr qi=45 INTER*/ + { + { 92, 0},{ 101, 352},{ 103, 682},{ 120, 1049}, + { 140, 1412},{ 163, 1752},{ 193, 2083},{ 234, 2402}, + { 287, 2702},{ 353, 2983},{ 442, 3240},{ 557, 3471}, + { 694, 3680},{ 846, 3873},{ 1014, 4056},{ 1200, 4224}, + { 1414, 4369},{ 1664, 4495},{ 1946, 4595},{ 2278, 4654}, + { 2654, 4673},{ 3047, 4658},{ 3438, 4627},{ 3825, 4585} + } + } + }, + { + { + /*Y' qi=46 INTRA*/ + { + { 119, 78},{ 610, 1227},{ 1277, 1960},{ 2043, 2309}, + { 2805, 2529},{ 3618, 2719},{ 4452, 2887},{ 5257, 3016}, + { 6017, 3115},{ 6727, 3195},{ 7392, 3248},{ 7984, 3267}, + { 8528, 3281},{ 9059, 3310},{ 9593, 3354},{10119, 3395}, + {10599, 3425},{11064, 3450},{11493, 3464},{11850, 3466}, + {12207, 3462},{12578, 3471},{12948, 3480},{13407, 3487} + }, + /*Y' qi=46 INTER*/ + { + { 74, -14},{ 149, 1326},{ 382, 2538},{ 807, 3541}, + { 1670, 4211},{ 3000, 4499},{ 4416, 4533},{ 5628, 4490}, + { 6628, 4453},{ 7479, 4425},{ 8228, 4406},{ 8902, 4393}, + { 9521, 4380},{10090, 4371},{10623, 4364},{11124, 4356}, + {11586, 4351},{12043, 4344},{12476, 4341},{12863, 4340}, + {13244, 4337},{13610, 4329},{13936, 4324},{14246, 4329} + } + }, + { + /*Cb qi=46 INTRA*/ + { + { 11, 2},{ 132, 371},{ 234, 737},{ 340, 1094}, + { 481, 1405},{ 637, 1667},{ 791, 1891},{ 944, 2084}, + { 1099, 2253},{ 1268, 2392},{ 1444, 2507},{ 1633, 2610}, + { 1825, 2700},{ 1990, 2794},{ 2147, 2895},{ 2321, 2984}, + { 2493, 3053},{ 2640, 3126},{ 2787, 3198},{ 2954, 3253}, + { 3146, 3297},{ 3313, 3344},{ 3473, 3393},{ 3757, 3434} + }, + /*Cb qi=46 INTER*/ + { + { 97, 0},{ 109, 339},{ 108, 669},{ 120, 1035}, + { 142, 1398},{ 173, 1737},{ 221, 2052},{ 281, 2353}, + { 345, 2646},{ 415, 2924},{ 504, 3183},{ 616, 3421}, + { 749, 3643},{ 914, 3842},{ 1123, 4012},{ 1379, 4150}, + { 1685, 4250},{ 2014, 4327},{ 2366, 4382},{ 2731, 4426}, + { 3083, 4470},{ 3445, 4490},{ 3805, 4511},{ 4146, 4539} + } + }, + { + /*Cr qi=46 INTRA*/ + { + { 19, 7},{ 137, 393},{ 237, 765},{ 364, 1116}, + { 516, 1411},{ 665, 1662},{ 809, 1880},{ 951, 2072}, + { 1109, 2236},{ 1278, 2378},{ 1474, 2491},{ 1669, 2584}, + { 1835, 2678},{ 2014, 2766},{ 2203, 2828},{ 2366, 2880}, + { 2506, 2933},{ 2661, 2988},{ 2810, 3053},{ 2941, 3116}, + { 3131, 3175},{ 3310, 3243},{ 3461, 3303},{ 3656, 3321} + }, + /*Cr qi=46 INTER*/ + { + { 91, 1},{ 103, 351},{ 104, 681},{ 121, 1046}, + { 144, 1401},{ 173, 1736},{ 213, 2060},{ 265, 2373}, + { 330, 2666},{ 410, 2938},{ 517, 3185},{ 655, 3404}, + { 815, 3601},{ 989, 3784},{ 1183, 3951},{ 1400, 4104}, + { 1649, 4241},{ 1933, 4352},{ 2261, 4427},{ 2646, 4458}, + { 3057, 4446},{ 3453, 4418},{ 3820, 4385},{ 4171, 4352} + } + } + }, + { + { + /*Y' qi=47 INTRA*/ + { + { 117, 83},{ 670, 1205},{ 1408, 1904},{ 2239, 2219}, + { 3049, 2414},{ 3905, 2584},{ 4775, 2734},{ 5610, 2852}, + { 6393, 2944},{ 7121, 3017},{ 7804, 3066},{ 8407, 3081}, + { 8957, 3093},{ 9498, 3119},{10043, 3160},{10582, 3199}, + {11083, 3226},{11561, 3250},{11993, 3263},{12352, 3264}, + {12711, 3259},{13092, 3266},{13463, 3271},{13918, 3275} + }, + /*Y' qi=47 INTER*/ + { + { 74, -11},{ 148, 1325},{ 404, 2518},{ 910, 3478}, + { 1916, 4080},{ 3369, 4298},{ 4823, 4292},{ 6035, 4238}, + { 7037, 4197},{ 7894, 4168},{ 8650, 4146},{ 9337, 4129}, + { 9968, 4116},{10549, 4105},{11096, 4096},{11605, 4089}, + {12081, 4083},{12547, 4076},{12990, 4070},{13399, 4070}, + {13776, 4065},{14133, 4059},{14486, 4057},{14842, 4053} + } + }, + { + /*Cb qi=47 INTRA*/ + { + { 11, 2},{ 133, 370},{ 242, 731},{ 367, 1077}, + { 524, 1378},{ 692, 1630},{ 860, 1844},{ 1028, 2024}, + { 1203, 2178},{ 1393, 2305},{ 1582, 2413},{ 1787, 2507}, + { 1992, 2590},{ 2175, 2676},{ 2351, 2767},{ 2534, 2851}, + { 2707, 2923},{ 2862, 2994},{ 3021, 3060},{ 3193, 3111}, + { 3396, 3147},{ 3573, 3184},{ 3752, 3220},{ 4038, 3255} + }, + /*Cb qi=47 INTER*/ + { + { 101, 0},{ 107, 339},{ 108, 667},{ 120, 1033}, + { 142, 1394},{ 175, 1729},{ 227, 2040},{ 295, 2335}, + { 369, 2619},{ 452, 2888},{ 556, 3138},{ 686, 3368}, + { 850, 3574},{ 1050, 3758},{ 1299, 3910},{ 1605, 4024}, + { 1950, 4104},{ 2317, 4163},{ 2689, 4210},{ 3077, 4239}, + { 3466, 4258},{ 3840, 4278},{ 4205, 4298},{ 4515, 4340} + } + }, + { + /*Cr qi=47 INTRA*/ + { + { 19, 7},{ 138, 392},{ 248, 758},{ 396, 1094}, + { 563, 1378},{ 723, 1621},{ 881, 1829},{ 1037, 2011}, + { 1214, 2165},{ 1410, 2290},{ 1623, 2393},{ 1834, 2480}, + { 2016, 2564},{ 2203, 2647},{ 2405, 2707},{ 2569, 2757}, + { 2709, 2810},{ 2871, 2860},{ 3027, 2924},{ 3178, 2980}, + { 3375, 3034},{ 3563, 3097},{ 3724, 3151},{ 3952, 3153} + }, + /*Cr qi=47 INTER*/ + { + { 91, 1},{ 100, 351},{ 102, 681},{ 120, 1043}, + { 144, 1397},{ 175, 1729},{ 219, 2049},{ 277, 2356}, + { 353, 2640},{ 451, 2902},{ 579, 3136},{ 739, 3342}, + { 926, 3525},{ 1125, 3698},{ 1343, 3859},{ 1595, 3998}, + { 1881, 4113},{ 2208, 4205},{ 2589, 4253},{ 3014, 4250}, + { 3444, 4220},{ 3838, 4183},{ 4196, 4147},{ 4521, 4116} + } + } + }, + { + { + /*Y' qi=48 INTRA*/ + { + { 107, 87},{ 681, 1200},{ 1456, 1883},{ 2306, 2193}, + { 3122, 2386},{ 3984, 2548},{ 4862, 2693},{ 5704, 2808}, + { 6495, 2899},{ 7232, 2970},{ 7915, 3018},{ 8524, 3034}, + { 9085, 3043},{ 9635, 3068},{10192, 3108},{10735, 3145}, + {11237, 3171},{11719, 3194},{12153, 3207},{12516, 3206}, + {12888, 3202},{13266, 3210},{13637, 3218},{14101, 3219} + }, + /*Y' qi=48 INTER*/ + { + { 83, -18},{ 147, 1328},{ 398, 2519},{ 923, 3468}, + { 1979, 4047},{ 3472, 4246},{ 4936, 4232},{ 6148, 4178}, + { 7150, 4139},{ 8007, 4111},{ 8765, 4091},{ 9458, 4076}, + {10090, 4063},{10676, 4054},{11226, 4045},{11742, 4038}, + {12223, 4033},{12686, 4029},{13127, 4022},{13527, 4015}, + {13915, 4012},{14277, 4007},{14619, 4004},{14966, 4001} + } + }, + { + /*Cb qi=48 INTRA*/ + { + { 11, 2},{ 134, 369},{ 245, 730},{ 373, 1075}, + { 531, 1374},{ 698, 1625},{ 865, 1839},{ 1033, 2019}, + { 1207, 2173},{ 1397, 2300},{ 1588, 2408},{ 1795, 2501}, + { 2003, 2581},{ 2187, 2666},{ 2362, 2757},{ 2548, 2841}, + { 2719, 2912},{ 2876, 2983},{ 3034, 3047},{ 3209, 3097}, + { 3409, 3137},{ 3589, 3178},{ 3762, 3216},{ 4004, 3252} + }, + /*Cb qi=48 INTER*/ + { + { 113, 26},{ 112, 344},{ 111, 668},{ 120, 1032}, + { 141, 1392},{ 173, 1727},{ 224, 2036},{ 290, 2330}, + { 363, 2612},{ 447, 2880},{ 551, 3130},{ 685, 3358}, + { 852, 3563},{ 1061, 3742},{ 1332, 3884},{ 1654, 3993}, + { 2011, 4068},{ 2394, 4120},{ 2782, 4160},{ 3172, 4186}, + { 3557, 4209},{ 3932, 4228},{ 4306, 4237},{ 4675, 4236} + } + }, + { + /*Cr qi=48 INTRA*/ + { + { 18, 7},{ 139, 389},{ 252, 755},{ 404, 1090}, + { 573, 1372},{ 732, 1615},{ 889, 1823},{ 1045, 2005}, + { 1222, 2159},{ 1417, 2285},{ 1631, 2387},{ 1843, 2474}, + { 2027, 2558},{ 2212, 2639},{ 2413, 2697},{ 2578, 2746}, + { 2720, 2798},{ 2887, 2852},{ 3040, 2913},{ 3181, 2970}, + { 3381, 3024},{ 3581, 3081},{ 3743, 3130},{ 3948, 3133} + }, + /*Cr qi=48 INTER*/ + { + { 89, 0},{ 106, 352},{ 105, 682},{ 120, 1044}, + { 144, 1395},{ 174, 1724},{ 215, 2044},{ 270, 2350}, + { 343, 2635},{ 441, 2895},{ 571, 3129},{ 735, 3334}, + { 926, 3518},{ 1139, 3684},{ 1371, 3836},{ 1628, 3977}, + { 1933, 4089},{ 2279, 4164},{ 2672, 4204},{ 3105, 4205}, + { 3533, 4176},{ 3931, 4135},{ 4290, 4089},{ 4624, 4057} + } + } + }, + { + { + /*Y' qi=49 INTRA*/ + { + { 120, 85},{ 706, 1194},{ 1485, 1875},{ 2348, 2187}, + { 3190, 2372},{ 4076, 2521},{ 4967, 2658},{ 5819, 2771}, + { 6611, 2861},{ 7345, 2936},{ 8026, 2990},{ 8626, 3013}, + { 9182, 3030},{ 9723, 3059},{10266, 3100},{10802, 3143}, + {11293, 3179},{11768, 3206},{12201, 3221},{12556, 3225}, + {12914, 3226},{13281, 3237},{13639, 3247},{14089, 3257} + }, + /*Y' qi=49 INTER*/ + { + { 72, -11},{ 155, 1320},{ 458, 2485},{ 1090, 3386}, + { 2284, 3907},{ 3835, 4075},{ 5272, 4064},{ 6449, 4026}, + { 7426, 4003},{ 8267, 3987},{ 9017, 3976},{ 9698, 3967}, + {10328, 3962},{10913, 3959},{11452, 3954},{11961, 3950}, + {12442, 3947},{12904, 3946},{13347, 3945},{13749, 3943}, + {14123, 3941},{14490, 3941},{14826, 3939},{15153, 3937} + } + }, + { + /*Cb qi=49 INTRA*/ + { + { 11, 2},{ 145, 369},{ 262, 729},{ 393, 1070}, + { 557, 1363},{ 731, 1607},{ 907, 1811},{ 1085, 1983}, + { 1268, 2130},{ 1465, 2251},{ 1658, 2359},{ 1868, 2454}, + { 2079, 2534},{ 2264, 2621},{ 2440, 2717},{ 2625, 2802}, + { 2792, 2878},{ 2945, 2954},{ 3106, 3021},{ 3277, 3075}, + { 3466, 3119},{ 3638, 3170},{ 3824, 3213},{ 4100, 3243} + }, + /*Cb qi=49 INTER*/ + { + { 98, -6},{ 113, 343},{ 110, 669},{ 122, 1029}, + { 149, 1380},{ 192, 1706},{ 258, 2007},{ 340, 2293}, + { 426, 2569},{ 525, 2831},{ 653, 3071},{ 814, 3287}, + { 1013, 3478},{ 1262, 3637},{ 1575, 3761},{ 1936, 3851}, + { 2328, 3910},{ 2741, 3949},{ 3163, 3970},{ 3559, 3994}, + { 3936, 4025},{ 4300, 4050},{ 4655, 4060},{ 4962, 4062} + } + }, + { + /*Cr qi=49 INTRA*/ + { + { 19, 7},{ 151, 389},{ 270, 753},{ 427, 1084}, + { 602, 1360},{ 767, 1595},{ 933, 1794},{ 1098, 1968}, + { 1285, 2115},{ 1489, 2237},{ 1699, 2342},{ 1912, 2435}, + { 2101, 2519},{ 2288, 2601},{ 2486, 2663},{ 2651, 2715}, + { 2799, 2769},{ 2958, 2825},{ 3106, 2890},{ 3257, 2948}, + { 3452, 3007},{ 3634, 3075},{ 3786, 3136},{ 3959, 3164} + }, + /*Cr qi=49 INTER*/ + { + { 85, 1},{ 103, 352},{ 104, 681},{ 121, 1039}, + { 152, 1382},{ 195, 1702},{ 248, 2015},{ 316, 2316}, + { 403, 2595},{ 520, 2847},{ 676, 3068},{ 870, 3258}, + { 1091, 3429},{ 1329, 3585},{ 1597, 3725},{ 1894, 3849}, + { 2242, 3940},{ 2656, 3984},{ 3098, 3992},{ 3531, 3981}, + { 3936, 3950},{ 4304, 3915},{ 4646, 3879},{ 4915, 3861} + } + } + }, + { + { + /*Y' qi=50 INTRA*/ + { + { 122, 89},{ 798, 1170},{ 1682, 1812},{ 2613, 2096}, + { 3501, 2260},{ 4430, 2388},{ 5352, 2510},{ 6228, 2613}, + { 7043, 2698},{ 7793, 2770},{ 8486, 2823},{ 9092, 2846}, + { 9652, 2865},{10210, 2895},{10773, 2936},{11315, 2979}, + {11817, 3014},{12297, 3041},{12734, 3057},{13097, 3064}, + {13443, 3067},{13813, 3078},{14190, 3088},{14646, 3103} + }, + /*Y' qi=50 INTER*/ + { + { 73, -11},{ 154, 1318},{ 501, 2457},{ 1281, 3291}, + { 2685, 3719},{ 4356, 3810},{ 5811, 3769},{ 6988, 3726}, + { 7976, 3700},{ 8835, 3682},{ 9606, 3669},{10307, 3659}, + {10953, 3652},{11556, 3645},{12115, 3643},{12641, 3640}, + {13138, 3636},{13613, 3634},{14068, 3629},{14488, 3627}, + {14876, 3625},{15237, 3621},{15585, 3623},{15922, 3629} + } + }, + { + /*Cb qi=50 INTRA*/ + { + { 11, 2},{ 148, 368},{ 278, 724},{ 431, 1052}, + { 613, 1334},{ 806, 1567},{ 1004, 1756},{ 1203, 1915}, + { 1405, 2051},{ 1621, 2163},{ 1833, 2262},{ 2059, 2347}, + { 2280, 2424},{ 2476, 2512},{ 2670, 2598},{ 2864, 2679}, + { 3037, 2754},{ 3201, 2826},{ 3376, 2887},{ 3562, 2936}, + { 3756, 2976},{ 3932, 3022},{ 4117, 3065},{ 4385, 3094} + }, + /*Cb qi=50 INTER*/ + { + { 92, -3},{ 112, 343},{ 109, 669},{ 121, 1027}, + { 149, 1375},{ 196, 1697},{ 270, 1992},{ 366, 2267}, + { 471, 2532},{ 594, 2782},{ 747, 3011},{ 942, 3212}, + { 1189, 3384},{ 1497, 3521},{ 1875, 3613},{ 2297, 3673}, + { 2739, 3710},{ 3195, 3725},{ 3644, 3737},{ 4057, 3751}, + { 4445, 3763},{ 4841, 3769},{ 5211, 3779},{ 5568, 3769} + } + }, + { + /*Cr qi=50 INTRA*/ + { + { 19, 7},{ 155, 388},{ 290, 744},{ 474, 1060}, + { 666, 1324},{ 847, 1549},{ 1033, 1737},{ 1219, 1898}, + { 1428, 2034},{ 1653, 2147},{ 1885, 2245},{ 2115, 2329}, + { 2316, 2410},{ 2517, 2486},{ 2730, 2539},{ 2901, 2586}, + { 3042, 2638},{ 3199, 2693},{ 3366, 2755},{ 3534, 2805}, + { 3738, 2858},{ 3934, 2916},{ 4079, 2975},{ 4257, 2992} + }, + /*Cr qi=50 INTER*/ + { + { 87, 1},{ 102, 353},{ 103, 680},{ 121, 1036}, + { 153, 1377},{ 199, 1694},{ 260, 1999},{ 339, 2291}, + { 446, 2559},{ 590, 2797},{ 780, 3003},{ 1010, 3176}, + { 1267, 3331},{ 1547, 3474},{ 1874, 3594},{ 2245, 3688}, + { 2666, 3742},{ 3130, 3758},{ 3594, 3748},{ 4028, 3711}, + { 4415, 3674},{ 4771, 3641},{ 5122, 3605},{ 5482, 3569} + } + } + }, + { + { + /*Y' qi=51 INTRA*/ + { + { 115, 93},{ 819, 1164},{ 1739, 1806},{ 2695, 2101}, + { 3612, 2257},{ 4552, 2374},{ 5479, 2490},{ 6352, 2593}, + { 7158, 2683},{ 7898, 2761},{ 8580, 2823},{ 9177, 2854}, + { 9728, 2880},{10268, 2917},{10816, 2966},{11350, 3016}, + {11834, 3058},{12311, 3089},{12741, 3109},{13092, 3119}, + {13434, 3126},{13791, 3142},{14156, 3155},{14590, 3171} + }, + /*Y' qi=51 INTER*/ + { + { 58, 0},{ 171, 1307},{ 610, 2407},{ 1563, 3175}, + { 3116, 3545},{ 4789, 3624},{ 6185, 3602},{ 7320, 3583}, + { 8282, 3574},{ 9124, 3569},{ 9878, 3567},{10569, 3565}, + {11207, 3563},{11801, 3564},{12359, 3566},{12884, 3567}, + {13373, 3568},{13841, 3567},{14289, 3566},{14699, 3568}, + {15086, 3568},{15446, 3566},{15788, 3564},{16103, 3568} + } + }, + { + /*Cb qi=51 INTRA*/ + { + { 14, 3},{ 161, 369},{ 297, 722},{ 454, 1047}, + { 639, 1325},{ 833, 1554},{ 1033, 1742},{ 1236, 1897}, + { 1440, 2032},{ 1653, 2148},{ 1860, 2253},{ 2077, 2347}, + { 2288, 2432},{ 2476, 2525},{ 2661, 2621},{ 2841, 2714}, + { 3010, 2797},{ 3170, 2876},{ 3333, 2945},{ 3510, 3000}, + { 3696, 3054},{ 3865, 3114},{ 4046, 3164},{ 4317, 3200} + }, + /*Cb qi=51 INTER*/ + { + { 88, -11},{ 109, 341},{ 109, 668},{ 126, 1019}, + { 168, 1358},{ 233, 1670},{ 329, 1955},{ 451, 2219}, + { 584, 2472},{ 736, 2711},{ 931, 2923},{ 1179, 3104}, + { 1480, 3254},{ 1846, 3368},{ 2265, 3448},{ 2714, 3501}, + { 3180, 3524},{ 3638, 3529},{ 4074, 3543},{ 4485, 3560}, + { 4868, 3571},{ 5238, 3581},{ 5597, 3594},{ 5953, 3591} + } + }, + { + /*Cr qi=51 INTRA*/ + { + { 24, 7},{ 168, 388},{ 309, 742},{ 496, 1054}, + { 688, 1316},{ 873, 1538},{ 1063, 1723},{ 1252, 1882}, + { 1460, 2018},{ 1682, 2134},{ 1907, 2238},{ 2125, 2332}, + { 2317, 2422},{ 2507, 2510},{ 2705, 2575},{ 2869, 2630}, + { 3015, 2684},{ 3178, 2744},{ 3329, 2815},{ 3477, 2878}, + { 3667, 2945},{ 3848, 3016},{ 3997, 3082},{ 4174, 3121} + }, + /*Cr qi=51 INTER*/ + { + { 83, -2},{ 102, 351},{ 102, 680},{ 126, 1029}, + { 172, 1359},{ 238, 1665},{ 321, 1962},{ 422, 2246}, + { 552, 2505},{ 733, 2728},{ 970, 2912},{ 1247, 3069}, + { 1552, 3209},{ 1876, 3338},{ 2251, 3440},{ 2692, 3502}, + { 3161, 3529},{ 3637, 3525},{ 4084, 3509},{ 4487, 3479}, + { 4850, 3444},{ 5181, 3419},{ 5507, 3406},{ 5786, 3398} + } + } + }, + { + { + /*Y' qi=52 INTRA*/ + { + { 117, 93},{ 814, 1168},{ 1729, 1822},{ 2706, 2119}, + { 3655, 2262},{ 4604, 2374},{ 5528, 2490},{ 6394, 2596}, + { 7189, 2691},{ 7921, 2777},{ 8596, 2846},{ 9184, 2885}, + { 9728, 2918},{10260, 2961},{10796, 3014},{11316, 3069}, + {11793, 3115},{12267, 3150},{12692, 3172},{13037, 3185}, + {13367, 3196},{13717, 3214},{14087, 3227},{14521, 3249} + }, + /*Y' qi=52 INTER*/ + { + { 52, 0},{ 169, 1308},{ 668, 2382},{ 1735, 3112}, + { 3384, 3451},{ 5077, 3519},{ 6461, 3506},{ 7587, 3496}, + { 8545, 3494},{ 9384, 3494},{10142, 3498},{10838, 3501}, + {11475, 3503},{12078, 3508},{12640, 3511},{13162, 3513}, + {13654, 3517},{14130, 3521},{14576, 3522},{14980, 3523}, + {15369, 3523},{15737, 3522},{16071, 3521},{16382, 3516} + } + }, + { + /*Cb qi=52 INTRA*/ + { + { 14, 3},{ 163, 369},{ 299, 722},{ 457, 1044}, + { 645, 1319},{ 843, 1545},{ 1050, 1728},{ 1261, 1879}, + { 1468, 2013},{ 1678, 2132},{ 1883, 2240},{ 2093, 2338}, + { 2301, 2428},{ 2488, 2523},{ 2667, 2619},{ 2843, 2718}, + { 3010, 2805},{ 3163, 2887},{ 3323, 2963},{ 3490, 3028}, + { 3665, 3087},{ 3841, 3145},{ 4011, 3197},{ 4289, 3230} + }, + /*Cb qi=52 INTER*/ + { + { 98, -7},{ 109, 342},{ 109, 668},{ 126, 1018}, + { 170, 1355},{ 242, 1663},{ 352, 1941},{ 490, 2195}, + { 642, 2439},{ 823, 2666},{ 1052, 2868},{ 1333, 3039}, + { 1670, 3178},{ 2074, 3280},{ 2524, 3348},{ 2996, 3390}, + { 3469, 3410},{ 3923, 3420},{ 4355, 3434},{ 4771, 3451}, + { 5166, 3468},{ 5532, 3483},{ 5885, 3499},{ 6263, 3501} + } + }, + { + /*Cr qi=52 INTRA*/ + { + { 25, 7},{ 170, 388},{ 312, 741},{ 500, 1051}, + { 694, 1310},{ 883, 1529},{ 1082, 1709},{ 1280, 1864}, + { 1491, 1998},{ 1710, 2117},{ 1932, 2225},{ 2143, 2324}, + { 2328, 2418},{ 2516, 2506},{ 2708, 2578},{ 2870, 2637}, + { 3017, 2693},{ 3170, 2758},{ 3312, 2835},{ 3455, 2901}, + { 3644, 2972},{ 3827, 3049},{ 3968, 3121},{ 4115, 3166} + }, + /*Cr qi=52 INTER*/ + { + { 86, -2},{ 101, 352},{ 100, 680},{ 126, 1028}, + { 175, 1356},{ 247, 1657},{ 341, 1948},{ 458, 2224}, + { 615, 2471},{ 828, 2681},{ 1091, 2857},{ 1395, 3008}, + { 1732, 3140},{ 2095, 3257},{ 2502, 3348},{ 2968, 3402}, + { 3457, 3420},{ 3926, 3413},{ 4360, 3388},{ 4759, 3357}, + { 5128, 3329},{ 5449, 3306},{ 5741, 3295},{ 6071, 3296} + } + } + }, + { + { + /*Y' qi=53 INTRA*/ + { + { 138, 93},{ 850, 1161},{ 1773, 1810},{ 2763, 2103}, + { 3722, 2245},{ 4675, 2360},{ 5600, 2483},{ 6464, 2597}, + { 7255, 2700},{ 7982, 2792},{ 8652, 2867},{ 9237, 2913}, + { 9775, 2950},{10302, 2998},{10834, 3058},{11347, 3121}, + {11826, 3169},{12299, 3207},{12713, 3235},{13054, 3250}, + {13387, 3265},{13744, 3286},{14110, 3302},{14515, 3323} + }, + /*Y' qi=53 INTER*/ + { + { 52, 2},{ 169, 1308},{ 680, 2377},{ 1763, 3103}, + { 3410, 3450},{ 5094, 3531},{ 6469, 3526},{ 7590, 3525}, + { 8547, 3530},{ 9385, 3534},{10139, 3540},{10835, 3548}, + {11479, 3553},{12075, 3559},{12634, 3565},{13159, 3570}, + {13650, 3573},{14124, 3576},{14575, 3580},{14993, 3583}, + {15375, 3584},{15744, 3584},{16091, 3583},{16421, 3586} + } + }, + { + /*Cb qi=53 INTRA*/ + { + { 14, 3},{ 167, 367},{ 317, 717},{ 492, 1033}, + { 687, 1306},{ 887, 1531},{ 1095, 1715},{ 1309, 1866}, + { 1517, 2000},{ 1729, 2119},{ 1932, 2227},{ 2146, 2325}, + { 2358, 2414},{ 2544, 2511},{ 2724, 2611},{ 2902, 2711}, + { 3070, 2800},{ 3227, 2878},{ 3381, 2954},{ 3548, 3021}, + { 3724, 3077},{ 3888, 3140},{ 4065, 3196},{ 4359, 3225} + }, + /*Cb qi=53 INTER*/ + { + { 93, -8},{ 110, 342},{ 108, 668},{ 125, 1018}, + { 170, 1355},{ 242, 1663},{ 353, 1939},{ 494, 2192}, + { 651, 2433},{ 838, 2658},{ 1076, 2856},{ 1368, 3022}, + { 1716, 3158},{ 2123, 3260},{ 2575, 3330},{ 3042, 3373}, + { 3507, 3396},{ 3962, 3413},{ 4394, 3430},{ 4797, 3452}, + { 5169, 3476},{ 5547, 3496},{ 5914, 3510},{ 6235, 3525} + } + }, + { + /*Cr qi=53 INTRA*/ + { + { 25, 7},{ 175, 386},{ 335, 734},{ 541, 1037}, + { 737, 1296},{ 926, 1516},{ 1125, 1696},{ 1324, 1851}, + { 1540, 1984},{ 1763, 2102},{ 1989, 2210},{ 2202, 2310}, + { 2386, 2404},{ 2572, 2495},{ 2768, 2569},{ 2929, 2627}, + { 3071, 2684},{ 3231, 2749},{ 3374, 2825},{ 3514, 2894}, + { 3703, 2963},{ 3882, 3040},{ 4024, 3111},{ 4190, 3150} + }, + /*Cr qi=53 INTER*/ + { + { 87, -1},{ 99, 352},{ 100, 680},{ 125, 1027}, + { 175, 1355},{ 249, 1657},{ 343, 1946},{ 462, 2220}, + { 624, 2465},{ 844, 2671},{ 1122, 2841},{ 1435, 2989}, + { 1768, 3125},{ 2134, 3243},{ 2545, 3334},{ 3002, 3393}, + { 3490, 3412},{ 3965, 3405},{ 4401, 3384},{ 4797, 3359}, + { 5156, 3328},{ 5482, 3297},{ 5800, 3292},{ 6135, 3293} + } + } + }, + { + { + /*Y' qi=54 INTRA*/ + { + { 184, 94},{ 902, 1151},{ 1876, 1776},{ 2881, 2057}, + { 3832, 2200},{ 4785, 2315},{ 5709, 2442},{ 6570, 2562}, + { 7362, 2672},{ 8092, 2771},{ 8760, 2852},{ 9337, 2901}, + { 9874, 2943},{10402, 2995},{10928, 3059},{11443, 3126}, + {11926, 3178},{12396, 3220},{12805, 3251},{13139, 3266}, + {13466, 3280},{13822, 3304},{14184, 3322},{14585, 3342} + }, + /*Y' qi=54 INTER*/ + { + { 60, 5},{ 169, 1308},{ 683, 2375},{ 1791, 3090}, + { 3478, 3412},{ 5184, 3470},{ 6568, 3455},{ 7697, 3446}, + { 8659, 3446},{ 9503, 3447},{10266, 3450},{10971, 3454}, + {11619, 3458},{12223, 3462},{12789, 3467},{13315, 3471}, + {13811, 3475},{14291, 3479},{14743, 3479},{15148, 3481}, + {15535, 3483},{15913, 3481},{16252, 3479},{16569, 3472} + } + }, + { + /*Cb qi=54 INTRA*/ + { + { 13, 2},{ 165, 367},{ 318, 715},{ 498, 1030}, + { 698, 1301},{ 906, 1523},{ 1121, 1703},{ 1336, 1853}, + { 1549, 1984},{ 1765, 2100},{ 1974, 2207},{ 2192, 2306}, + { 2402, 2396},{ 2587, 2493},{ 2773, 2591},{ 2953, 2691}, + { 3119, 2778},{ 3277, 2858},{ 3430, 2940},{ 3603, 3004}, + { 3788, 3059},{ 3950, 3121},{ 4128, 3173},{ 4398, 3215} + }, + /*Cb qi=54 INTER*/ + { + { 100, -3},{ 109, 343},{ 107, 668},{ 125, 1018}, + { 169, 1354},{ 241, 1662},{ 353, 1938},{ 496, 2190}, + { 655, 2431},{ 843, 2655},{ 1082, 2851},{ 1381, 3015}, + { 1739, 3146},{ 2154, 3243},{ 2610, 3310},{ 3094, 3344}, + { 3581, 3358},{ 4034, 3371},{ 4457, 3384},{ 4867, 3399}, + { 5255, 3413},{ 5630, 3425},{ 6003, 3440},{ 6346, 3440} + } + }, + { + /*Cr qi=54 INTRA*/ + { + { 23, 7},{ 174, 386},{ 338, 732},{ 549, 1034}, + { 751, 1289},{ 947, 1506},{ 1150, 1685},{ 1353, 1837}, + { 1572, 1969},{ 1800, 2087},{ 2031, 2192},{ 2248, 2291}, + { 2434, 2387},{ 2622, 2477},{ 2815, 2549},{ 2976, 2607}, + { 3126, 2663},{ 3286, 2727},{ 3427, 2807},{ 3569, 2877}, + { 3761, 2941},{ 3942, 3016},{ 4084, 3093},{ 4226, 3131} + }, + /*Cr qi=54 INTER*/ + { + { 88, -2},{ 99, 351},{ 100, 680},{ 125, 1027}, + { 175, 1354},{ 248, 1656},{ 343, 1945},{ 463, 2219}, + { 626, 2463},{ 850, 2668},{ 1128, 2837},{ 1445, 2983}, + { 1791, 3111},{ 2168, 3224},{ 2597, 3309},{ 3075, 3351}, + { 3560, 3364},{ 4029, 3356},{ 4464, 3335},{ 4858, 3307}, + { 5218, 3275},{ 5547, 3256},{ 5850, 3247},{ 6171, 3214} + } + } + }, + { + { + /*Y' qi=55 INTRA*/ + { + { 178, 95},{ 968, 1137},{ 2000, 1747},{ 3013, 2027}, + { 3966, 2173},{ 4920, 2294},{ 5842, 2427},{ 6702, 2553}, + { 7489, 2668},{ 8213, 2773},{ 8875, 2858},{ 9452, 2913}, + { 9986, 2959},{10504, 3016},{11023, 3085},{11530, 3157}, + {12011, 3213},{12480, 3257},{12882, 3291},{13214, 3310}, + {13542, 3325},{13890, 3350},{14248, 3371},{14671, 3398} + }, + /*Y' qi=55 INTER*/ + { + { 59, 5},{ 170, 1307},{ 725, 2358},{ 1886, 3058}, + { 3589, 3385},{ 5284, 3459},{ 6654, 3458},{ 7771, 3461}, + { 8727, 3470},{ 9564, 3478},{10322, 3488},{11019, 3497}, + {11658, 3505},{12258, 3513},{12819, 3520},{13344, 3527}, + {13840, 3533},{14314, 3537},{14755, 3541},{15161, 3544}, + {15552, 3548},{15916, 3548},{16257, 3548},{16576, 3540} + } + }, + { + /*Cb qi=55 INTRA*/ + { + { 13, 2},{ 167, 366},{ 322, 714},{ 508, 1026}, + { 716, 1292},{ 930, 1511},{ 1148, 1690},{ 1366, 1839}, + { 1578, 1972},{ 1793, 2090},{ 2001, 2199},{ 2217, 2300}, + { 2427, 2393},{ 2609, 2495},{ 2784, 2600},{ 2961, 2704}, + { 3121, 2797},{ 3268, 2884},{ 3423, 2965},{ 3590, 3032}, + { 3764, 3096},{ 3926, 3165},{ 4101, 3223},{ 4405, 3258} + }, + /*Cb qi=55 INTER*/ + { + { 90, -4},{ 109, 344},{ 107, 668},{ 126, 1017}, + { 172, 1351},{ 249, 1657},{ 370, 1928},{ 527, 2174}, + { 702, 2407},{ 909, 2624},{ 1170, 2814},{ 1493, 2970}, + { 1869, 3097},{ 2292, 3192},{ 2752, 3258},{ 3232, 3295}, + { 3709, 3314},{ 4156, 3335},{ 4592, 3355},{ 5004, 3373}, + { 5377, 3389},{ 5737, 3411},{ 6092, 3432},{ 6473, 3423} + } + }, + { + /*Cr qi=55 INTRA*/ + { + { 23, 7},{ 175, 385},{ 342, 730},{ 561, 1028}, + { 771, 1279},{ 973, 1493},{ 1181, 1669},{ 1384, 1822}, + { 1602, 1956},{ 1830, 2076},{ 2057, 2184},{ 2270, 2288}, + { 2452, 2389},{ 2637, 2484},{ 2823, 2559},{ 2983, 2621}, + { 3129, 2682},{ 3280, 2753},{ 3417, 2833},{ 3554, 2904}, + { 3743, 2977},{ 3921, 3060},{ 4055, 3137},{ 4185, 3186} + }, + /*Cr qi=55 INTER*/ + { + { 85, 0},{ 99, 352},{ 100, 679},{ 126, 1025}, + { 178, 1351},{ 256, 1650},{ 359, 1935},{ 493, 2202}, + { 675, 2439},{ 921, 2636},{ 1220, 2799},{ 1552, 2941}, + { 1910, 3068},{ 2303, 3177},{ 2735, 3262},{ 3206, 3311}, + { 3689, 3333},{ 4152, 3327},{ 4588, 3299},{ 4978, 3272}, + { 5325, 3243},{ 5651, 3221},{ 5969, 3210},{ 6218, 3185} + } + } + }, + { + { + /*Y' qi=56 INTRA*/ + { + { 137, 104},{ 1048, 1128},{ 2147, 1760},{ 3261, 2029}, + { 4319, 2131},{ 5310, 2234},{ 6245, 2351},{ 7101, 2464}, + { 7886, 2572},{ 8610, 2675},{ 9270, 2762},{ 9840, 2818}, + {10365, 2869},{10875, 2928},{11393, 2997},{11900, 3071}, + {12371, 3128},{12834, 3172},{13233, 3208},{13562, 3228}, + {13878, 3245},{14221, 3271},{14584, 3292},{15008, 3320} + }, + /*Y' qi=56 INTER*/ + { + { 19, 21},{ 207, 1292},{ 1031, 2252},{ 2553, 2846}, + { 4463, 3085},{ 6137, 3131},{ 7441, 3151},{ 8526, 3172}, + { 9468, 3193},{10301, 3209},{11059, 3224},{11760, 3237}, + {12405, 3249},{13008, 3261},{13570, 3270},{14100, 3278}, + {14597, 3284},{15074, 3289},{15524, 3297},{15929, 3302}, + {16314, 3306},{16675, 3307},{17004, 3305},{17288, 3301} + } + }, + { + /*Cb qi=56 INTRA*/ + { + { 16, 3},{ 188, 367},{ 353, 712},{ 546, 1017}, + { 765, 1275},{ 989, 1484},{ 1221, 1653},{ 1459, 1791}, + { 1681, 1920},{ 1893, 2046},{ 2102, 2160},{ 2323, 2257}, + { 2534, 2347},{ 2720, 2447},{ 2902, 2549},{ 3075, 2654}, + { 3239, 2749},{ 3392, 2835},{ 3544, 2920},{ 3712, 2988}, + { 3882, 3052},{ 4052, 3123},{ 4227, 3181},{ 4483, 3213} + }, + /*Cb qi=56 INTER*/ + { + { 92, -1},{ 111, 343},{ 114, 665},{ 148, 1003}, + { 224, 1321},{ 345, 1609},{ 526, 1858},{ 754, 2077}, + { 1009, 2281},{ 1319, 2464},{ 1702, 2614},{ 2145, 2732}, + { 2625, 2824},{ 3123, 2890},{ 3634, 2933},{ 4137, 2954}, + { 4614, 2965},{ 5052, 2988},{ 5468, 3015},{ 5852, 3035}, + { 6213, 3060},{ 6557, 3081},{ 6906, 3094},{ 7243, 3112} + } + }, + { + /*Cr qi=56 INTRA*/ + { + { 28, 8},{ 195, 385},{ 373, 727},{ 598, 1019}, + { 816, 1263},{ 1033, 1465},{ 1260, 1630},{ 1482, 1773}, + { 1717, 1900},{ 1949, 2018},{ 2178, 2128},{ 2393, 2233}, + { 2570, 2338},{ 2749, 2435},{ 2937, 2514},{ 3097, 2577}, + { 3240, 2638},{ 3398, 2709},{ 3540, 2791},{ 3673, 2865}, + { 3869, 2938},{ 4049, 3019},{ 4179, 3095},{ 4330, 3137} + }, + /*Cr qi=56 INTER*/ + { + { 83, 0},{ 99, 353},{ 103, 676},{ 146, 1010}, + { 232, 1320},{ 355, 1601},{ 512, 1866},{ 713, 2109}, + { 988, 2312},{ 1344, 2471},{ 1750, 2602},{ 2180, 2719}, + { 2642, 2819},{ 3141, 2892},{ 3653, 2939},{ 4159, 2961}, + { 4636, 2961},{ 5072, 2945},{ 5464, 2917},{ 5813, 2895}, + { 6134, 2890},{ 6458, 2883},{ 6735, 2881},{ 6953, 2902} + } + } + }, + { + { + /*Y' qi=57 INTRA*/ + { + { 170, 106},{ 1106, 1120},{ 2246, 1740},{ 3399, 1993}, + { 4482, 2077},{ 5492, 2167},{ 6446, 2273},{ 7324, 2379}, + { 8130, 2482},{ 8866, 2578},{ 9537, 2661},{10119, 2715}, + {10646, 2762},{11161, 2820},{11694, 2886},{12214, 2957}, + {12693, 3013},{13166, 3053},{13569, 3087},{13897, 3106}, + {14224, 3122},{14568, 3148},{14931, 3167},{15390, 3192} + }, + /*Y' qi=57 INTER*/ + { + { 19, 20},{ 205, 1292},{ 1096, 2229},{ 2775, 2766}, + { 4811, 2943},{ 6512, 2964},{ 7832, 2976},{ 8940, 2990}, + { 9903, 3004},{10755, 3017},{11532, 3029},{12243, 3039}, + {12891, 3047},{13502, 3058},{14073, 3065},{14603, 3071}, + {15097, 3078},{15581, 3083},{16036, 3086},{16452, 3090}, + {16855, 3093},{17222, 3094},{17552, 3092},{17851, 3098} + } + }, + { + /*Cb qi=57 INTRA*/ + { + { 16, 3},{ 197, 365},{ 384, 704},{ 603, 1001}, + { 837, 1252},{ 1077, 1455},{ 1326, 1618},{ 1581, 1748}, + { 1819, 1871},{ 2042, 1993},{ 2264, 2104},{ 2500, 2196}, + { 2722, 2280},{ 2916, 2375},{ 3103, 2473},{ 3290, 2575}, + { 3456, 2667},{ 3612, 2748},{ 3775, 2829},{ 3958, 2896}, + { 4145, 2947},{ 4307, 3012},{ 4476, 3070},{ 4733, 3110} + }, + /*Cb qi=57 INTER*/ + { + { 94, -1},{ 111, 344},{ 112, 665},{ 147, 1002}, + { 227, 1319},{ 353, 1604},{ 543, 1849},{ 785, 2062}, + { 1066, 2257},{ 1408, 2430},{ 1827, 2568},{ 2320, 2670}, + { 2848, 2743},{ 3386, 2791},{ 3934, 2812},{ 4453, 2820}, + { 4929, 2830},{ 5368, 2842},{ 5787, 2856},{ 6190, 2875}, + { 6554, 2896},{ 6895, 2913},{ 7229, 2927},{ 7572, 2932} + } + }, + { + /*Cr qi=57 INTRA*/ + { + { 28, 8},{ 207, 383},{ 413, 716},{ 661, 999}, + { 889, 1237},{ 1123, 1433},{ 1365, 1592},{ 1603, 1731}, + { 1853, 1852},{ 2103, 1965},{ 2345, 2072},{ 2571, 2173}, + { 2763, 2271},{ 2949, 2364},{ 3146, 2438},{ 3315, 2497}, + { 3459, 2552},{ 3618, 2616},{ 3767, 2697},{ 3906, 2773}, + { 4099, 2841},{ 4281, 2916},{ 4429, 2987},{ 4569, 3030} + }, + /*Cr qi=57 INTER*/ + { + { 85, 0},{ 99, 352},{ 102, 675},{ 147, 1008}, + { 235, 1317},{ 363, 1597},{ 529, 1858},{ 748, 2094}, + { 1050, 2287},{ 1439, 2436},{ 1877, 2557},{ 2352, 2660}, + { 2869, 2740},{ 3413, 2791},{ 3962, 2815},{ 4485, 2819}, + { 4955, 2816},{ 5382, 2800},{ 5769, 2772},{ 6107, 2748}, + { 6443, 2740},{ 6754, 2739},{ 7029, 2737},{ 7284, 2745} + } + } + }, + { + { + /*Y' qi=58 INTRA*/ + { + { 164, 109},{ 1198, 1111},{ 2396, 1737},{ 3606, 1978}, + { 4727, 2048},{ 5749, 2138},{ 6708, 2243},{ 7584, 2347}, + { 8388, 2449},{ 9122, 2549},{ 9784, 2635},{10354, 2691}, + {10876, 2740},{11385, 2800},{11912, 2869},{12429, 2941}, + {12902, 2997},{13375, 3040},{13779, 3075},{14103, 3096}, + {14435, 3112},{14783, 3140},{15141, 3160},{15599, 3186} + }, + /*Y' qi=58 INTER*/ + { + { 14, 23},{ 210, 1290},{ 1277, 2178},{ 3118, 2677}, + { 5207, 2834},{ 6902, 2857},{ 8218, 2878},{ 9323, 2900}, + {10285, 2919},{11132, 2934},{11899, 2949},{12599, 2961}, + {13235, 2971},{13835, 2982},{14394, 2991},{14917, 2997}, + {15412, 3005},{15882, 3009},{16325, 3013},{16735, 3016}, + {17131, 3018},{17501, 3021},{17824, 3021},{18125, 3016} + } + }, + { + /*Cb qi=58 INTRA*/ + { + { 17, 3},{ 200, 365},{ 389, 703},{ 613, 996}, + { 853, 1243},{ 1095, 1445},{ 1349, 1604},{ 1613, 1731}, + { 1853, 1853},{ 2074, 1978},{ 2292, 2091},{ 2526, 2184}, + { 2750, 2266},{ 2945, 2360},{ 3134, 2458},{ 3320, 2561}, + { 3482, 2654},{ 3641, 2737},{ 3804, 2818},{ 3985, 2881}, + { 4168, 2935},{ 4331, 3003},{ 4499, 3060},{ 4751, 3100} + }, + /*Cb qi=58 INTER*/ + { + { 94, -1},{ 112, 345},{ 112, 665},{ 152, 998}, + { 247, 1307},{ 406, 1580},{ 644, 1810},{ 938, 2007}, + { 1271, 2189},{ 1668, 2348},{ 2151, 2470},{ 2691, 2558}, + { 3249, 2619},{ 3798, 2659},{ 4334, 2682},{ 4849, 2692}, + { 5314, 2700},{ 5747, 2721},{ 6167, 2742},{ 6547, 2765}, + { 6902, 2790},{ 7251, 2804},{ 7583, 2819},{ 7924, 2833} + } + }, + { + /*Cr qi=58 INTRA*/ + { + { 29, 8},{ 210, 382},{ 419, 714},{ 671, 993}, + { 903, 1229},{ 1141, 1422},{ 1390, 1578},{ 1635, 1713}, + { 1889, 1833},{ 2140, 1946},{ 2379, 2055},{ 2604, 2157}, + { 2794, 2256},{ 2977, 2349},{ 3174, 2422},{ 3339, 2482}, + { 3483, 2537},{ 3643, 2604},{ 3790, 2684},{ 3927, 2757}, + { 4112, 2826},{ 4294, 2900},{ 4451, 2975},{ 4600, 3011} + }, + /*Cr qi=58 INTER*/ + { + { 86, 0},{ 99, 352},{ 103, 675},{ 151, 1004}, + { 256, 1306},{ 417, 1573},{ 628, 1819},{ 901, 2040}, + { 1262, 2217},{ 1705, 2353},{ 2191, 2466},{ 2713, 2556}, + { 3268, 2622},{ 3831, 2664},{ 4374, 2682},{ 4881, 2686}, + { 5339, 2685},{ 5747, 2668},{ 6123, 2646},{ 6465, 2630}, + { 6783, 2618},{ 7082, 2623},{ 7366, 2632},{ 7673, 2654} + } + } + }, + { + { + /*Y' qi=59 INTRA*/ + { + { 142, 112},{ 1259, 1100},{ 2552, 1711},{ 3815, 1933}, + { 4955, 1987},{ 5983, 2068},{ 6949, 2165},{ 7832, 2263}, + { 8645, 2359},{ 9392, 2454},{10066, 2536},{10643, 2589}, + {11174, 2636},{11696, 2693},{12230, 2758},{12752, 2826}, + {13239, 2883},{13721, 2926},{14139, 2959},{14479, 2978}, + {14811, 2993},{15166, 3020},{15532, 3039},{16000, 3062} + }, + /*Y' qi=59 INTER*/ + { + { 8, 25},{ 211, 1289},{ 1394, 2144},{ 3421, 2580}, + { 5611, 2689},{ 7316, 2701},{ 8643, 2717},{ 9762, 2734}, + {10735, 2750},{11587, 2763},{12353, 2775},{13056, 2785}, + {13693, 2793},{14288, 2805},{14843, 2814},{15361, 2821}, + {15857, 2827},{16328, 2831},{16763, 2834},{17171, 2838}, + {17568, 2840},{17941, 2842},{18285, 2843},{18586, 2839} + } + }, + { + /*Cb qi=59 INTRA*/ + { + { 17, 3},{ 224, 363},{ 441, 696},{ 689, 982}, + { 945, 1222},{ 1204, 1416},{ 1474, 1571},{ 1751, 1695}, + { 2001, 1816},{ 2228, 1941},{ 2453, 2055},{ 2693, 2147}, + { 2924, 2227},{ 3125, 2321},{ 3321, 2416},{ 3510, 2520}, + { 3676, 2616},{ 3839, 2699},{ 4008, 2778},{ 4193, 2842}, + { 4371, 2898},{ 4535, 2965},{ 4710, 3023},{ 4921, 3068} + }, + /*Cb qi=59 INTER*/ + { + { 95, -5},{ 111, 343},{ 112, 664},{ 157, 995}, + { 258, 1302},{ 429, 1569},{ 691, 1790},{ 1017, 1977}, + { 1387, 2148},{ 1832, 2294},{ 2368, 2401},{ 2961, 2472}, + { 3553, 2518},{ 4133, 2545},{ 4688, 2557},{ 5198, 2563}, + { 5663, 2574},{ 6100, 2590},{ 6511, 2608},{ 6898, 2621}, + { 7274, 2634},{ 7631, 2655},{ 7984, 2669},{ 8361, 2669} + } + }, + { + /*Cr qi=59 INTRA*/ + { + { 31, 8},{ 240, 379},{ 480, 706},{ 748, 978}, + { 993, 1208},{ 1250, 1394},{ 1519, 1543},{ 1779, 1674}, + { 2047, 1792},{ 2307, 1904},{ 2552, 2013},{ 2780, 2116}, + { 2973, 2216},{ 3165, 2309},{ 3362, 2383},{ 3528, 2444}, + { 3677, 2499},{ 3841, 2566},{ 3995, 2646},{ 4139, 2720}, + { 4324, 2793},{ 4504, 2867},{ 4658, 2939},{ 4806, 2975} + }, + /*Cr qi=59 INTER*/ + { + { 89, -3},{ 98, 352},{ 103, 674},{ 156, 1002}, + { 268, 1300},{ 441, 1562},{ 673, 1801},{ 980, 2010}, + { 1385, 2175},{ 1868, 2301},{ 2401, 2402},{ 2984, 2474}, + { 3591, 2520},{ 4179, 2545},{ 4729, 2555},{ 5232, 2553}, + { 5679, 2545},{ 6081, 2530},{ 6447, 2510},{ 6791, 2496}, + { 7101, 2487},{ 7393, 2489},{ 7684, 2499},{ 7950, 2501} + } + } + }, + { + { + /*Y' qi=60 INTRA*/ + { + { 92, 116},{ 1361, 1085},{ 2746, 1686},{ 4050, 1895}, + { 5209, 1939},{ 6244, 2012},{ 7213, 2103},{ 8105, 2197}, + { 8928, 2290},{ 9685, 2381},{10371, 2460},{10952, 2511}, + {11487, 2556},{12026, 2611},{12574, 2674},{13102, 2739}, + {13597, 2793},{14092, 2831},{14523, 2862},{14862, 2881}, + {15198, 2897},{15568, 2923},{15949, 2941},{16416, 2964} + }, + /*Y' qi=60 INTER*/ + { + { 4, 30},{ 215, 1287},{ 1547, 2104},{ 3729, 2491}, + { 5973, 2568},{ 7672, 2577},{ 9001, 2591},{10123, 2606}, + {11094, 2620},{11943, 2632},{12709, 2643},{13409, 2652}, + {14044, 2660},{14641, 2669},{15193, 2677},{15709, 2684}, + {16201, 2689},{16675, 2693},{17118, 2696},{17522, 2701}, + {17920, 2704},{18293, 2706},{18620, 2702},{18923, 2700} + } + }, + { + /*Cb qi=60 INTRA*/ + { + { 18, 3},{ 227, 362},{ 447, 694},{ 708, 974}, + { 981, 1207},{ 1252, 1397},{ 1532, 1547},{ 1822, 1663}, + { 2082, 1780},{ 2316, 1903},{ 2548, 2013},{ 2794, 2101}, + { 3029, 2178},{ 3242, 2266},{ 3445, 2360},{ 3638, 2459}, + { 3816, 2547},{ 3980, 2628},{ 4146, 2708},{ 4344, 2766}, + { 4546, 2812},{ 4725, 2872},{ 4880, 2930},{ 5054, 2966} + }, + /*Cb qi=60 INTER*/ + { + { 97, -4},{ 112, 343},{ 114, 664},{ 162, 993}, + { 273, 1294},{ 472, 1553},{ 774, 1762},{ 1138, 1939}, + { 1543, 2102},{ 2034, 2236},{ 2620, 2329},{ 3244, 2389}, + { 3860, 2423},{ 4443, 2440},{ 4997, 2449},{ 5502, 2455}, + { 5962, 2458},{ 6413, 2466},{ 6836, 2485},{ 7217, 2506}, + { 7592, 2518},{ 7957, 2533},{ 8291, 2543},{ 8574, 2545} + } + }, + { + /*Cr qi=60 INTRA*/ + { + { 32, 8},{ 243, 379},{ 488, 702},{ 771, 968}, + { 1030, 1192},{ 1300, 1373},{ 1581, 1517},{ 1854, 1643}, + { 2127, 1757},{ 2393, 1864},{ 2645, 1968},{ 2879, 2068}, + { 3078, 2166},{ 3277, 2256},{ 3484, 2325},{ 3660, 2381}, + { 3808, 2433},{ 3970, 2496},{ 4138, 2571},{ 4288, 2643}, + { 4475, 2710},{ 4655, 2778},{ 4810, 2843},{ 4959, 2879} + }, + /*Cr qi=60 INTER*/ + { + { 86, -2},{ 99, 352},{ 103, 673},{ 160, 998}, + { 284, 1292},{ 484, 1546},{ 753, 1774},{ 1100, 1973}, + { 1546, 2129},{ 2072, 2246},{ 2652, 2334},{ 3279, 2392}, + { 3911, 2425},{ 4504, 2440},{ 5044, 2443},{ 5536, 2440}, + { 5979, 2430},{ 6381, 2413},{ 6735, 2397},{ 7062, 2382}, + { 7383, 2376},{ 7680, 2375},{ 7962, 2373},{ 8203, 2379} + } + } + }, + { + { + /*Y' qi=61 INTRA*/ + { + { 54, 121},{ 1477, 1069},{ 3061, 1638},{ 4465, 1808}, + { 5649, 1827},{ 6710, 1884},{ 7716, 1958},{ 8648, 2037}, + { 9514, 2116},{10311, 2192},{11033, 2261},{11641, 2305}, + {12202, 2342},{12771, 2387},{13356, 2440},{13924, 2493}, + {14444, 2541},{14951, 2576},{15409, 2600},{15779, 2615}, + {16131, 2626},{16521, 2648},{16921, 2663},{17409, 2694} + }, + /*Y' qi=61 INTER*/ + { + { -1, 32},{ 216, 1286},{ 1806, 2036},{ 4279, 2327}, + { 6629, 2352},{ 8347, 2352},{ 9707, 2357},{10860, 2364}, + {11857, 2372},{12726, 2377},{13508, 2382},{14225, 2387}, + {14877, 2392},{15484, 2398},{16048, 2401},{16581, 2405}, + {17092, 2409},{17573, 2409},{18016, 2410},{18427, 2413}, + {18829, 2415},{19221, 2415},{19578, 2415},{19980, 2413} + } + }, + { + /*Cb qi=61 INTRA*/ + { + { 19, 3},{ 231, 362},{ 456, 693},{ 733, 965}, + { 1032, 1188},{ 1330, 1369},{ 1637, 1508},{ 1956, 1612}, + { 2241, 1718},{ 2496, 1832},{ 2750, 1932},{ 3019, 2007}, + { 3274, 2074},{ 3505, 2154},{ 3725, 2236},{ 3943, 2323}, + { 4138, 2403},{ 4323, 2476},{ 4505, 2543},{ 4706, 2592}, + { 4909, 2630},{ 5109, 2675},{ 5292, 2724},{ 5495, 2768} + }, + /*Cb qi=61 INTER*/ + { + { 91, -2},{ 111, 344},{ 114, 663},{ 166, 989}, + { 291, 1285},{ 522, 1534},{ 875, 1729},{ 1302, 1889}, + { 1786, 2031},{ 2368, 2141},{ 3042, 2207},{ 3734, 2243}, + { 4388, 2259},{ 4982, 2264},{ 5533, 2265},{ 6043, 2262}, + { 6524, 2264},{ 6982, 2274},{ 7422, 2283},{ 7831, 2295}, + { 8198, 2308},{ 8593, 2319},{ 8965, 2329},{ 9258, 2340} + } + }, + { + /*Cr qi=61 INTRA*/ + { + { 33, 9},{ 245, 378},{ 497, 699},{ 801, 958}, + { 1087, 1171},{ 1384, 1342},{ 1692, 1474},{ 1992, 1589}, + { 2290, 1692},{ 2576, 1789},{ 2852, 1884},{ 3109, 1973}, + { 3324, 2061},{ 3544, 2142},{ 3763, 2199},{ 3945, 2244}, + { 4103, 2292},{ 4283, 2349},{ 4469, 2413},{ 4635, 2476}, + { 4836, 2534},{ 5038, 2592},{ 5210, 2649},{ 5358, 2682} + }, + /*Cr qi=61 INTER*/ + { + { 82, 0},{ 97, 353},{ 104, 672},{ 165, 995}, + { 303, 1284},{ 532, 1529},{ 852, 1742},{ 1273, 1921}, + { 1798, 2057},{ 2409, 2154},{ 3090, 2212},{ 3794, 2240}, + { 4460, 2251},{ 5057, 2249},{ 5596, 2249},{ 6085, 2245}, + { 6519, 2234},{ 6908, 2220},{ 7269, 2203},{ 7618, 2196}, + { 7949, 2198},{ 8269, 2195},{ 8554, 2196},{ 8928, 2217} + } + } + }, + { + { + /*Y' qi=62 INTRA*/ + { + { 29, 124},{ 1527, 1067},{ 3221, 1618},{ 4703, 1751}, + { 5909, 1744},{ 7001, 1779},{ 8057, 1829},{ 9049, 1885}, + { 9968, 1943},{10813, 1999},{11572, 2050},{12206, 2082}, + {12801, 2107},{13402, 2140},{14020, 2180},{14625, 2223}, + {15179, 2260},{15718, 2288},{16196, 2305},{16581, 2313}, + {16963, 2324},{17382, 2341},{17800, 2351},{18318, 2376} + }, + /*Y' qi=62 INTER*/ + { + { -8, 36},{ 218, 1284},{ 2073, 1965},{ 4814, 2159}, + { 7237, 2138},{ 8979, 2124},{10378, 2115},{11570, 2109}, + {12601, 2106},{13503, 2103},{14320, 2103},{15064, 2103}, + {15746, 2103},{16384, 2104},{16975, 2105},{17534, 2105}, + {18062, 2106},{18564, 2107},{19035, 2106},{19471, 2107}, + {19890, 2107},{20288, 2107},{20651, 2107},{21012, 2108} + } + }, + { + /*Cb qi=62 INTRA*/ + { + { 21, 3},{ 283, 360},{ 565, 683},{ 907, 938}, + { 1269, 1143},{ 1611, 1311},{ 1949, 1441},{ 2290, 1535}, + { 2596, 1632},{ 2877, 1738},{ 3162, 1828},{ 3458, 1893}, + { 3745, 1948},{ 4011, 2016},{ 4253, 2089},{ 4506, 2164}, + { 4734, 2233},{ 4943, 2294},{ 5162, 2353},{ 5381, 2393}, + { 5593, 2420},{ 5807, 2454},{ 6003, 2496},{ 6210, 2543} + }, + /*Cb qi=62 INTER*/ + { + { 91, -1},{ 110, 344},{ 113, 663},{ 169, 987}, + { 306, 1279},{ 562, 1519},{ 961, 1701},{ 1450, 1845}, + { 2013, 1967},{ 2686, 2053},{ 3437, 2095},{ 4171, 2109}, + { 4841, 2109},{ 5441, 2105},{ 6002, 2097},{ 6542, 2089}, + { 7028, 2087},{ 7491, 2088},{ 7949, 2090},{ 8377, 2089}, + { 8789, 2095},{ 9195, 2103},{ 9569, 2104},{ 9937, 2102} + } + }, + { + /*Cr qi=62 INTRA*/ + { + { 38, 8},{ 308, 374},{ 619, 685},{ 984, 925}, + { 1326, 1126},{ 1662, 1285},{ 1999, 1407},{ 2328, 1512}, + { 2659, 1604},{ 2976, 1691},{ 3285, 1774},{ 3570, 1853}, + { 3815, 1931},{ 4068, 1998},{ 4304, 2044},{ 4491, 2082}, + { 4666, 2124},{ 4870, 2174},{ 5078, 2231},{ 5262, 2285}, + { 5480, 2335},{ 5703, 2378},{ 5905, 2423},{ 6075, 2454} + }, + /*Cr qi=62 INTER*/ + { + { 79, 1},{ 95, 353},{ 102, 671},{ 169, 992}, + { 318, 1277},{ 569, 1515},{ 936, 1716},{ 1428, 1876}, + { 2034, 1993},{ 2738, 2067},{ 3511, 2095},{ 4268, 2094}, + { 4943, 2087},{ 5543, 2079},{ 6074, 2074},{ 6552, 2069}, + { 6985, 2057},{ 7366, 2043},{ 7728, 2030},{ 8086, 2021}, + { 8423, 2017},{ 8752, 2016},{ 9057, 2014},{ 9376, 2008} + } + } + }, + { + { + /*Y' qi=63 INTRA*/ + { + { -59, 134},{ 1734, 1036},{ 3743, 1521},{ 5309, 1618}, + { 6520, 1597},{ 7664, 1609},{ 8809, 1630},{ 9894, 1657}, + {10907, 1687},{11838, 1717},{12673, 1744},{13379, 1758}, + {14038, 1767},{14698, 1784},{15379, 1806},{16062, 1831}, + {16694, 1852},{17300, 1867},{17827, 1878},{18250, 1881}, + {18702, 1884},{19199, 1892},{19665, 1896},{20273, 1908} + }, + /*Y' qi=63 INTER*/ + { + { -7, 33},{ 209, 1285},{ 2309, 1904},{ 5274, 2025}, + { 7801, 1966},{ 9637, 1924},{11126, 1892},{12403, 1868}, + {13515, 1849},{14491, 1834},{15380, 1822},{16197, 1814}, + {16944, 1806},{17645, 1799},{18303, 1794},{18916, 1789}, + {19494, 1785},{20056, 1782},{20568, 1779},{21047, 1776}, + {21508, 1775},{21925, 1772},{22327, 1770},{22678, 1771} + } + }, + { + /*Cb qi=63 INTRA*/ + { + { 20, 3},{ 294, 357},{ 608, 673},{ 1047, 908}, + { 1501, 1090},{ 1898, 1240},{ 2275, 1353},{ 2654, 1427}, + { 3014, 1502},{ 3366, 1579},{ 3726, 1637},{ 4084, 1674}, + { 4425, 1703},{ 4752, 1743},{ 5058, 1791},{ 5377, 1838}, + { 5676, 1877},{ 5946, 1912},{ 6213, 1945},{ 6458, 1969}, + { 6704, 1982},{ 6969, 1997},{ 7210, 2017},{ 7439, 2037} + }, + /*Cb qi=63 INTER*/ + { + { 86, 1},{ 108, 345},{ 111, 663},{ 168, 985}, + { 307, 1276},{ 577, 1513},{ 1007, 1688},{ 1550, 1819}, + { 2189, 1921},{ 2938, 1981},{ 3744, 2002},{ 4512, 2002}, + { 5199, 1996},{ 5824, 1986},{ 6419, 1971},{ 6978, 1954}, + { 7507, 1940},{ 8015, 1932},{ 8502, 1928},{ 8978, 1920}, + { 9410, 1915},{ 9842, 1910},{10262, 1901},{10634, 1896} + } + }, + { + /*Cr qi=63 INTRA*/ + { + { 38, 7},{ 324, 367},{ 677, 670},{ 1136, 892}, + { 1562, 1070},{ 1951, 1209},{ 2326, 1313},{ 2694, 1399}, + { 3074, 1471},{ 3460, 1531},{ 3850, 1575},{ 4214, 1622}, + { 4522, 1679},{ 4819, 1723},{ 5089, 1749},{ 5315, 1769}, + { 5530, 1792},{ 5756, 1825},{ 6006, 1860},{ 6244, 1889}, + { 6514, 1924},{ 6792, 1946},{ 7026, 1962},{ 7191, 1971} + }, + /*Cr qi=63 INTER*/ + { + { 80, 2},{ 95, 354},{ 101, 671},{ 167, 990}, + { 321, 1274},{ 585, 1509},{ 984, 1702},{ 1534, 1849}, + { 2217, 1947},{ 3005, 1995},{ 3839, 1999},{ 4619, 1986}, + { 5310, 1973},{ 5933, 1961},{ 6486, 1952},{ 6988, 1942}, + { 7435, 1927},{ 7817, 1911},{ 8198, 1900},{ 8552, 1895}, + { 8881, 1890},{ 9253, 1883},{ 9598, 1876},{ 9923, 1859} + } + } + } +}; + +#endif diff --git a/libs/libtheora-1.1/lib/ocintrin.h b/libs/libtheora-1.1/lib/ocintrin.h new file mode 100644 index 00000000..6e42594b --- /dev/null +++ b/libs/libtheora-1.1/lib/ocintrin.h @@ -0,0 +1,128 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: ocintrin.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*Some common macros for potential platform-specific optimization.*/ +#include +#if !defined(_ocintrin_H) +# define _ocintrin_H (1) + +/*Some specific platforms may have optimized intrinsic or inline assembly + versions of these functions which can substantially improve performance. + We define macros for them to allow easy incorporation of these non-ANSI + features.*/ + +/*Note that we do not provide a macro for abs(), because it is provided as a + library function, which we assume is translated into an intrinsic to avoid + the function call overhead and then implemented in the smartest way for the + target platform. + With modern gcc (4.x), this is true: it uses cmov instructions if the + architecture supports it and branchless bit-twiddling if it does not (the + speed difference between the two approaches is not measurable). + Interestingly, the bit-twiddling method was patented in 2000 (US 6,073,150) + by Sun Microsystems, despite prior art dating back to at least 1996: + http://web.archive.org/web/19961201174141/www.x86.org/ftp/articles/pentopt/PENTOPT.TXT + On gcc 3.x, however, our assumption is not true, as abs() is translated to a + conditional jump, which is horrible on deeply piplined architectures (e.g., + all consumer architectures for the past decade or more). + Also be warned that -C*abs(x) where C is a constant is mis-optimized as + abs(C*x) on every gcc release before 4.2.3. + See bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34130 */ + +/*Modern gcc (4.x) can compile the naive versions of min and max with cmov if + given an appropriate architecture, but the branchless bit-twiddling versions + are just as fast, and do not require any special target architecture. + Earlier gcc versions (3.x) compiled both code to the same assembly + instructions, because of the way they represented ((_b)>(_a)) internally.*/ +#define OC_MAXI(_a,_b) ((_a)-((_a)-(_b)&-((_b)>(_a)))) +#define OC_MINI(_a,_b) ((_a)+((_b)-(_a)&-((_b)<(_a)))) +/*Clamps an integer into the given range. + If _a>_c, then the lower bound _a is respected over the upper bound _c (this + behavior is required to meet our documented API behavior). + _a: The lower bound. + _b: The value to clamp. + _c: The upper boud.*/ +#define OC_CLAMPI(_a,_b,_c) (OC_MAXI(_a,OC_MINI(_b,_c))) +#define OC_CLAMP255(_x) ((unsigned char)((((_x)<0)-1)&((_x)|-((_x)>255)))) +/*This has a chance of compiling branchless, and is just as fast as the + bit-twiddling method, which is slightly less portable, since it relies on a + sign-extended rightshift, which is not guaranteed by ANSI (but present on + every relevant platform).*/ +#define OC_SIGNI(_a) (((_a)>0)-((_a)<0)) +/*Slightly more portable than relying on a sign-extended right-shift (which is + not guaranteed by ANSI), and just as fast, since gcc (3.x and 4.x both) + compile it into the right-shift anyway.*/ +#define OC_SIGNMASK(_a) (-((_a)<0)) +/*Divides an integer by a power of two, truncating towards 0. + _dividend: The integer to divide. + _shift: The non-negative power of two to divide by. + _rmask: (1<<_shift)-1*/ +#define OC_DIV_POW2(_dividend,_shift,_rmask)\ + ((_dividend)+(OC_SIGNMASK(_dividend)&(_rmask))>>(_shift)) +/*Divides _x by 65536, truncating towards 0.*/ +#define OC_DIV2_16(_x) OC_DIV_POW2(_x,16,0xFFFF) +/*Divides _x by 2, truncating towards 0.*/ +#define OC_DIV2(_x) OC_DIV_POW2(_x,1,0x1) +/*Divides _x by 8, truncating towards 0.*/ +#define OC_DIV8(_x) OC_DIV_POW2(_x,3,0x7) +/*Divides _x by 16, truncating towards 0.*/ +#define OC_DIV16(_x) OC_DIV_POW2(_x,4,0xF) +/*Right shifts _dividend by _shift, adding _rval, and subtracting one for + negative dividends first. + When _rval is (1<<_shift-1), this is equivalent to division with rounding + ties away from zero.*/ +#define OC_DIV_ROUND_POW2(_dividend,_shift,_rval)\ + ((_dividend)+OC_SIGNMASK(_dividend)+(_rval)>>(_shift)) +/*Divides a _x by 2, rounding towards even numbers.*/ +#define OC_DIV2_RE(_x) ((_x)+((_x)>>1&1)>>1) +/*Divides a _x by (1<<(_shift)), rounding towards even numbers.*/ +#define OC_DIV_POW2_RE(_x,_shift) \ + ((_x)+((_x)>>(_shift)&1)+((1<<(_shift))-1>>1)>>(_shift)) +/*Swaps two integers _a and _b if _a>_b.*/ +#define OC_SORT2I(_a,_b) \ + do{ \ + int t__; \ + t__=((_a)^(_b))&-((_b)<(_a)); \ + (_a)^=t__; \ + (_b)^=t__; \ + } \ + while(0) + +/*Accesses one of four (signed) bytes given an index. + This can be used to avoid small lookup tables.*/ +#define OC_BYTE_TABLE32(_a,_b,_c,_d,_i) \ + ((signed char) \ + (((_a)&0xFF|((_b)&0xFF)<<8|((_c)&0xFF)<<16|((_d)&0xFF)<<24)>>(_i)*8)) +/*Accesses one of eight (unsigned) nibbles given an index. + This can be used to avoid small lookup tables.*/ +#define OC_UNIBBLE_TABLE32(_a,_b,_c,_d,_e,_f,_g,_h,_i) \ + ((((_a)&0xF|((_b)&0xF)<<4|((_c)&0xF)<<8|((_d)&0xF)<<12| \ + ((_e)&0xF)<<16|((_f)&0xF)<<20|((_g)&0xF)<<24|((_h)&0xF)<<28)>>(_i)*4)&0xF) + + + +/*All of these macros should expect floats as arguments.*/ +#define OC_MAXF(_a,_b) ((_a)<(_b)?(_b):(_a)) +#define OC_MINF(_a,_b) ((_a)>(_b)?(_b):(_a)) +#define OC_CLAMPF(_a,_b,_c) (OC_MINF(_a,OC_MAXF(_b,_c))) +#define OC_FABSF(_f) ((float)fabs(_f)) +#define OC_SQRTF(_f) ((float)sqrt(_f)) +#define OC_POWF(_b,_e) ((float)pow(_b,_e)) +#define OC_LOGF(_f) ((float)log(_f)) +#define OC_IFLOORF(_f) ((int)floor(_f)) +#define OC_ICEILF(_f) ((int)ceil(_f)) + +#endif diff --git a/libs/libtheora-1.1/lib/quant.c b/libs/libtheora-1.1/lib/quant.c new file mode 100644 index 00000000..5bc504e7 --- /dev/null +++ b/libs/libtheora-1.1/lib/quant.c @@ -0,0 +1,119 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: quant.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include +#include "quant.h" +#include "decint.h" + +static const unsigned OC_DC_QUANT_MIN[2]={4<<2,8<<2}; +static const unsigned OC_AC_QUANT_MIN[2]={2<<2,4<<2}; + +/*Initializes the dequantization tables from a set of quantizer info. + Currently the dequantizer (and elsewhere enquantizer) tables are expected to + be initialized as pointing to the storage reserved for them in the + oc_theora_state (resp. oc_enc_ctx) structure. + If some tables are duplicates of others, the pointers will be adjusted to + point to a single copy of the tables, but the storage for them will not be + freed. + If you're concerned about the memory footprint, the obvious thing to do is + to move the storage out of its fixed place in the structures and allocate + it on demand. + However, a much, much better option is to only store the quantization + matrices being used for the current frame, and to recalculate these as the + qi values change between frames (this is what VP3 did).*/ +void oc_dequant_tables_init(ogg_uint16_t *_dequant[64][3][2], + int _pp_dc_scale[64],const th_quant_info *_qinfo){ + /*Coding mode: intra or inter.*/ + int qti; + /*Y', C_b, C_r*/ + int pli; + for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){ + /*Quality index.*/ + int qi; + /*Range iterator.*/ + int qri; + for(qi=0,qri=0;qri<=_qinfo->qi_ranges[qti][pli].nranges;qri++){ + th_quant_base base; + ogg_uint32_t q; + int qi_start; + int qi_end; + memcpy(base,_qinfo->qi_ranges[qti][pli].base_matrices[qri], + sizeof(base)); + qi_start=qi; + if(qri==_qinfo->qi_ranges[qti][pli].nranges)qi_end=qi+1; + else qi_end=qi+_qinfo->qi_ranges[qti][pli].sizes[qri]; + /*Iterate over quality indicies in this range.*/ + for(;;){ + ogg_uint32_t qfac; + int zzi; + int ci; + /*In the original VP3.2 code, the rounding offset and the size of the + dead zone around 0 were controlled by a "sharpness" parameter. + The size of our dead zone is now controlled by the per-coefficient + quality thresholds returned by our HVS module. + We round down from a more accurate value when the quality of the + reconstruction does not fall below our threshold and it saves bits. + Hence, all of that VP3.2 code is gone from here, and the remaining + floating point code has been implemented as equivalent integer code + with exact precision.*/ + qfac=(ogg_uint32_t)_qinfo->dc_scale[qi]*base[0]; + /*For postprocessing, not dequantization.*/ + if(_pp_dc_scale!=NULL)_pp_dc_scale[qi]=(int)(qfac/160); + /*Scale DC the coefficient from the proper table.*/ + q=(qfac/100)<<2; + q=OC_CLAMPI(OC_DC_QUANT_MIN[qti],q,OC_QUANT_MAX); + _dequant[qi][pli][qti][0]=(ogg_uint16_t)q; + /*Now scale AC coefficients from the proper table.*/ + for(zzi=1;zzi<64;zzi++){ + q=((ogg_uint32_t)_qinfo->ac_scale[qi]*base[OC_FZIG_ZAG[zzi]]/100)<<2; + q=OC_CLAMPI(OC_AC_QUANT_MIN[qti],q,OC_QUANT_MAX); + _dequant[qi][pli][qti][zzi]=(ogg_uint16_t)q; + } + /*If this is a duplicate of a previous matrix, use that instead. + This simple check helps us improve cache coherency later.*/ + { + int dupe; + int qtj; + int plj; + dupe=0; + for(qtj=0;qtj<=qti;qtj++){ + for(plj=0;plj<(qtj=qi_end)break; + /*Interpolate the next base matrix.*/ + for(ci=0;ci<64;ci++){ + base[ci]=(unsigned char)( + (2*((qi_end-qi)*_qinfo->qi_ranges[qti][pli].base_matrices[qri][ci]+ + (qi-qi_start)*_qinfo->qi_ranges[qti][pli].base_matrices[qri+1][ci]) + +_qinfo->qi_ranges[qti][pli].sizes[qri])/ + (2*_qinfo->qi_ranges[qti][pli].sizes[qri])); + } + } + } + } +} diff --git a/libs/libtheora-1.1/lib/quant.h b/libs/libtheora-1.1/lib/quant.h new file mode 100644 index 00000000..d7a29ef6 --- /dev/null +++ b/libs/libtheora-1.1/lib/quant.h @@ -0,0 +1,33 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: quant.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_quant_H) +# define _quant_H (1) +# include "theora/codec.h" +# include "ocintrin.h" + +typedef ogg_uint16_t oc_quant_table[64]; + + +/*Maximum scaled quantizer value.*/ +#define OC_QUANT_MAX (1024<<2) + + +void oc_dequant_tables_init(ogg_uint16_t *_dequant[64][3][2], + int _pp_dc_scale[64],const th_quant_info *_qinfo); + +#endif diff --git a/libs/libtheora-1.1/lib/rate.c b/libs/libtheora-1.1/lib/rate.c new file mode 100644 index 00000000..c0addd39 --- /dev/null +++ b/libs/libtheora-1.1/lib/rate.c @@ -0,0 +1,1137 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: rate.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include +#include "encint.h" + +/*A rough lookup table for tan(x), 0<=x>24; + if(i>=17)i=16; + t0=OC_ROUGH_TAN_LOOKUP[i]; + t1=OC_ROUGH_TAN_LOOKUP[i+1]; + d=_alpha*36-(i<<24); + return (int)(((ogg_int64_t)t0<<32)+(t1-t0<<8)*(ogg_int64_t)d>>32); +} + +/*Re-initialize the Bessel filter coefficients with the specified delay. + This does not alter the x/y state, but changes the reaction time of the + filter. + Altering the time constant of a reactive filter without alterning internal + state is something that has to be done carefuly, but our design operates at + high enough delays and with small enough time constant changes to make it + safe.*/ +static void oc_iir_filter_reinit(oc_iir_filter *_f,int _delay){ + int alpha; + ogg_int64_t one48; + ogg_int64_t warp; + ogg_int64_t k1; + ogg_int64_t k2; + ogg_int64_t d; + ogg_int64_t a; + ogg_int64_t ik2; + ogg_int64_t b1; + ogg_int64_t b2; + /*This borrows some code from an unreleased version of Postfish. + See the recipe at http://unicorn.us.com/alex/2polefilters.html for details + on deriving the filter coefficients.*/ + /*alpha is Q24*/ + alpha=(1<<24)/_delay; + one48=(ogg_int64_t)1<<48; + /*warp is 7.12*/ + warp=OC_MAXI(oc_warp_alpha(alpha),1); + /*k1 is 9.12*/ + k1=3*warp; + /*k2 is 16.24.*/ + k2=k1*warp; + /*d is 16.15.*/ + d=((1<<12)+k1<<12)+k2+256>>9; + /*a is 0.32, since d is larger than both 1.0 and k2.*/ + a=(k2<<23)/d; + /*ik2 is 25.24.*/ + ik2=one48/k2; + /*b1 is Q56; in practice, the integer ranges between -2 and 2.*/ + b1=2*a*(ik2-(1<<24)); + /*b2 is Q56; in practice, the integer ranges between -2 and 2.*/ + b2=(one48<<8)-(4*a<<24)-b1; + /*All of the filter parameters are Q24.*/ + _f->c[0]=(ogg_int32_t)(b1+((ogg_int64_t)1<<31)>>32); + _f->c[1]=(ogg_int32_t)(b2+((ogg_int64_t)1<<31)>>32); + _f->g=(ogg_int32_t)(a+128>>8); +} + +/*Initialize a 2nd order low-pass Bessel filter with the corresponding delay + and initial value. + _value is Q24.*/ +static void oc_iir_filter_init(oc_iir_filter *_f,int _delay,ogg_int32_t _value){ + oc_iir_filter_reinit(_f,_delay); + _f->y[1]=_f->y[0]=_f->x[1]=_f->x[0]=_value; +} + +static ogg_int64_t oc_iir_filter_update(oc_iir_filter *_f,ogg_int32_t _x){ + ogg_int64_t c0; + ogg_int64_t c1; + ogg_int64_t g; + ogg_int64_t x0; + ogg_int64_t x1; + ogg_int64_t y0; + ogg_int64_t y1; + ogg_int64_t ya; + c0=_f->c[0]; + c1=_f->c[1]; + g=_f->g; + x0=_f->x[0]; + x1=_f->x[1]; + y0=_f->y[0]; + y1=_f->y[1]; + ya=(_x+x0*2+x1)*g+y0*c0+y1*c1+(1<<23)>>24; + _f->x[1]=(ogg_int32_t)x0; + _f->x[0]=_x; + _f->y[1]=(ogg_int32_t)y0; + _f->y[0]=(ogg_int32_t)ya; + return ya; +} + + + +/*Search for the quantizer that matches the target most closely. + We don't assume a linear ordering, but when there are ties we pick the + quantizer closest to the old one.*/ +static int oc_enc_find_qi_for_target(oc_enc_ctx *_enc,int _qti,int _qi_old, + int _qi_min,ogg_int64_t _log_qtarget){ + ogg_int64_t best_qdiff; + int best_qi; + int qi; + best_qi=_qi_min; + best_qdiff=_enc->log_qavg[_qti][best_qi]-_log_qtarget; + best_qdiff=best_qdiff+OC_SIGNMASK(best_qdiff)^OC_SIGNMASK(best_qdiff); + for(qi=_qi_min+1;qi<64;qi++){ + ogg_int64_t qdiff; + qdiff=_enc->log_qavg[_qti][qi]-_log_qtarget; + qdiff=qdiff+OC_SIGNMASK(qdiff)^OC_SIGNMASK(qdiff); + if(qdiffstate.qis[0]; + /*If rate control is active, use the lambda for the _target_ quantizer. + This allows us to scale to rates slightly lower than we'd normally be able + to reach, and give the rate control a semblance of "fractional qi" + precision. + TODO: Add API for changing QI, and allow extra precision.*/ + if(_enc->state.info.target_bitrate>0)lq=_enc->rc.log_qtarget; + else lq=_enc->log_qavg[_qti][qi]; + /*The resulting lambda value is less than 0x500000.*/ + _enc->lambda=(int)oc_bexp64(2*lq-0x4780BD468D6B62BLL); + /*Select additional quantizers. + The R-D optimal block AC quantizer statistics suggest that the distribution + is roughly Gaussian-like with a slight positive skew. + K-means clustering on log_qavg to select 3 quantizers produces cluster + centers of {log_qavg-0.6,log_qavg,log_qavg+0.7}. + Experiments confirm these are relatively good choices. + + Although we do greedy R-D optimization of the qii flags to avoid switching + too frequently, this becomes ineffective at low rates, either because we + do a poor job of predicting the actual R-D cost, or the greedy + optimization is not sufficient. + Therefore adaptive quantization is disabled above an (experimentally + suggested) threshold of log_qavg=7.00 (e.g., below INTRA qi=12 or + INTER qi=20 with current matrices). + This may need to be revised if the R-D cost estimation or qii flag + optimization strategies change.*/ + nqis=1; + if(lq<(OC_Q57(56)>>3)&&!_enc->vp3_compatible){ + qi1=oc_enc_find_qi_for_target(_enc,_qti,OC_MAXI(qi-1,0),0, + lq+(OC_Q57(7)+5)/10); + if(qi1!=qi)_enc->state.qis[nqis++]=qi1; + qi1=oc_enc_find_qi_for_target(_enc,_qti,OC_MINI(qi+1,63),0, + lq-(OC_Q57(6)+5)/10); + if(qi1!=qi&&qi1!=_enc->state.qis[nqis-1])_enc->state.qis[nqis++]=qi1; + } + _enc->state.nqis=nqis; +} + +/*Binary exponential of _log_scale with 24-bit fractional precision and + saturation. + _log_scale: A binary logarithm in Q24 format. + Return: The binary exponential in Q24 format, saturated to 2**47-1 if + _log_scale was too large.*/ +static ogg_int64_t oc_bexp_q24(ogg_int32_t _log_scale){ + if(_log_scale<(ogg_int32_t)23<<24){ + ogg_int64_t ret; + ret=oc_bexp64(((ogg_int64_t)_log_scale<<33)+OC_Q57(24)); + return ret<0x7FFFFFFFFFFFLL?ret:0x7FFFFFFFFFFFLL; + } + return 0x7FFFFFFFFFFFLL; +} + +/*Convenience function converts Q57 value to a clamped 32-bit Q24 value + _in: input in Q57 format. + Return: same number in Q24 */ +static ogg_int32_t oc_q57_to_q24(ogg_int64_t _in){ + ogg_int64_t ret; + ret=_in+((ogg_int64_t)1<<32)>>33; + /*0x80000000 is automatically converted to unsigned on 32-bit systems. + -0x7FFFFFFF-1 is needed to avoid "promoting" the whole expression to + unsigned.*/ + return (ogg_int32_t)OC_CLAMPI(-0x7FFFFFFF-1,ret,0x7FFFFFFF); +} + +/*Binary exponential of _log_scale with 24-bit fractional precision and + saturation. + _log_scale: A binary logarithm in Q57 format. + Return: The binary exponential in Q24 format, saturated to 2**31-1 if + _log_scale was too large.*/ +static ogg_int32_t oc_bexp64_q24(ogg_int64_t _log_scale){ + if(_log_scalerc.bits_per_frame=(_enc->state.info.target_bitrate* + (ogg_int64_t)_enc->state.info.fps_denominator)/ + _enc->state.info.fps_numerator; + /*Insane framerates or frame sizes mean insane bitrates. + Let's not get carried away.*/ + if(_enc->rc.bits_per_frame>0x400000000000LL){ + _enc->rc.bits_per_frame=(ogg_int64_t)0x400000000000LL; + } + else if(_enc->rc.bits_per_frame<32)_enc->rc.bits_per_frame=32; + _enc->rc.buf_delay=OC_MAXI(_enc->rc.buf_delay,12); + _enc->rc.max=_enc->rc.bits_per_frame*_enc->rc.buf_delay; + /*Start with a buffer fullness of 50% plus 25% of the amount we plan to spend + on a single keyframe interval. + We can require fully half the bits in an interval for a keyframe, so this + initial level gives us maximum flexibility for over/under-shooting in + subsequent frames.*/ + _enc->rc.target=(_enc->rc.max+1>>1)+(_enc->rc.bits_per_frame+2>>2)* + OC_MINI(_enc->keyframe_frequency_force,_enc->rc.buf_delay); + _enc->rc.fullness=_enc->rc.target; + /*Pick exponents and initial scales for quantizer selection.*/ + npixels=_enc->state.info.frame_width* + (ogg_int64_t)_enc->state.info.frame_height; + _enc->rc.log_npixels=oc_blog64(npixels); + ibpp=npixels/_enc->rc.bits_per_frame; + if(ibpp<1){ + _enc->rc.exp[0]=59; + _enc->rc.log_scale[0]=oc_blog64(1997)-OC_Q57(8); + } + else if(ibpp<2){ + _enc->rc.exp[0]=55; + _enc->rc.log_scale[0]=oc_blog64(1604)-OC_Q57(8); + } + else{ + _enc->rc.exp[0]=48; + _enc->rc.log_scale[0]=oc_blog64(834)-OC_Q57(8); + } + if(ibpp<4){ + _enc->rc.exp[1]=100; + _enc->rc.log_scale[1]=oc_blog64(2249)-OC_Q57(8); + } + else if(ibpp<8){ + _enc->rc.exp[1]=95; + _enc->rc.log_scale[1]=oc_blog64(1751)-OC_Q57(8); + } + else{ + _enc->rc.exp[1]=73; + _enc->rc.log_scale[1]=oc_blog64(1260)-OC_Q57(8); + } + _enc->rc.prev_drop_count=0; + _enc->rc.log_drop_scale=OC_Q57(0); + /*Set up second order followers, initialized according to corresponding + time constants.*/ + oc_iir_filter_init(&_enc->rc.scalefilter[0],4, + oc_q57_to_q24(_enc->rc.log_scale[0])); + inter_delay=(_enc->rc.twopass? + OC_MAXI(_enc->keyframe_frequency_force,12):_enc->rc.buf_delay)>>1; + _enc->rc.inter_count=0; + /*We clamp the actual inter_delay to a minimum of 10 to work within the range + of values where later incrementing the delay works as designed. + 10 is not an exact choice, but rather a good working trade-off.*/ + _enc->rc.inter_delay=10; + _enc->rc.inter_delay_target=inter_delay; + oc_iir_filter_init(&_enc->rc.scalefilter[1],_enc->rc.inter_delay, + oc_q57_to_q24(_enc->rc.log_scale[1])); + oc_iir_filter_init(&_enc->rc.vfrfilter,4, + oc_bexp64_q24(_enc->rc.log_drop_scale)); +} + +void oc_rc_state_init(oc_rc_state *_rc,oc_enc_ctx *_enc){ + _rc->twopass=0; + _rc->twopass_buffer_bytes=0; + _rc->twopass_force_kf=0; + _rc->frame_metrics=NULL; + _rc->rate_bias=0; + if(_enc->state.info.target_bitrate>0){ + /*The buffer size is set equal to the keyframe interval, clamped to the + range [12,256] frames. + The 12 frame minimum gives us some chance to distribute bit estimation + errors. + The 256 frame maximum means we'll require 8-10 seconds of pre-buffering + at 24-30 fps, which is not unreasonable.*/ + _rc->buf_delay=_enc->keyframe_frequency_force>256? + 256:_enc->keyframe_frequency_force; + /*By default, enforce all buffer constraints.*/ + _rc->drop_frames=1; + _rc->cap_overflow=1; + _rc->cap_underflow=0; + oc_enc_rc_reset(_enc); + } +} + +void oc_rc_state_clear(oc_rc_state *_rc){ + _ogg_free(_rc->frame_metrics); +} + +void oc_enc_rc_resize(oc_enc_ctx *_enc){ + /*If encoding has not yet begun, reset the buffer state.*/ + if(_enc->state.curframe_num<0)oc_enc_rc_reset(_enc); + else{ + int idt; + /*Otherwise, update the bounds on the buffer, but not the current + fullness.*/ + _enc->rc.bits_per_frame=(_enc->state.info.target_bitrate* + (ogg_int64_t)_enc->state.info.fps_denominator)/ + _enc->state.info.fps_numerator; + /*Insane framerates or frame sizes mean insane bitrates. + Let's not get carried away.*/ + if(_enc->rc.bits_per_frame>0x400000000000LL){ + _enc->rc.bits_per_frame=(ogg_int64_t)0x400000000000LL; + } + else if(_enc->rc.bits_per_frame<32)_enc->rc.bits_per_frame=32; + _enc->rc.buf_delay=OC_MAXI(_enc->rc.buf_delay,12); + _enc->rc.max=_enc->rc.bits_per_frame*_enc->rc.buf_delay; + _enc->rc.target=(_enc->rc.max+1>>1)+(_enc->rc.bits_per_frame+2>>2)* + OC_MINI(_enc->keyframe_frequency_force,_enc->rc.buf_delay); + /*Update the INTER-frame scale filter delay. + We jump to it immediately if we've already seen enough frames; otherwise + it is simply set as the new target.*/ + _enc->rc.inter_delay_target=idt=OC_MAXI(_enc->rc.buf_delay>>1,10); + if(idtrc.inter_delay,_enc->rc.inter_count)){ + oc_iir_filter_init(&_enc->rc.scalefilter[1],idt, + _enc->rc.scalefilter[1].y[0]); + _enc->rc.inter_delay=idt; + } + } + /*If we're in pass-2 mode, make sure the frame metrics array is big enough + to hold frame statistics for the full buffer.*/ + if(_enc->rc.twopass==2){ + int cfm; + int buf_delay; + int reset_window; + buf_delay=_enc->rc.buf_delay; + reset_window=_enc->rc.frame_metrics==NULL&&(_enc->rc.frames_total[0]==0|| + buf_delay<_enc->rc.frames_total[0]+_enc->rc.frames_total[1] + +_enc->rc.frames_total[2]); + cfm=_enc->rc.cframe_metrics; + /*Only try to resize the frame metrics buffer if a) it's too small and + b) we were using a finite buffer, or are about to start.*/ + if(cfmrc.frame_metrics!=NULL||reset_window)){ + oc_frame_metrics *fm; + int nfm; + int fmh; + fm=(oc_frame_metrics *)_ogg_realloc(_enc->rc.frame_metrics, + buf_delay*sizeof(*_enc->rc.frame_metrics)); + if(fm==NULL){ + /*We failed to allocate a finite buffer.*/ + /*If we don't have a valid 2-pass header yet, just return; we'll reset + the buffer size when we read the header.*/ + if(_enc->rc.frames_total[0]==0)return; + /*Otherwise revert to the largest finite buffer previously set, or to + whole-file buffering if we were still using that.*/ + _enc->rc.buf_delay=_enc->rc.frame_metrics!=NULL? + cfm:_enc->rc.frames_total[0]+_enc->rc.frames_total[1] + +_enc->rc.frames_total[2]; + oc_enc_rc_resize(_enc); + return; + } + _enc->rc.frame_metrics=fm; + _enc->rc.cframe_metrics=buf_delay; + /*Re-organize the circular buffer.*/ + fmh=_enc->rc.frame_metrics_head; + nfm=_enc->rc.nframe_metrics; + if(fmh+nfm>cfm){ + int shift; + shift=OC_MINI(fmh+nfm-cfm,buf_delay-cfm); + memcpy(fm+cfm,fm,OC_MINI(fmh+nfm-cfm,buf_delay-cfm)*sizeof(*fm)); + if(fmh+nfm>buf_delay)memmove(fm,fm+shift,fmh+nfm-buf_delay); + } + } + /*We were using whole-file buffering; now we're not.*/ + if(reset_window){ + _enc->rc.nframes[0]=_enc->rc.nframes[1]=_enc->rc.nframes[2]=0; + _enc->rc.scale_sum[0]=_enc->rc.scale_sum[1]=0; + _enc->rc.scale_window_end=_enc->rc.scale_window0= + _enc->state.curframe_num+_enc->prev_dup_count+1; + if(_enc->rc.twopass_buffer_bytes){ + int qti; + /*We already read the metrics for the first frame in the window.*/ + *(_enc->rc.frame_metrics)=*&_enc->rc.cur_metrics; + _enc->rc.nframe_metrics++; + qti=_enc->rc.cur_metrics.frame_type; + _enc->rc.nframes[qti]++; + _enc->rc.nframes[2]+=_enc->rc.cur_metrics.dup_count; + _enc->rc.scale_sum[qti]+=oc_bexp_q24(_enc->rc.cur_metrics.log_scale); + _enc->rc.scale_window_end+=_enc->rc.cur_metrics.dup_count+1; + if(_enc->rc.scale_window_end-_enc->rc.scale_window0rc.twopass_buffer_bytes=0; + } + } + } + /*Otherwise, we could shrink the size of the current window, if necessary, + but leaving it like it is lets us adapt to the new buffer size more + gracefully.*/ + } +} + +/*Scale the number of frames by the number of expected drops/duplicates.*/ +static int oc_rc_scale_drop(oc_rc_state *_rc,int _nframes){ + if(_rc->prev_drop_count>0||_rc->log_drop_scale>OC_Q57(0)){ + ogg_int64_t dup_scale; + dup_scale=oc_bexp64((_rc->log_drop_scale + +oc_blog64(_rc->prev_drop_count+1)>>1)+OC_Q57(8)); + if(dup_scale<_nframes<<8){ + int dup_scalei; + dup_scalei=(int)dup_scale; + if(dup_scalei>0)_nframes=((_nframes<<8)+dup_scalei-1)/dup_scalei; + } + else _nframes=!!_nframes; + } + return _nframes; +} + +int oc_enc_select_qi(oc_enc_ctx *_enc,int _qti,int _clamp){ + ogg_int64_t rate_total; + ogg_int64_t rate_bias; + int nframes[2]; + int buf_delay; + int buf_pad; + ogg_int64_t log_qtarget; + ogg_int64_t log_scale0; + ogg_int64_t log_cur_scale; + ogg_int64_t log_qexp; + int exp0; + int old_qi; + int qi; + /*Figure out how to re-distribute bits so that we hit our fullness target + before the last keyframe in our current buffer window (after the current + frame), or the end of the buffer window, whichever comes first.*/ + log_cur_scale=(ogg_int64_t)_enc->rc.scalefilter[_qti].y[0]<<33; + buf_pad=0; + switch(_enc->rc.twopass){ + default:{ + ogg_uint32_t next_key_frame; + /*Single pass mode: assume only forced keyframes and attempt to estimate + the drop count for VFR content.*/ + next_key_frame=_qti?_enc->keyframe_frequency_force + -(_enc->state.curframe_num-_enc->state.keyframe_num):0; + nframes[0]=(_enc->rc.buf_delay-OC_MINI(next_key_frame,_enc->rc.buf_delay) + +_enc->keyframe_frequency_force-1)/_enc->keyframe_frequency_force; + if(nframes[0]+_qti>1){ + nframes[0]--; + buf_delay=next_key_frame+nframes[0]*_enc->keyframe_frequency_force; + } + else buf_delay=_enc->rc.buf_delay; + nframes[1]=buf_delay-nframes[0]; + /*Downgrade the delta frame rate to correspond to the recent drop count + history.*/ + nframes[1]=oc_rc_scale_drop(&_enc->rc,nframes[1]); + }break; + case 1:{ + /*Pass 1 mode: use a fixed qi value.*/ + qi=_enc->state.qis[0]; + _enc->rc.log_qtarget=_enc->log_qavg[_qti][qi]; + return qi; + }break; + case 2:{ + ogg_int64_t scale_sum[2]; + int qti; + /*Pass 2 mode: we know exactly how much of each frame type there is in + the current buffer window, and have estimates for the scales.*/ + nframes[0]=_enc->rc.nframes[0]; + nframes[1]=_enc->rc.nframes[1]; + scale_sum[0]=_enc->rc.scale_sum[0]; + scale_sum[1]=_enc->rc.scale_sum[1]; + /*The window size can be slightly larger than the buffer window for VFR + content; clamp it down, if appropriate (the excess will all be dup + frames).*/ + buf_delay=OC_MINI(_enc->rc.scale_window_end-_enc->rc.scale_window0, + _enc->rc.buf_delay); + /*If we're approaching the end of the file, add some slack to keep us + from slamming into a rail. + Our rate accuracy goes down, but it keeps the result sensible. + We position the target where the first forced keyframe beyond the end + of the file would be (for consistency with 1-pass mode).*/ + buf_pad=OC_MINI(_enc->rc.buf_delay,_enc->state.keyframe_num + +_enc->keyframe_frequency_force-_enc->rc.scale_window0); + if(buf_delayrc.frame_metrics!=NULL){ + int fmi; + int fm_tail; + fm_tail=_enc->rc.frame_metrics_head+_enc->rc.nframe_metrics; + if(fm_tail>=_enc->rc.cframe_metrics)fm_tail-=_enc->rc.cframe_metrics; + for(fmi=fm_tail;;){ + oc_frame_metrics *m; + fmi--; + if(fmi<0)fmi+=_enc->rc.cframe_metrics; + /*Stop before we remove the first frame.*/ + if(fmi==_enc->rc.frame_metrics_head)break; + m=_enc->rc.frame_metrics+fmi; + /*If we find a keyframe, remove it and everything past it.*/ + if(m->frame_type==OC_INTRA_FRAME){ + do{ + qti=m->frame_type; + nframes[qti]--; + scale_sum[qti]-=oc_bexp_q24(m->log_scale); + buf_delay-=m->dup_count+1; + fmi++; + if(fmi>=_enc->rc.cframe_metrics)fmi=0; + m=_enc->rc.frame_metrics+fmi; + } + while(fmi!=fm_tail); + /*And stop scanning backwards.*/ + break; + } + } + } + } + /*If we're not using the same frame type as in pass 1 (because someone + changed the keyframe interval), remove that scale estimate. + We'll add in a replacement for the correct frame type below.*/ + qti=_enc->rc.cur_metrics.frame_type; + if(qti!=_qti){ + nframes[qti]--; + scale_sum[qti]-=oc_bexp_q24(_enc->rc.cur_metrics.log_scale); + } + /*Compute log_scale estimates for each frame type from the pass-1 scales + we measured in the current window.*/ + for(qti=0;qti<2;qti++){ + _enc->rc.log_scale[qti]=nframes[qti]>0? + oc_blog64(scale_sum[qti])-oc_blog64(nframes[qti])-OC_Q57(24): + -_enc->rc.log_npixels; + } + /*If we're not using the same frame type as in pass 1, add a scale + estimate for the corresponding frame using the current low-pass + filter value. + This is mostly to ensure we have a valid estimate even when pass 1 had + no frames of this type in the buffer window. + TODO: We could also plan ahead and figure out how many keyframes we'll + be forced to add in the current buffer window.*/ + qti=_enc->rc.cur_metrics.frame_type; + if(qti!=_qti){ + ogg_int64_t scale; + scale=_enc->rc.log_scale[_qti]rc.log_scale[_qti]+OC_Q57(24)):0x7FFFFFFFFFFFLL; + scale*=nframes[_qti]; + nframes[_qti]++; + scale+=oc_bexp_q24(log_cur_scale>>33); + _enc->rc.log_scale[_qti]=oc_blog64(scale) + -oc_blog64(nframes[qti])-OC_Q57(24); + } + else log_cur_scale=(ogg_int64_t)_enc->rc.cur_metrics.log_scale<<33; + /*Add the padding from above. + This basically reverts to 1-pass estimations in the last keyframe + interval.*/ + if(buf_pad>0){ + ogg_int64_t scale; + int nextra_frames; + /*Extend the buffer.*/ + buf_delay+=buf_pad; + /*Add virtual delta frames according to the estimated drop count.*/ + nextra_frames=oc_rc_scale_drop(&_enc->rc,buf_pad); + /*And blend in the low-pass filtered scale according to how many frames + we added.*/ + scale= + oc_bexp64(_enc->rc.log_scale[1]+OC_Q57(24))*(ogg_int64_t)nframes[1] + +oc_bexp_q24(_enc->rc.scalefilter[1].y[0])*(ogg_int64_t)nextra_frames; + nframes[1]+=nextra_frames; + _enc->rc.log_scale[1]=oc_blog64(scale)-oc_blog64(nframes[1])-OC_Q57(24); + } + }break; + } + /*If we've been missing our target, add a penalty term.*/ + rate_bias=(_enc->rc.rate_bias/(_enc->state.curframe_num+1000))* + (buf_delay-buf_pad); + /*rate_total is the total bits available over the next buf_delay frames.*/ + rate_total=_enc->rc.fullness-_enc->rc.target+rate_bias + +buf_delay*_enc->rc.bits_per_frame; + log_scale0=_enc->rc.log_scale[_qti]+_enc->rc.log_npixels; + /*If there aren't enough bits to achieve our desired fullness level, use the + minimum quality permitted.*/ + if(rate_total<=buf_delay)log_qtarget=OC_QUANT_MAX_LOG; + else{ + static const ogg_int64_t LOG_KEY_RATIO=0x0137222BB70747BALL; + ogg_int64_t log_scale1; + ogg_int64_t rlo; + ogg_int64_t rhi; + log_scale1=_enc->rc.log_scale[1-_qti]+_enc->rc.log_npixels; + rlo=0; + rhi=(rate_total+nframes[_qti]-1)/nframes[_qti]; + while(rlo>1; + log_rpow=oc_blog64(curr)-log_scale0; + log_rpow=(log_rpow+(_enc->rc.exp[_qti]>>1))/_enc->rc.exp[_qti]; + if(_qti)log_rpow+=LOG_KEY_RATIO>>6; + else log_rpow-=LOG_KEY_RATIO>>6; + log_rpow*=_enc->rc.exp[1-_qti]; + rscale=nframes[1-_qti]*oc_bexp64(log_scale1+log_rpow); + rdiff=nframes[_qti]*curr+rscale-rate_total; + if(rdiff<0)rlo=curr+1; + else if(rdiff>0)rhi=curr-1; + else break; + } + log_qtarget=OC_Q57(2)-((oc_blog64(rlo)-log_scale0+(_enc->rc.exp[_qti]>>1))/ + _enc->rc.exp[_qti]<<6); + log_qtarget=OC_MINI(log_qtarget,OC_QUANT_MAX_LOG); + } + /*The above allocation looks only at the total rate we'll accumulate in the + next buf_delay frames. + However, we could overflow the buffer on the very next frame, so check for + that here, if we're not using a soft target.*/ + exp0=_enc->rc.exp[_qti]; + if(_enc->rc.cap_overflow){ + ogg_int64_t margin; + ogg_int64_t soft_limit; + ogg_int64_t log_soft_limit; + /*Allow 3% of the buffer for prediction error. + This should be plenty, and we don't mind if we go a bit over; we only + want to keep these bits from being completely wasted.*/ + margin=_enc->rc.max+31>>5; + /*We want to use at least this many bits next frame.*/ + soft_limit=_enc->rc.fullness+_enc->rc.bits_per_frame-(_enc->rc.max-margin); + log_soft_limit=oc_blog64(soft_limit); + /*If we're predicting we won't use that many...*/ + log_qexp=(log_qtarget-OC_Q57(2)>>6)*exp0; + if(log_scale0-log_qexp>32)* + ((OC_MINI(margin,soft_limit)<<32)/margin); + log_qtarget=((log_qexp+(exp0>>1))/exp0<<6)+OC_Q57(2); + } + } + /*If this was not one of the initial frames, limit the change in quality.*/ + old_qi=_enc->state.qis[0]; + if(_clamp){ + ogg_int64_t log_qmin; + ogg_int64_t log_qmax; + /*Clamp the target quantizer to within [0.8*Q,1.2*Q], where Q is the + current quantizer. + TODO: With user-specified quant matrices, we need to enlarge these limits + if they don't actually let us change qi values.*/ + log_qmin=_enc->log_qavg[_qti][old_qi]-0x00A4D3C25E68DC58LL; + log_qmax=_enc->log_qavg[_qti][old_qi]+0x00A4D3C25E68DC58LL; + log_qtarget=OC_CLAMPI(log_qmin,log_qtarget,log_qmax); + } + /*The above allocation looks only at the total rate we'll accumulate in the + next buf_delay frames. + However, we could bust the budget on the very next frame, so check for that + here, if we're not using a soft target.*/ + /* Disabled when our minimum qi > 0; if we saturate log_qtarget to + to the maximum possible size when we have a minimum qi, the + resulting lambda will interact very strangely with SKIP. The + resulting artifacts look like waterfalls. */ + if(_enc->state.info.quality==0){ + ogg_int64_t log_hard_limit; + /*Compute the maximum number of bits we can use in the next frame. + Allow 50% of the rate for a single frame for prediction error. + This may not be enough for keyframes or sudden changes in complexity.*/ + log_hard_limit=oc_blog64(_enc->rc.fullness+(_enc->rc.bits_per_frame>>1)); + /*If we're predicting we'll use more than this...*/ + log_qexp=(log_qtarget-OC_Q57(2)>>6)*exp0; + if(log_scale0-log_qexp>log_hard_limit){ + /*Force the target to hit our limit exactly.*/ + log_qexp=log_scale0-log_hard_limit; + log_qtarget=((log_qexp+(exp0>>1))/exp0<<6)+OC_Q57(2); + /*If that target is unreasonable, oh well; we'll have to drop.*/ + log_qtarget=OC_MINI(log_qtarget,OC_QUANT_MAX_LOG); + } + } + /*Compute a final estimate of the number of bits we plan to use.*/ + log_qexp=(log_qtarget-OC_Q57(2)>>6)*_enc->rc.exp[_qti]; + _enc->rc.rate_bias+=oc_bexp64(log_cur_scale+_enc->rc.log_npixels-log_qexp); + qi=oc_enc_find_qi_for_target(_enc,_qti,old_qi, + _enc->state.info.quality,log_qtarget); + /*Save the quantizer target for lambda calculations.*/ + _enc->rc.log_qtarget=log_qtarget; + return qi; +} + +int oc_enc_update_rc_state(oc_enc_ctx *_enc, + long _bits,int _qti,int _qi,int _trial,int _droppable){ + ogg_int64_t buf_delta; + ogg_int64_t log_scale; + int dropped; + dropped=0; + /* Drop frames also disabled for now in the case of infinite-buffer + two-pass mode */ + if(!_enc->rc.drop_frames||_enc->rc.twopass&&_enc->rc.frame_metrics==NULL){ + _droppable=0; + } + buf_delta=_enc->rc.bits_per_frame*(1+_enc->dup_count); + if(_bits<=0){ + /*We didn't code any blocks in this frame.*/ + log_scale=OC_Q57(-64); + _bits=0; + } + else{ + ogg_int64_t log_bits; + ogg_int64_t log_qexp; + /*Compute the estimated scale factor for this frame type.*/ + log_bits=oc_blog64(_bits); + log_qexp=_enc->rc.log_qtarget-OC_Q57(2); + log_qexp=(log_qexp>>6)*(_enc->rc.exp[_qti]); + log_scale=OC_MINI(log_bits-_enc->rc.log_npixels+log_qexp,OC_Q57(16)); + } + /*Special two-pass processing.*/ + switch(_enc->rc.twopass){ + case 1:{ + /*Pass 1 mode: save the metrics for this frame.*/ + _enc->rc.cur_metrics.log_scale=oc_q57_to_q24(log_scale); + _enc->rc.cur_metrics.dup_count=_enc->dup_count; + _enc->rc.cur_metrics.frame_type=_enc->state.frame_type; + _enc->rc.twopass_buffer_bytes=0; + }break; + case 2:{ + /*Pass 2 mode:*/ + if(!_trial){ + ogg_int64_t next_frame_num; + int qti; + /*Move the current metrics back one frame.*/ + *&_enc->rc.prev_metrics=*&_enc->rc.cur_metrics; + next_frame_num=_enc->state.curframe_num+_enc->dup_count+1; + /*Back out the last frame's statistics from the sliding window.*/ + qti=_enc->rc.prev_metrics.frame_type; + _enc->rc.frames_left[qti]--; + _enc->rc.frames_left[2]-=_enc->rc.prev_metrics.dup_count; + _enc->rc.nframes[qti]--; + _enc->rc.nframes[2]-=_enc->rc.prev_metrics.dup_count; + _enc->rc.scale_sum[qti]-=oc_bexp_q24(_enc->rc.prev_metrics.log_scale); + _enc->rc.scale_window0=(int)next_frame_num; + /*Free the corresponding entry in the circular buffer.*/ + if(_enc->rc.frame_metrics!=NULL){ + _enc->rc.nframe_metrics--; + _enc->rc.frame_metrics_head++; + if(_enc->rc.frame_metrics_head>=_enc->rc.cframe_metrics){ + _enc->rc.frame_metrics_head=0; + } + } + /*Mark us ready for the next 2-pass packet.*/ + _enc->rc.twopass_buffer_bytes=0; + /*Update state, so the user doesn't have to keep calling 2pass_in after + they've fed in all the data when we're using a finite buffer.*/ + _enc->prev_dup_count=_enc->dup_count; + oc_enc_rc_2pass_in(_enc,NULL,0); + } + }break; + } + /*Common to all passes:*/ + if(_bits>0){ + if(_trial){ + oc_iir_filter *f; + /*Use the estimated scale factor directly if this was a trial.*/ + f=_enc->rc.scalefilter+_qti; + f->y[1]=f->y[0]=f->x[1]=f->x[0]=oc_q57_to_q24(log_scale); + _enc->rc.log_scale[_qti]=log_scale; + } + else{ + /*Lengthen the time constant for the INTER filter as we collect more + frame statistics, until we reach our target.*/ + if(_enc->rc.inter_delay<_enc->rc.inter_delay_target&& + _enc->rc.inter_count>=_enc->rc.inter_delay&&_qti==OC_INTER_FRAME){ + oc_iir_filter_reinit(&_enc->rc.scalefilter[1],++_enc->rc.inter_delay); + } + /*Otherwise update the low-pass scale filter for this frame type, + regardless of whether or not we dropped this frame.*/ + _enc->rc.log_scale[_qti]=oc_iir_filter_update( + _enc->rc.scalefilter+_qti,oc_q57_to_q24(log_scale))<<33; + /*If this frame busts our budget, it must be dropped.*/ + if(_droppable&&_enc->rc.fullness+buf_delta<_bits){ + _enc->rc.prev_drop_count+=1+_enc->dup_count; + _bits=0; + dropped=1; + } + else{ + ogg_uint32_t drop_count; + /*Update a low-pass filter to estimate the "real" frame rate taking + drops and duplicates into account. + This is only done if the frame is coded, as it needs the final + count of dropped frames.*/ + drop_count=_enc->rc.prev_drop_count+1; + if(drop_count>0x7F)drop_count=0x7FFFFFFF; + else drop_count<<=24; + _enc->rc.log_drop_scale=oc_blog64(oc_iir_filter_update( + &_enc->rc.vfrfilter,drop_count))-OC_Q57(24); + /*Initialize the drop count for this frame to the user-requested dup + count. + It will be increased if we drop more frames.*/ + _enc->rc.prev_drop_count=_enc->dup_count; + } + } + /*Increment the INTER frame count, for filter adaptation purposes.*/ + if(_enc->rc.inter_countrc.inter_count+=_qti; + } + /*Increase the drop count.*/ + else _enc->rc.prev_drop_count+=1+_enc->dup_count; + /*And update the buffer fullness level.*/ + if(!_trial){ + _enc->rc.fullness+=buf_delta-_bits; + /*If we're too quick filling the buffer and overflow is capped, + that rate is lost forever.*/ + if(_enc->rc.cap_overflow&&_enc->rc.fullness>_enc->rc.max){ + _enc->rc.fullness=_enc->rc.max; + } + /*If we're too quick draining the buffer and underflow is capped, + don't try to make up that rate later.*/ + if(_enc->rc.cap_underflow&&_enc->rc.fullness<0){ + _enc->rc.fullness=0; + } + /*Adjust the bias for the real bits we've used.*/ + _enc->rc.rate_bias-=_bits; + } + return dropped; +} + +#define OC_RC_2PASS_VERSION (1) +#define OC_RC_2PASS_HDR_SZ (38) +#define OC_RC_2PASS_PACKET_SZ (8) + +static void oc_rc_buffer_val(oc_rc_state *_rc,ogg_int64_t _val,int _bytes){ + while(_bytes-->0){ + _rc->twopass_buffer[_rc->twopass_buffer_bytes++]=(unsigned char)(_val&0xFF); + _val>>=8; + } +} + +int oc_enc_rc_2pass_out(oc_enc_ctx *_enc,unsigned char **_buf){ + if(_enc->rc.twopass_buffer_bytes==0){ + if(_enc->rc.twopass==0){ + int qi; + /*Pick first-pass qi for scale calculations.*/ + qi=oc_enc_select_qi(_enc,0,0); + _enc->state.nqis=1; + _enc->state.qis[0]=qi; + _enc->rc.twopass=1; + _enc->rc.frames_total[0]=_enc->rc.frames_total[1]= + _enc->rc.frames_total[2]=0; + _enc->rc.scale_sum[0]=_enc->rc.scale_sum[1]=0; + /*Fill in dummy summary values.*/ + oc_rc_buffer_val(&_enc->rc,0x5032544F,4); + oc_rc_buffer_val(&_enc->rc,OC_RC_2PASS_VERSION,4); + oc_rc_buffer_val(&_enc->rc,0,OC_RC_2PASS_HDR_SZ-8); + } + else{ + int qti; + qti=_enc->rc.cur_metrics.frame_type; + _enc->rc.scale_sum[qti]+=oc_bexp_q24(_enc->rc.cur_metrics.log_scale); + _enc->rc.frames_total[qti]++; + _enc->rc.frames_total[2]+=_enc->rc.cur_metrics.dup_count; + oc_rc_buffer_val(&_enc->rc, + _enc->rc.cur_metrics.dup_count|_enc->rc.cur_metrics.frame_type<<31,4); + oc_rc_buffer_val(&_enc->rc,_enc->rc.cur_metrics.log_scale,4); + } + } + else if(_enc->packet_state==OC_PACKET_DONE&& + _enc->rc.twopass_buffer_bytes!=OC_RC_2PASS_HDR_SZ){ + _enc->rc.twopass_buffer_bytes=0; + oc_rc_buffer_val(&_enc->rc,0x5032544F,4); + oc_rc_buffer_val(&_enc->rc,OC_RC_2PASS_VERSION,4); + oc_rc_buffer_val(&_enc->rc,_enc->rc.frames_total[0],4); + oc_rc_buffer_val(&_enc->rc,_enc->rc.frames_total[1],4); + oc_rc_buffer_val(&_enc->rc,_enc->rc.frames_total[2],4); + oc_rc_buffer_val(&_enc->rc,_enc->rc.exp[0],1); + oc_rc_buffer_val(&_enc->rc,_enc->rc.exp[1],1); + oc_rc_buffer_val(&_enc->rc,_enc->rc.scale_sum[0],8); + oc_rc_buffer_val(&_enc->rc,_enc->rc.scale_sum[1],8); + } + else{ + /*The data for this frame has already been retrieved.*/ + *_buf=NULL; + return 0; + } + *_buf=_enc->rc.twopass_buffer; + return _enc->rc.twopass_buffer_bytes; +} + +static size_t oc_rc_buffer_fill(oc_rc_state *_rc, + unsigned char *_buf,size_t _bytes,size_t _consumed,size_t _goal){ + while(_rc->twopass_buffer_fill<_goal&&_consumed<_bytes){ + _rc->twopass_buffer[_rc->twopass_buffer_fill++]=_buf[_consumed++]; + } + return _consumed; +} + +static ogg_int64_t oc_rc_unbuffer_val(oc_rc_state *_rc,int _bytes){ + ogg_int64_t ret; + int shift; + ret=0; + shift=0; + while(_bytes-->0){ + ret|=((ogg_int64_t)_rc->twopass_buffer[_rc->twopass_buffer_bytes++])<rc.twopass==0){ + _enc->rc.twopass=2; + _enc->rc.twopass_buffer_fill=0; + _enc->rc.frames_total[0]=0; + _enc->rc.nframe_metrics=0; + _enc->rc.cframe_metrics=0; + _enc->rc.frame_metrics_head=0; + _enc->rc.scale_window0=0; + _enc->rc.scale_window_end=0; + } + /*If we haven't got a valid summary header yet, try to parse one.*/ + if(_enc->rc.frames_total[0]==0){ + if(!_buf){ + int frames_needed; + /*If we're using a whole-file buffer, we just need the first frame. + Otherwise, we may need as many as one per buffer slot.*/ + frames_needed=_enc->rc.frame_metrics==NULL?1:_enc->rc.buf_delay; + return OC_RC_2PASS_HDR_SZ+frames_needed*OC_RC_2PASS_PACKET_SZ + -_enc->rc.twopass_buffer_fill; + } + consumed=oc_rc_buffer_fill(&_enc->rc, + _buf,_bytes,consumed,OC_RC_2PASS_HDR_SZ); + if(_enc->rc.twopass_buffer_fill>=OC_RC_2PASS_HDR_SZ){ + ogg_int64_t scale_sum[2]; + int exp[2]; + int buf_delay; + /*Read the summary header data.*/ + /*Check the magic value and version number.*/ + if(oc_rc_unbuffer_val(&_enc->rc,4)!=0x5032544F|| + oc_rc_unbuffer_val(&_enc->rc,4)!=OC_RC_2PASS_VERSION){ + _enc->rc.twopass_buffer_bytes=0; + return TH_ENOTFORMAT; + } + _enc->rc.frames_total[0]=(ogg_uint32_t)oc_rc_unbuffer_val(&_enc->rc,4); + _enc->rc.frames_total[1]=(ogg_uint32_t)oc_rc_unbuffer_val(&_enc->rc,4); + _enc->rc.frames_total[2]=(ogg_uint32_t)oc_rc_unbuffer_val(&_enc->rc,4); + exp[0]=(int)oc_rc_unbuffer_val(&_enc->rc,1); + exp[1]=(int)oc_rc_unbuffer_val(&_enc->rc,1); + scale_sum[0]=oc_rc_unbuffer_val(&_enc->rc,8); + scale_sum[1]=oc_rc_unbuffer_val(&_enc->rc,8); + /*Make sure the file claims to have at least one frame. + Otherwise we probably got the placeholder data from an aborted pass 1. + Also make sure the total frame count doesn't overflow an integer.*/ + buf_delay=_enc->rc.frames_total[0]+_enc->rc.frames_total[1] + +_enc->rc.frames_total[2]; + if(_enc->rc.frames_total[0]==0||buf_delay<0|| + (ogg_uint32_t)buf_delay<_enc->rc.frames_total[0]|| + (ogg_uint32_t)buf_delay<_enc->rc.frames_total[1]){ + _enc->rc.frames_total[0]=0; + _enc->rc.twopass_buffer_bytes=0; + return TH_EBADHEADER; + } + /*Got a valid header; set up pass 2.*/ + _enc->rc.frames_left[0]=_enc->rc.frames_total[0]; + _enc->rc.frames_left[1]=_enc->rc.frames_total[1]; + _enc->rc.frames_left[2]=_enc->rc.frames_total[2]; + /*If the user hasn't specified a buffer size, use the whole file.*/ + if(_enc->rc.frame_metrics==NULL){ + _enc->rc.buf_delay=buf_delay; + _enc->rc.nframes[0]=_enc->rc.frames_total[0]; + _enc->rc.nframes[1]=_enc->rc.frames_total[1]; + _enc->rc.nframes[2]=_enc->rc.frames_total[2]; + _enc->rc.scale_sum[0]=scale_sum[0]; + _enc->rc.scale_sum[1]=scale_sum[1]; + _enc->rc.scale_window_end=buf_delay; + oc_enc_rc_reset(_enc); + } + _enc->rc.exp[0]=exp[0]; + _enc->rc.exp[1]=exp[1]; + /*Clear the header data from the buffer to make room for packet data.*/ + _enc->rc.twopass_buffer_fill=0; + _enc->rc.twopass_buffer_bytes=0; + } + } + if(_enc->rc.frames_total[0]!=0){ + ogg_int64_t curframe_num; + int nframes_total; + curframe_num=_enc->state.curframe_num; + if(curframe_num>=0){ + /*We just encoded a frame; make sure things matched.*/ + if(_enc->rc.prev_metrics.dup_count!=_enc->prev_dup_count){ + _enc->rc.twopass_buffer_bytes=0; + return TH_EINVAL; + } + } + curframe_num+=_enc->prev_dup_count+1; + nframes_total=_enc->rc.frames_total[0]+_enc->rc.frames_total[1] + +_enc->rc.frames_total[2]; + if(curframe_num>=nframes_total){ + /*We don't want any more data after the last frame, and we don't want to + allow any more frames to be encoded.*/ + _enc->rc.twopass_buffer_bytes=0; + } + else if(_enc->rc.twopass_buffer_bytes==0){ + if(_enc->rc.frame_metrics==NULL){ + /*We're using a whole-file buffer:*/ + if(!_buf)return OC_RC_2PASS_PACKET_SZ-_enc->rc.twopass_buffer_fill; + consumed=oc_rc_buffer_fill(&_enc->rc, + _buf,_bytes,consumed,OC_RC_2PASS_PACKET_SZ); + if(_enc->rc.twopass_buffer_fill>=OC_RC_2PASS_PACKET_SZ){ + ogg_uint32_t dup_count; + ogg_int32_t log_scale; + int qti; + int arg; + /*Read the metrics for the next frame.*/ + dup_count=oc_rc_unbuffer_val(&_enc->rc,4); + log_scale=oc_rc_unbuffer_val(&_enc->rc,4); + _enc->rc.cur_metrics.log_scale=log_scale; + qti=(dup_count&0x80000000)>>31; + _enc->rc.cur_metrics.dup_count=dup_count&0x7FFFFFFF; + _enc->rc.cur_metrics.frame_type=qti; + _enc->rc.twopass_force_kf=qti==OC_INTRA_FRAME; + /*"Helpfully" set the dup count back to what it was in pass 1.*/ + arg=_enc->rc.cur_metrics.dup_count; + th_encode_ctl(_enc,TH_ENCCTL_SET_DUP_COUNT,&arg,sizeof(arg)); + /*Clear the buffer for the next frame.*/ + _enc->rc.twopass_buffer_fill=0; + } + } + else{ + int frames_needed; + /*We're using a finite buffer:*/ + frames_needed=OC_CLAMPI(0,_enc->rc.buf_delay + -(_enc->rc.scale_window_end-_enc->rc.scale_window0), + _enc->rc.frames_left[0]+_enc->rc.frames_left[1] + -_enc->rc.nframes[0]-_enc->rc.nframes[1]); + while(frames_needed>0){ + if(!_buf){ + return OC_RC_2PASS_PACKET_SZ*frames_needed + -_enc->rc.twopass_buffer_fill; + } + consumed=oc_rc_buffer_fill(&_enc->rc, + _buf,_bytes,consumed,OC_RC_2PASS_PACKET_SZ); + if(_enc->rc.twopass_buffer_fill>=OC_RC_2PASS_PACKET_SZ){ + oc_frame_metrics *m; + int fmi; + ogg_uint32_t dup_count; + ogg_int32_t log_scale; + int qti; + /*Read the metrics for the next frame.*/ + dup_count=oc_rc_unbuffer_val(&_enc->rc,4); + log_scale=oc_rc_unbuffer_val(&_enc->rc,4); + /*Add the to the circular buffer.*/ + fmi=_enc->rc.frame_metrics_head+_enc->rc.nframe_metrics++; + if(fmi>=_enc->rc.cframe_metrics)fmi-=_enc->rc.cframe_metrics; + m=_enc->rc.frame_metrics+fmi; + m->log_scale=log_scale; + qti=(dup_count&0x80000000)>>31; + m->dup_count=dup_count&0x7FFFFFFF; + m->frame_type=qti; + /*And accumulate the statistics over the window.*/ + _enc->rc.nframes[qti]++; + _enc->rc.nframes[2]+=m->dup_count; + _enc->rc.scale_sum[qti]+=oc_bexp_q24(m->log_scale); + _enc->rc.scale_window_end+=m->dup_count+1; + /*Compute an upper bound on the number of remaining packets needed + for the current window.*/ + frames_needed=OC_CLAMPI(0,_enc->rc.buf_delay + -(_enc->rc.scale_window_end-_enc->rc.scale_window0), + _enc->rc.frames_left[0]+_enc->rc.frames_left[1] + -_enc->rc.nframes[0]-_enc->rc.nframes[1]); + /*Clear the buffer for the next frame.*/ + _enc->rc.twopass_buffer_fill=0; + _enc->rc.twopass_buffer_bytes=0; + } + /*Go back for more data.*/ + else break; + } + /*If we've got all the frames we need, fill in the current metrics. + We're ready to go.*/ + if(frames_needed<=0){ + int arg; + *&_enc->rc.cur_metrics= + *(_enc->rc.frame_metrics+_enc->rc.frame_metrics_head); + _enc->rc.twopass_force_kf= + _enc->rc.cur_metrics.frame_type==OC_INTRA_FRAME; + /*"Helpfully" set the dup count back to what it was in pass 1.*/ + arg=_enc->rc.cur_metrics.dup_count; + th_encode_ctl(_enc,TH_ENCCTL_SET_DUP_COUNT,&arg,sizeof(arg)); + /*Mark us ready for the next frame.*/ + _enc->rc.twopass_buffer_bytes=1; + } + } + } + } + return (int)consumed; +} diff --git a/libs/libtheora-1.1/lib/state.c b/libs/libtheora-1.1/lib/state.c new file mode 100644 index 00000000..f1aa5890 --- /dev/null +++ b/libs/libtheora-1.1/lib/state.c @@ -0,0 +1,1227 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: state.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include "internal.h" +#if defined(OC_X86_ASM) +#if defined(_MSC_VER) +# include "x86_vc/x86int.h" +#else +# include "x86/x86int.h" +#endif +#endif +#if defined(OC_DUMP_IMAGES) +# include +# include "png.h" +#endif + +/*Returns the fragment index of the top-left block in a macro block. + This can be used to test whether or not the whole macro block is valid. + _sb_map: The super block map. + _quadi: The quadrant number. + Return: The index of the fragment of the upper left block in the macro + block, or -1 if the block lies outside the coded frame.*/ +static ptrdiff_t oc_sb_quad_top_left_frag(oc_sb_map_quad _sb_map[4],int _quadi){ + /*It so happens that under the Hilbert curve ordering described below, the + upper-left block in each macro block is at index 0, except in macro block + 3, where it is at index 2.*/ + return _sb_map[_quadi][_quadi&_quadi<<1]; +} + +/*Fills in the mapping from block positions to fragment numbers for a single + color plane. + This function also fills in the "valid" flag of each quadrant in the super + block flags. + _sb_maps: The array of super block maps for the color plane. + _sb_flags: The array of super block flags for the color plane. + _frag0: The index of the first fragment in the plane. + _hfrags: The number of horizontal fragments in a coded frame. + _vfrags: The number of vertical fragments in a coded frame.*/ +static void oc_sb_create_plane_mapping(oc_sb_map _sb_maps[], + oc_sb_flags _sb_flags[],ptrdiff_t _frag0,int _hfrags,int _vfrags){ + /*Contains the (macro_block,block) indices for a 4x4 grid of + fragments. + The pattern is a 4x4 Hilbert space-filling curve. + A Hilbert curve has the nice property that as the curve grows larger, its + fractal dimension approaches 2. + The intuition is that nearby blocks in the curve are also close spatially, + with the previous element always an immediate neighbor, so that runs of + blocks should be well correlated.*/ + static const int SB_MAP[4][4][2]={ + {{0,0},{0,1},{3,2},{3,3}}, + {{0,3},{0,2},{3,1},{3,0}}, + {{1,0},{1,3},{2,0},{2,3}}, + {{1,1},{1,2},{2,1},{2,2}} + }; + ptrdiff_t yfrag; + unsigned sbi; + int y; + sbi=0; + yfrag=_frag0; + for(y=0;;y+=4){ + int imax; + int x; + /*Figure out how many columns of blocks in this super block lie within the + image.*/ + imax=_vfrags-y; + if(imax>4)imax=4; + else if(imax<=0)break; + for(x=0;;x+=4,sbi++){ + ptrdiff_t xfrag; + int jmax; + int quadi; + int i; + /*Figure out how many rows of blocks in this super block lie within the + image.*/ + jmax=_hfrags-x; + if(jmax>4)jmax=4; + else if(jmax<=0)break; + /*By default, set all fragment indices to -1.*/ + memset(_sb_maps[sbi][0],0xFF,sizeof(_sb_maps[sbi])); + /*Fill in the fragment map for this super block.*/ + xfrag=yfrag+x; + for(i=0;i=0)<nhfrags+_xfrag0+j; + } +} + +/*Fills in the chroma plane fragment maps for a macro block. + This version is for use with chroma decimated in the X and Y directions + (4:2:0). + _mb_map: The macro block map to fill. + _fplanes: The descriptions of the fragment planes. + _xfrag0: The X location of the upper-left hand fragment in the luma plane. + _yfrag0: The Y location of the upper-left hand fragment in the luma plane.*/ +static void oc_mb_fill_cmapping00(oc_mb_map_plane _mb_map[3], + const oc_fragment_plane _fplanes[3],int _xfrag0,int _yfrag0){ + ptrdiff_t fragi; + _xfrag0>>=1; + _yfrag0>>=1; + fragi=_yfrag0*(ptrdiff_t)_fplanes[1].nhfrags+_xfrag0; + _mb_map[1][0]=fragi+_fplanes[1].froffset; + _mb_map[2][0]=fragi+_fplanes[2].froffset; +} + +/*Fills in the chroma plane fragment maps for a macro block. + This version is for use with chroma decimated in the Y direction. + _mb_map: The macro block map to fill. + _fplanes: The descriptions of the fragment planes. + _xfrag0: The X location of the upper-left hand fragment in the luma plane. + _yfrag0: The Y location of the upper-left hand fragment in the luma plane.*/ +static void oc_mb_fill_cmapping01(oc_mb_map_plane _mb_map[3], + const oc_fragment_plane _fplanes[3],int _xfrag0,int _yfrag0){ + ptrdiff_t fragi; + int j; + _yfrag0>>=1; + fragi=_yfrag0*(ptrdiff_t)_fplanes[1].nhfrags+_xfrag0; + for(j=0;j<2;j++){ + _mb_map[1][j]=fragi+_fplanes[1].froffset; + _mb_map[2][j]=fragi+_fplanes[2].froffset; + fragi++; + } +} + +/*Fills in the chroma plane fragment maps for a macro block. + This version is for use with chroma decimated in the X direction (4:2:2). + _mb_map: The macro block map to fill. + _fplanes: The descriptions of the fragment planes. + _xfrag0: The X location of the upper-left hand fragment in the luma plane. + _yfrag0: The Y location of the upper-left hand fragment in the luma plane.*/ +static void oc_mb_fill_cmapping10(oc_mb_map_plane _mb_map[3], + const oc_fragment_plane _fplanes[3],int _xfrag0,int _yfrag0){ + ptrdiff_t fragi; + int i; + _xfrag0>>=1; + fragi=_yfrag0*(ptrdiff_t)_fplanes[1].nhfrags+_xfrag0; + for(i=0;i<2;i++){ + _mb_map[1][i<<1]=fragi+_fplanes[1].froffset; + _mb_map[2][i<<1]=fragi+_fplanes[2].froffset; + fragi+=_fplanes[1].nhfrags; + } +} + +/*Fills in the chroma plane fragment maps for a macro block. + This version is for use with no chroma decimation (4:4:4). + This uses the already filled-in luma plane values. + _mb_map: The macro block map to fill. + _fplanes: The descriptions of the fragment planes.*/ +static void oc_mb_fill_cmapping11(oc_mb_map_plane _mb_map[3], + const oc_fragment_plane _fplanes[3]){ + int k; + for(k=0;k<4;k++){ + _mb_map[1][k]=_mb_map[0][k]+_fplanes[1].froffset; + _mb_map[2][k]=_mb_map[0][k]+_fplanes[2].froffset; + } +} + +/*The function type used to fill in the chroma plane fragment maps for a + macro block. + _mb_map: The macro block map to fill. + _fplanes: The descriptions of the fragment planes. + _xfrag0: The X location of the upper-left hand fragment in the luma plane. + _yfrag0: The Y location of the upper-left hand fragment in the luma plane.*/ +typedef void (*oc_mb_fill_cmapping_func)(oc_mb_map_plane _mb_map[3], + const oc_fragment_plane _fplanes[3],int _xfrag0,int _yfrag0); + +/*A table of functions used to fill in the chroma plane fragment maps for a + macro block for each type of chrominance decimation.*/ +static const oc_mb_fill_cmapping_func OC_MB_FILL_CMAPPING_TABLE[4]={ + oc_mb_fill_cmapping00, + oc_mb_fill_cmapping01, + oc_mb_fill_cmapping10, + (oc_mb_fill_cmapping_func)oc_mb_fill_cmapping11 +}; + +/*Fills in the mapping from macro blocks to their corresponding fragment + numbers in each plane. + _mb_maps: The list of macro block maps. + _mb_modes: The list of macro block modes; macro blocks completely outside + the coded region are marked invalid. + _fplanes: The descriptions of the fragment planes. + _pixel_fmt: The chroma decimation type.*/ +static void oc_mb_create_mapping(oc_mb_map _mb_maps[], + signed char _mb_modes[],const oc_fragment_plane _fplanes[3],int _pixel_fmt){ + oc_mb_fill_cmapping_func mb_fill_cmapping; + unsigned sbi; + int y; + mb_fill_cmapping=OC_MB_FILL_CMAPPING_TABLE[_pixel_fmt]; + /*Loop through the luma plane super blocks.*/ + for(sbi=y=0;y<_fplanes[0].nvfrags;y+=4){ + int x; + for(x=0;x<_fplanes[0].nhfrags;x+=4,sbi++){ + int ymb; + /*Loop through the macro blocks in each super block in display order.*/ + for(ymb=0;ymb<2;ymb++){ + int xmb; + for(xmb=0;xmb<2;xmb++){ + unsigned mbi; + int mbx; + int mby; + mbi=sbi<<2|OC_MB_MAP[ymb][xmb]; + mbx=x|xmb<<1; + mby=y|ymb<<1; + /*Initialize fragment indices to -1.*/ + memset(_mb_maps[mbi],0xFF,sizeof(_mb_maps[mbi])); + /*Make sure this macro block is within the encoded region.*/ + if(mbx>=_fplanes[0].nhfrags||mby>=_fplanes[0].nvfrags){ + _mb_modes[mbi]=OC_MODE_INVALID; + continue; + } + /*Fill in the fragment indices for the luma plane.*/ + oc_mb_fill_ymapping(_mb_maps[mbi],_fplanes,mbx,mby); + /*Fill in the fragment indices for the chroma planes.*/ + (*mb_fill_cmapping)(_mb_maps[mbi],_fplanes,mbx,mby); + } + } + } + } +} + +/*Marks the fragments which fall all or partially outside the displayable + region of the frame. + _state: The Theora state containing the fragments to be marked.*/ +static void oc_state_border_init(oc_theora_state *_state){ + oc_fragment *frag; + oc_fragment *yfrag_end; + oc_fragment *xfrag_end; + oc_fragment_plane *fplane; + int crop_x0; + int crop_y0; + int crop_xf; + int crop_yf; + int pli; + int y; + int x; + /*The method we use here is slow, but the code is dead simple and handles + all the special cases easily. + We only ever need to do it once.*/ + /*Loop through the fragments, marking those completely outside the + displayable region and constructing a border mask for those that straddle + the border.*/ + _state->nborders=0; + yfrag_end=frag=_state->frags; + for(pli=0;pli<3;pli++){ + fplane=_state->fplanes+pli; + /*Set up the cropping rectangle for this plane.*/ + crop_x0=_state->info.pic_x; + crop_xf=_state->info.pic_x+_state->info.pic_width; + crop_y0=_state->info.pic_y; + crop_yf=_state->info.pic_y+_state->info.pic_height; + if(pli>0){ + if(!(_state->info.pixel_fmt&1)){ + crop_x0=crop_x0>>1; + crop_xf=crop_xf+1>>1; + } + if(!(_state->info.pixel_fmt&2)){ + crop_y0=crop_y0>>1; + crop_yf=crop_yf+1>>1; + } + } + y=0; + for(yfrag_end+=fplane->nfrags;fragnhfrags;frag=crop_xf||crop_y0>=crop_yf){ + frag->invalid=1; + } + /*Otherwise, check to see if it straddles the border.*/ + else if(x=crop_x0&&x+j=crop_y0&&y+i=_state->nborders){ + _state->nborders++; + _state->borders[i].mask=mask; + _state->borders[i].npixels=npixels; + } + else if(_state->borders[i].mask!=mask)continue; + frag->borderi=i; + break; + } + } + else frag->borderi=-1; + } + } + } +} + +static int oc_state_frarray_init(oc_theora_state *_state){ + int yhfrags; + int yvfrags; + int chfrags; + int cvfrags; + ptrdiff_t yfrags; + ptrdiff_t cfrags; + ptrdiff_t nfrags; + unsigned yhsbs; + unsigned yvsbs; + unsigned chsbs; + unsigned cvsbs; + unsigned ysbs; + unsigned csbs; + unsigned nsbs; + size_t nmbs; + int hdec; + int vdec; + int pli; + /*Figure out the number of fragments in each plane.*/ + /*These parameters have already been validated to be multiples of 16.*/ + yhfrags=_state->info.frame_width>>3; + yvfrags=_state->info.frame_height>>3; + hdec=!(_state->info.pixel_fmt&1); + vdec=!(_state->info.pixel_fmt&2); + chfrags=yhfrags+hdec>>hdec; + cvfrags=yvfrags+vdec>>vdec; + yfrags=yhfrags*(ptrdiff_t)yvfrags; + cfrags=chfrags*(ptrdiff_t)cvfrags; + nfrags=yfrags+2*cfrags; + /*Figure out the number of super blocks in each plane.*/ + yhsbs=yhfrags+3>>2; + yvsbs=yvfrags+3>>2; + chsbs=chfrags+3>>2; + cvsbs=cvfrags+3>>2; + ysbs=yhsbs*yvsbs; + csbs=chsbs*cvsbs; + nsbs=ysbs+2*csbs; + nmbs=(size_t)ysbs<<2; + /*Check for overflow. + We support the ridiculous upper limits of the specification (1048560 by + 1048560, or 3 TB frames) if the target architecture has 64-bit pointers, + but for those with 32-bit pointers (or smaller!) we have to check. + If the caller wants to prevent denial-of-service by imposing a more + reasonable upper limit on the size of attempted allocations, they must do + so themselves; we have no platform independent way to determine how much + system memory there is nor an application-independent way to decide what a + "reasonable" allocation is.*/ + if(yfrags/yhfrags!=yvfrags||2*cfrags>2!=ysbs){ + return TH_EIMPL; + } + /*Initialize the fragment array.*/ + _state->fplanes[0].nhfrags=yhfrags; + _state->fplanes[0].nvfrags=yvfrags; + _state->fplanes[0].froffset=0; + _state->fplanes[0].nfrags=yfrags; + _state->fplanes[0].nhsbs=yhsbs; + _state->fplanes[0].nvsbs=yvsbs; + _state->fplanes[0].sboffset=0; + _state->fplanes[0].nsbs=ysbs; + _state->fplanes[1].nhfrags=_state->fplanes[2].nhfrags=chfrags; + _state->fplanes[1].nvfrags=_state->fplanes[2].nvfrags=cvfrags; + _state->fplanes[1].froffset=yfrags; + _state->fplanes[2].froffset=yfrags+cfrags; + _state->fplanes[1].nfrags=_state->fplanes[2].nfrags=cfrags; + _state->fplanes[1].nhsbs=_state->fplanes[2].nhsbs=chsbs; + _state->fplanes[1].nvsbs=_state->fplanes[2].nvsbs=cvsbs; + _state->fplanes[1].sboffset=ysbs; + _state->fplanes[2].sboffset=ysbs+csbs; + _state->fplanes[1].nsbs=_state->fplanes[2].nsbs=csbs; + _state->nfrags=nfrags; + _state->frags=_ogg_calloc(nfrags,sizeof(*_state->frags)); + _state->frag_mvs=_ogg_malloc(nfrags*sizeof(*_state->frag_mvs)); + _state->nsbs=nsbs; + _state->sb_maps=_ogg_malloc(nsbs*sizeof(*_state->sb_maps)); + _state->sb_flags=_ogg_calloc(nsbs,sizeof(*_state->sb_flags)); + _state->nhmbs=yhsbs<<1; + _state->nvmbs=yvsbs<<1; + _state->nmbs=nmbs; + _state->mb_maps=_ogg_calloc(nmbs,sizeof(*_state->mb_maps)); + _state->mb_modes=_ogg_calloc(nmbs,sizeof(*_state->mb_modes)); + _state->coded_fragis=_ogg_malloc(nfrags*sizeof(*_state->coded_fragis)); + if(_state->frags==NULL||_state->frag_mvs==NULL||_state->sb_maps==NULL|| + _state->sb_flags==NULL||_state->mb_maps==NULL||_state->mb_modes==NULL|| + _state->coded_fragis==NULL){ + return TH_EFAULT; + } + /*Create the mapping from super blocks to fragments.*/ + for(pli=0;pli<3;pli++){ + oc_fragment_plane *fplane; + fplane=_state->fplanes+pli; + oc_sb_create_plane_mapping(_state->sb_maps+fplane->sboffset, + _state->sb_flags+fplane->sboffset,fplane->froffset, + fplane->nhfrags,fplane->nvfrags); + } + /*Create the mapping from macro blocks to fragments.*/ + oc_mb_create_mapping(_state->mb_maps,_state->mb_modes, + _state->fplanes,_state->info.pixel_fmt); + /*Initialize the invalid and borderi fields of each fragment.*/ + oc_state_border_init(_state); + return 0; +} + +static void oc_state_frarray_clear(oc_theora_state *_state){ + _ogg_free(_state->coded_fragis); + _ogg_free(_state->mb_modes); + _ogg_free(_state->mb_maps); + _ogg_free(_state->sb_flags); + _ogg_free(_state->sb_maps); + _ogg_free(_state->frag_mvs); + _ogg_free(_state->frags); +} + + +/*Initializes the buffers used for reconstructed frames. + These buffers are padded with 16 extra pixels on each side, to allow + unrestricted motion vectors without special casing the boundary. + If chroma is decimated in either direction, the padding is reduced by a + factor of 2 on the appropriate sides. + _nrefs: The number of reference buffers to init; must be 3 or 4.*/ +static int oc_state_ref_bufs_init(oc_theora_state *_state,int _nrefs){ + th_info *info; + unsigned char *ref_frame_data; + size_t ref_frame_data_sz; + size_t ref_frame_sz; + size_t yplane_sz; + size_t cplane_sz; + int yhstride; + int yheight; + int chstride; + int cheight; + ptrdiff_t yoffset; + ptrdiff_t coffset; + ptrdiff_t *frag_buf_offs; + ptrdiff_t fragi; + int hdec; + int vdec; + int rfi; + int pli; + if(_nrefs<3||_nrefs>4)return TH_EINVAL; + info=&_state->info; + /*Compute the image buffer parameters for each plane.*/ + hdec=!(info->pixel_fmt&1); + vdec=!(info->pixel_fmt&2); + yhstride=info->frame_width+2*OC_UMV_PADDING; + yheight=info->frame_height+2*OC_UMV_PADDING; + chstride=yhstride>>hdec; + cheight=yheight>>vdec; + yplane_sz=yhstride*(size_t)yheight; + cplane_sz=chstride*(size_t)cheight; + yoffset=OC_UMV_PADDING+OC_UMV_PADDING*(ptrdiff_t)yhstride; + coffset=(OC_UMV_PADDING>>hdec)+(OC_UMV_PADDING>>vdec)*(ptrdiff_t)chstride; + ref_frame_sz=yplane_sz+2*cplane_sz; + ref_frame_data_sz=_nrefs*ref_frame_sz; + /*Check for overflow. + The same caveats apply as for oc_state_frarray_init().*/ + if(yplane_sz/yhstride!=yheight||2*cplane_szfrag_buf_offs= + _ogg_malloc(_state->nfrags*sizeof(*frag_buf_offs)); + if(ref_frame_data==NULL||frag_buf_offs==NULL){ + _ogg_free(frag_buf_offs); + _ogg_free(ref_frame_data); + return TH_EFAULT; + } + /*Set up the width, height and stride for the image buffers.*/ + _state->ref_frame_bufs[0][0].width=info->frame_width; + _state->ref_frame_bufs[0][0].height=info->frame_height; + _state->ref_frame_bufs[0][0].stride=yhstride; + _state->ref_frame_bufs[0][1].width=_state->ref_frame_bufs[0][2].width= + info->frame_width>>hdec; + _state->ref_frame_bufs[0][1].height=_state->ref_frame_bufs[0][2].height= + info->frame_height>>vdec; + _state->ref_frame_bufs[0][1].stride=_state->ref_frame_bufs[0][2].stride= + chstride; + for(rfi=1;rfi<_nrefs;rfi++){ + memcpy(_state->ref_frame_bufs[rfi],_state->ref_frame_bufs[0], + sizeof(_state->ref_frame_bufs[0])); + } + /*Set up the data pointers for the image buffers.*/ + for(rfi=0;rfi<_nrefs;rfi++){ + _state->ref_frame_data[rfi]=ref_frame_data; + _state->ref_frame_bufs[rfi][0].data=ref_frame_data+yoffset; + ref_frame_data+=yplane_sz; + _state->ref_frame_bufs[rfi][1].data=ref_frame_data+coffset; + ref_frame_data+=cplane_sz; + _state->ref_frame_bufs[rfi][2].data=ref_frame_data+coffset; + ref_frame_data+=cplane_sz; + /*Flip the buffer upside down. + This allows us to decode Theora's bottom-up frames in their natural + order, yet return a top-down buffer with a positive stride to the user.*/ + oc_ycbcr_buffer_flip(_state->ref_frame_bufs[rfi], + _state->ref_frame_bufs[rfi]); + } + _state->ref_ystride[0]=-yhstride; + _state->ref_ystride[1]=_state->ref_ystride[2]=-chstride; + /*Initialize the fragment buffer offsets.*/ + ref_frame_data=_state->ref_frame_data[0]; + fragi=0; + for(pli=0;pli<3;pli++){ + th_img_plane *iplane; + oc_fragment_plane *fplane; + unsigned char *vpix; + ptrdiff_t stride; + ptrdiff_t vfragi_end; + int nhfrags; + iplane=_state->ref_frame_bufs[0]+pli; + fplane=_state->fplanes+pli; + vpix=iplane->data; + vfragi_end=fplane->froffset+fplane->nfrags; + nhfrags=fplane->nhfrags; + stride=iplane->stride; + while(fragiref_frame_idx[OC_FRAME_GOLD]= + _state->ref_frame_idx[OC_FRAME_PREV]= + _state->ref_frame_idx[OC_FRAME_SELF]=-1; + _state->ref_frame_idx[OC_FRAME_IO]=_nrefs>3?3:-1; + return 0; +} + +static void oc_state_ref_bufs_clear(oc_theora_state *_state){ + _ogg_free(_state->frag_buf_offs); + _ogg_free(_state->ref_frame_data[0]); +} + + +void oc_state_vtable_init_c(oc_theora_state *_state){ + _state->opt_vtable.frag_copy=oc_frag_copy_c; + _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_c; + _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_c; + _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_c; + _state->opt_vtable.idct8x8=oc_idct8x8_c; + _state->opt_vtable.state_frag_recon=oc_state_frag_recon_c; + _state->opt_vtable.state_frag_copy_list=oc_state_frag_copy_list_c; + _state->opt_vtable.state_loop_filter_frag_rows= + oc_state_loop_filter_frag_rows_c; + _state->opt_vtable.restore_fpu=oc_restore_fpu_c; + _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG; +} + +/*Initialize the accelerated function pointers.*/ +void oc_state_vtable_init(oc_theora_state *_state){ +#if defined(OC_X86_ASM) + oc_state_vtable_init_x86(_state); +#else + oc_state_vtable_init_c(_state); +#endif +} + + +int oc_state_init(oc_theora_state *_state,const th_info *_info,int _nrefs){ + int ret; + /*First validate the parameters.*/ + if(_info==NULL)return TH_EFAULT; + /*The width and height of the encoded frame must be multiples of 16. + They must also, when divided by 16, fit into a 16-bit unsigned integer. + The displayable frame offset coordinates must fit into an 8-bit unsigned + integer. + Note that the offset Y in the API is specified on the opposite side from + how it is specified in the bitstream, because the Y axis is flipped in + the bitstream. + The displayable frame must fit inside the encoded frame. + The color space must be one known by the encoder.*/ + if((_info->frame_width&0xF)||(_info->frame_height&0xF)|| + _info->frame_width<=0||_info->frame_width>=0x100000|| + _info->frame_height<=0||_info->frame_height>=0x100000|| + _info->pic_x+_info->pic_width>_info->frame_width|| + _info->pic_y+_info->pic_height>_info->frame_height|| + _info->pic_x>255||_info->frame_height-_info->pic_height-_info->pic_y>255|| + /*Note: the following <0 comparisons may generate spurious warnings on + platforms where enums are unsigned. + We could cast them to unsigned and just use the following >= comparison, + but there are a number of compilers which will mis-optimize this. + It's better to live with the spurious warnings.*/ + _info->colorspace<0||_info->colorspace>=TH_CS_NSPACES|| + _info->pixel_fmt<0||_info->pixel_fmt>=TH_PF_NFORMATS){ + return TH_EINVAL; + } + memset(_state,0,sizeof(*_state)); + memcpy(&_state->info,_info,sizeof(*_info)); + /*Invert the sense of pic_y to match Theora's right-handed coordinate + system.*/ + _state->info.pic_y=_info->frame_height-_info->pic_height-_info->pic_y; + _state->frame_type=OC_UNKWN_FRAME; + oc_state_vtable_init(_state); + ret=oc_state_frarray_init(_state); + if(ret>=0)ret=oc_state_ref_bufs_init(_state,_nrefs); + if(ret<0){ + oc_state_frarray_clear(_state); + return ret; + } + /*If the keyframe_granule_shift is out of range, use the maximum allowable + value.*/ + if(_info->keyframe_granule_shift<0||_info->keyframe_granule_shift>31){ + _state->info.keyframe_granule_shift=31; + } + _state->keyframe_num=0; + _state->curframe_num=-1; + /*3.2.0 streams mark the frame index instead of the frame count. + This was changed with stream version 3.2.1 to conform to other Ogg + codecs. + We add an extra bias when computing granule positions for new streams.*/ + _state->granpos_bias=TH_VERSION_CHECK(_info,3,2,1); + return 0; +} + +void oc_state_clear(oc_theora_state *_state){ + oc_state_ref_bufs_clear(_state); + oc_state_frarray_clear(_state); +} + + +/*Duplicates the pixels on the border of the image plane out into the + surrounding padding for use by unrestricted motion vectors. + This function only adds the left and right borders, and only for the fragment + rows specified. + _refi: The index of the reference buffer to pad. + _pli: The color plane. + _y0: The Y coordinate of the first row to pad. + _yend: The Y coordinate of the row to stop padding at.*/ +void oc_state_borders_fill_rows(oc_theora_state *_state,int _refi,int _pli, + int _y0,int _yend){ + th_img_plane *iplane; + unsigned char *apix; + unsigned char *bpix; + unsigned char *epix; + int stride; + int hpadding; + hpadding=OC_UMV_PADDING>>(_pli!=0&&!(_state->info.pixel_fmt&1)); + iplane=_state->ref_frame_bufs[_refi]+_pli; + stride=iplane->stride; + apix=iplane->data+_y0*(ptrdiff_t)stride; + bpix=apix+iplane->width-1; + epix=iplane->data+_yend*(ptrdiff_t)stride; + /*Note the use of != instead of <, which allows the stride to be negative.*/ + while(apix!=epix){ + memset(apix-hpadding,apix[0],hpadding); + memset(bpix+1,bpix[0],hpadding); + apix+=stride; + bpix+=stride; + } +} + +/*Duplicates the pixels on the border of the image plane out into the + surrounding padding for use by unrestricted motion vectors. + This function only adds the top and bottom borders, and must be called after + the left and right borders are added. + _refi: The index of the reference buffer to pad. + _pli: The color plane.*/ +void oc_state_borders_fill_caps(oc_theora_state *_state,int _refi,int _pli){ + th_img_plane *iplane; + unsigned char *apix; + unsigned char *bpix; + unsigned char *epix; + int stride; + int hpadding; + int vpadding; + int fullw; + hpadding=OC_UMV_PADDING>>(_pli!=0&&!(_state->info.pixel_fmt&1)); + vpadding=OC_UMV_PADDING>>(_pli!=0&&!(_state->info.pixel_fmt&2)); + iplane=_state->ref_frame_bufs[_refi]+_pli; + stride=iplane->stride; + fullw=iplane->width+(hpadding<<1); + apix=iplane->data-hpadding; + bpix=iplane->data+(iplane->height-1)*(ptrdiff_t)stride-hpadding; + epix=apix-stride*(ptrdiff_t)vpadding; + while(apix!=epix){ + memcpy(apix-stride,apix,fullw); + memcpy(bpix+stride,bpix,fullw); + apix-=stride; + bpix+=stride; + } +} + +/*Duplicates the pixels on the border of the given reference image out into + the surrounding padding for use by unrestricted motion vectors. + _state: The context containing the reference buffers. + _refi: The index of the reference buffer to pad.*/ +void oc_state_borders_fill(oc_theora_state *_state,int _refi){ + int pli; + for(pli=0;pli<3;pli++){ + oc_state_borders_fill_rows(_state,_refi,pli,0, + _state->ref_frame_bufs[_refi][pli].height); + oc_state_borders_fill_caps(_state,_refi,pli); + } +} + +/*Determines the offsets in an image buffer to use for motion compensation. + _state: The Theora state the offsets are to be computed with. + _offsets: Returns the offset for the buffer(s). + _offsets[0] is always set. + _offsets[1] is set if the motion vector has non-zero fractional + components. + _pli: The color plane index. + _dx: The X component of the motion vector. + _dy: The Y component of the motion vector. + Return: The number of offsets returned: 1 or 2.*/ +int oc_state_get_mv_offsets(const oc_theora_state *_state,int _offsets[2], + int _pli,int _dx,int _dy){ + /*Here is a brief description of how Theora handles motion vectors: + Motion vector components are specified to half-pixel accuracy in + undecimated directions of each plane, and quarter-pixel accuracy in + decimated directions. + Integer parts are extracted by dividing (not shifting) by the + appropriate amount, with truncation towards zero. + These integer values are used to calculate the first offset. + + If either of the fractional parts are non-zero, then a second offset is + computed. + No third or fourth offsets are computed, even if both components have + non-zero fractional parts. + The second offset is computed by dividing (not shifting) by the + appropriate amount, always truncating _away_ from zero.*/ +#if 0 + /*This version of the code doesn't use any tables, but is slower.*/ + int ystride; + int xprec; + int yprec; + int xfrac; + int yfrac; + int offs; + ystride=_state->ref_ystride[_pli]; + /*These two variables decide whether we are in half- or quarter-pixel + precision in each component.*/ + xprec=1+(_pli!=0&&!(_state->info.pixel_fmt&1)); + yprec=1+(_pli!=0&&!(_state->info.pixel_fmt&2)); + /*These two variables are either 0 if all the fractional bits are zero or -1 + if any of them are non-zero.*/ + xfrac=OC_SIGNMASK(-(_dx&(xprec|1))); + yfrac=OC_SIGNMASK(-(_dy&(yprec|1))); + offs=(_dx>>xprec)+(_dy>>yprec)*ystride; + if(xfrac||yfrac){ + int xmask; + int ymask; + xmask=OC_SIGNMASK(_dx); + ymask=OC_SIGNMASK(_dy); + yfrac&=ystride; + _offsets[0]=offs-(xfrac&xmask)+(yfrac&ymask); + _offsets[1]=offs-(xfrac&~xmask)+(yfrac&~ymask); + return 2; + } + else{ + _offsets[0]=offs; + return 1; + } +#else + /*Using tables simplifies the code, and there's enough arithmetic to hide the + latencies of the memory references.*/ + static const signed char OC_MVMAP[2][64]={ + { + -15,-15,-14,-14,-13,-13,-12,-12,-11,-11,-10,-10, -9, -9, -8, + -8, -7, -7, -6, -6, -5, -5, -4, -4, -3, -3, -2, -2, -1, -1, 0, + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, + 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15 + }, + { + -7, -7, -7, -7, -6, -6, -6, -6, -5, -5, -5, -5, -4, -4, -4, + -4, -3, -3, -3, -3, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7 + } + }; + static const signed char OC_MVMAP2[2][64]={ + { + -1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, + 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, 0,-1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 + }, + { + -1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, + 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, 0,-1,-1,-1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1 + } + }; + int ystride; + int qpx; + int qpy; + int mx; + int my; + int mx2; + int my2; + int offs; + ystride=_state->ref_ystride[_pli]; + qpy=_pli!=0&&!(_state->info.pixel_fmt&2); + my=OC_MVMAP[qpy][_dy+31]; + my2=OC_MVMAP2[qpy][_dy+31]; + qpx=_pli!=0&&!(_state->info.pixel_fmt&1); + mx=OC_MVMAP[qpx][_dx+31]; + mx2=OC_MVMAP2[qpx][_dx+31]; + offs=my*ystride+mx; + if(mx2||my2){ + _offsets[1]=offs+my2*ystride+mx2; + _offsets[0]=offs; + return 2; + } + _offsets[0]=offs; + return 1; +#endif +} + +void oc_state_frag_recon(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ + _state->opt_vtable.state_frag_recon(_state,_fragi,_pli,_dct_coeffs, + _last_zzi,_dc_quant); +} + +void oc_state_frag_recon_c(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ + unsigned char *dst; + ptrdiff_t frag_buf_off; + int ystride; + int mb_mode; + /*Apply the inverse transform.*/ + /*Special case only having a DC component.*/ + if(_last_zzi<2){ + ogg_int16_t p; + int ci; + /*We round this dequant product (and not any of the others) because there's + no iDCT rounding.*/ + p=(ogg_int16_t)(_dct_coeffs[0]*(ogg_int32_t)_dc_quant+15>>5); + /*LOOP VECTORIZES.*/ + for(ci=0;ci<64;ci++)_dct_coeffs[ci]=p; + } + else{ + /*First, dequantize the DC coefficient.*/ + _dct_coeffs[0]=(ogg_int16_t)(_dct_coeffs[0]*(int)_dc_quant); + oc_idct8x8(_state,_dct_coeffs,_last_zzi); + } + /*Fill in the target buffer.*/ + frag_buf_off=_state->frag_buf_offs[_fragi]; + mb_mode=_state->frags[_fragi].mb_mode; + ystride=_state->ref_ystride[_pli]; + dst=_state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_SELF]]+frag_buf_off; + if(mb_mode==OC_MODE_INTRA)oc_frag_recon_intra(_state,dst,ystride,_dct_coeffs); + else{ + const unsigned char *ref; + int mvoffsets[2]; + ref= + _state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_FOR_MODE(mb_mode)]] + +frag_buf_off; + if(oc_state_get_mv_offsets(_state,mvoffsets,_pli, + _state->frag_mvs[_fragi][0],_state->frag_mvs[_fragi][1])>1){ + oc_frag_recon_inter2(_state, + dst,ref+mvoffsets[0],ref+mvoffsets[1],ystride,_dct_coeffs); + } + else oc_frag_recon_inter(_state,dst,ref+mvoffsets[0],ystride,_dct_coeffs); + } +} + +/*Copies the fragments specified by the lists of fragment indices from one + frame to another. + _fragis: A pointer to a list of fragment indices. + _nfragis: The number of fragment indices to copy. + _dst_frame: The reference frame to copy to. + _src_frame: The reference frame to copy from. + _pli: The color plane the fragments lie in.*/ +void oc_state_frag_copy_list(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli){ + _state->opt_vtable.state_frag_copy_list(_state,_fragis,_nfragis,_dst_frame, + _src_frame,_pli); +} + +void oc_state_frag_copy_list_c(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli){ + const ptrdiff_t *frag_buf_offs; + const unsigned char *src_frame_data; + unsigned char *dst_frame_data; + ptrdiff_t fragii; + int ystride; + dst_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_dst_frame]]; + src_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_src_frame]]; + ystride=_state->ref_ystride[_pli]; + frag_buf_offs=_state->frag_buf_offs; + for(fragii=0;fragii<_nfragis;fragii++){ + ptrdiff_t frag_buf_off; + frag_buf_off=frag_buf_offs[_fragis[fragii]]; + oc_frag_copy(_state,dst_frame_data+frag_buf_off, + src_frame_data+frag_buf_off,ystride); + } +} + +static void loop_filter_h(unsigned char *_pix,int _ystride,int *_bv){ + int y; + _pix-=2; + for(y=0;y<8;y++){ + int f; + f=_pix[0]-_pix[3]+3*(_pix[2]-_pix[1]); + /*The _bv array is used to compute the function + f=OC_CLAMPI(OC_MINI(-_2flimit-f,0),f,OC_MAXI(_2flimit-f,0)); + where _2flimit=_state->loop_filter_limits[_state->qis[0]]<<1;*/ + f=*(_bv+(f+4>>3)); + _pix[1]=OC_CLAMP255(_pix[1]+f); + _pix[2]=OC_CLAMP255(_pix[2]-f); + _pix+=_ystride; + } +} + +static void loop_filter_v(unsigned char *_pix,int _ystride,int *_bv){ + int x; + _pix-=_ystride*2; + for(x=0;x<8;x++){ + int f; + f=_pix[x]-_pix[_ystride*3+x]+3*(_pix[_ystride*2+x]-_pix[_ystride+x]); + /*The _bv array is used to compute the function + f=OC_CLAMPI(OC_MINI(-_2flimit-f,0),f,OC_MAXI(_2flimit-f,0)); + where _2flimit=_state->loop_filter_limits[_state->qis[0]]<<1;*/ + f=*(_bv+(f+4>>3)); + _pix[_ystride+x]=OC_CLAMP255(_pix[_ystride+x]+f); + _pix[_ystride*2+x]=OC_CLAMP255(_pix[_ystride*2+x]-f); + } +} + +/*Initialize the bounding values array used by the loop filter. + _bv: Storage for the array. + Return: 0 on success, or a non-zero value if no filtering need be applied.*/ +int oc_state_loop_filter_init(oc_theora_state *_state,int _bv[256]){ + int flimit; + int i; + flimit=_state->loop_filter_limits[_state->qis[0]]; + if(flimit==0)return 1; + memset(_bv,0,sizeof(_bv[0])*256); + for(i=0;i=0)_bv[127-i-flimit]=i-flimit; + _bv[127-i]=-i; + _bv[127+i]=i; + if(127+i+flimit<256)_bv[127+i+flimit]=flimit-i; + } + return 0; +} + +/*Apply the loop filter to a given set of fragment rows in the given plane. + The filter may be run on the bottom edge, affecting pixels in the next row of + fragments, so this row also needs to be available. + _bv: The bounding values array. + _refi: The index of the frame buffer to filter. + _pli: The color plane to filter. + _fragy0: The Y coordinate of the first fragment row to filter. + _fragy_end: The Y coordinate of the fragment row to stop filtering at.*/ +void oc_state_loop_filter_frag_rows(const oc_theora_state *_state,int _bv[256], + int _refi,int _pli,int _fragy0,int _fragy_end){ + _state->opt_vtable.state_loop_filter_frag_rows(_state,_bv,_refi,_pli, + _fragy0,_fragy_end); +} + +void oc_state_loop_filter_frag_rows_c(const oc_theora_state *_state,int *_bv, + int _refi,int _pli,int _fragy0,int _fragy_end){ + const oc_fragment_plane *fplane; + const oc_fragment *frags; + const ptrdiff_t *frag_buf_offs; + unsigned char *ref_frame_data; + ptrdiff_t fragi_top; + ptrdiff_t fragi_bot; + ptrdiff_t fragi0; + ptrdiff_t fragi0_end; + int ystride; + int nhfrags; + _bv+=127; + fplane=_state->fplanes+_pli; + nhfrags=fplane->nhfrags; + fragi_top=fplane->froffset; + fragi_bot=fragi_top+fplane->nfrags; + fragi0=fragi_top+_fragy0*(ptrdiff_t)nhfrags; + fragi0_end=fragi0+(_fragy_end-_fragy0)*(ptrdiff_t)nhfrags; + ystride=_state->ref_ystride[_pli]; + frags=_state->frags; + frag_buf_offs=_state->frag_buf_offs; + ref_frame_data=_state->ref_frame_data[_refi]; + /*The following loops are constructed somewhat non-intuitively on purpose. + The main idea is: if a block boundary has at least one coded fragment on + it, the filter is applied to it. + However, the order that the filters are applied in matters, and VP3 chose + the somewhat strange ordering used below.*/ + while(fragi0fragi0)loop_filter_h(ref,ystride,_bv); + if(fragi0>fragi_top)loop_filter_v(ref,ystride,_bv); + if(fragi+1info.frame_width; + height=_state->info.frame_height; + iframe=_state->granpos>>_state->info.keyframe_granule_shift; + pframe=_state->granpos-(iframe<<_state->info.keyframe_granule_shift); + sprintf(fname,"%08i%s.png",(int)(iframe+pframe),_suf); + fp=fopen(fname,"wb"); + if(fp==NULL)return TH_EFAULT; + image=(png_bytep *)oc_malloc_2d(height,6*width,sizeof(**image)); + if(image==NULL){ + fclose(fp); + return TH_EFAULT; + } + png=png_create_write_struct(PNG_LIBPNG_VER_STRING,NULL,NULL,NULL); + if(png==NULL){ + oc_free_2d(image); + fclose(fp); + return TH_EFAULT; + } + info=png_create_info_struct(png); + if(info==NULL){ + png_destroy_write_struct(&png,NULL); + oc_free_2d(image); + fclose(fp); + return TH_EFAULT; + } + if(setjmp(png_jmpbuf(png))){ + png_destroy_write_struct(&png,&info); + oc_free_2d(image); + fclose(fp); + return TH_EFAULT; + } + framei=_state->ref_frame_idx[_frame]; + y_row=_state->ref_frame_bufs[framei][0].data; + u_row=_state->ref_frame_bufs[framei][1].data; + v_row=_state->ref_frame_bufs[framei][2].data; + y_stride=_state->ref_frame_bufs[framei][0].stride; + u_stride=_state->ref_frame_bufs[framei][1].stride; + v_stride=_state->ref_frame_bufs[framei][2].stride; + /*Chroma up-sampling is just done with a box filter. + This is very likely what will actually be used in practice on a real + display, and also removes one more layer to search in for the source of + artifacts. + As an added bonus, it's dead simple.*/ + for(imgi=height;imgi-->0;){ + int dc; + y=y_row; + u=u_row; + v=v_row; + for(imgj=0;imgj<6*width;){ + float yval; + float uval; + float vval; + unsigned rval; + unsigned gval; + unsigned bval; + /*This is intentionally slow and very accurate.*/ + yval=(*y-16)*(1.0F/219); + uval=(*u-128)*(2*(1-0.114F)/224); + vval=(*v-128)*(2*(1-0.299F)/224); + rval=OC_CLAMPI(0,(int)(65535*(yval+vval)+0.5F),65535); + gval=OC_CLAMPI(0,(int)(65535*( + yval-uval*(0.114F/0.587F)-vval*(0.299F/0.587F))+0.5F),65535); + bval=OC_CLAMPI(0,(int)(65535*(yval+uval)+0.5F),65535); + image[imgi][imgj++]=(unsigned char)(rval>>8); + image[imgi][imgj++]=(unsigned char)(rval&0xFF); + image[imgi][imgj++]=(unsigned char)(gval>>8); + image[imgi][imgj++]=(unsigned char)(gval&0xFF); + image[imgi][imgj++]=(unsigned char)(bval>>8); + image[imgi][imgj++]=(unsigned char)(bval&0xFF); + dc=(y-y_row&1)|(_state->info.pixel_fmt&1); + y++; + u+=dc; + v+=dc; + } + dc=-((height-1-imgi&1)|_state->info.pixel_fmt>>1); + y_row+=y_stride; + u_row+=dc&u_stride; + v_row+=dc&v_stride; + } + png_init_io(png,fp); + png_set_compression_level(png,Z_BEST_COMPRESSION); + png_set_IHDR(png,info,width,height,16,PNG_COLOR_TYPE_RGB, + PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); + switch(_state->info.colorspace){ + case TH_CS_ITU_REC_470M:{ + png_set_gAMA(png,info,2.2); + png_set_cHRM_fixed(png,info,31006,31616, + 67000,32000,21000,71000,14000,8000); + }break; + case TH_CS_ITU_REC_470BG:{ + png_set_gAMA(png,info,2.67); + png_set_cHRM_fixed(png,info,31271,32902, + 64000,33000,29000,60000,15000,6000); + }break; + default:break; + } + png_set_pHYs(png,info,_state->info.aspect_numerator, + _state->info.aspect_denominator,0); + png_set_rows(png,info,image); + png_write_png(png,info,PNG_TRANSFORM_IDENTITY,NULL); + png_write_end(png,info); + png_destroy_write_struct(&png,&info); + oc_free_2d(image); + fclose(fp); + return 0; +} +#endif + + + +ogg_int64_t th_granule_frame(void *_encdec,ogg_int64_t _granpos){ + oc_theora_state *state; + state=(oc_theora_state *)_encdec; + if(_granpos>=0){ + ogg_int64_t iframe; + ogg_int64_t pframe; + iframe=_granpos>>state->info.keyframe_granule_shift; + pframe=_granpos-(iframe<info.keyframe_granule_shift); + /*3.2.0 streams store the frame index in the granule position. + 3.2.1 and later store the frame count. + We return the index, so adjust the value if we have a 3.2.1 or later + stream.*/ + return iframe+pframe-TH_VERSION_CHECK(&state->info,3,2,1); + } + return -1; +} + +double th_granule_time(void *_encdec,ogg_int64_t _granpos){ + oc_theora_state *state; + state=(oc_theora_state *)_encdec; + if(_granpos>=0){ + return (th_granule_frame(_encdec, _granpos)+1)*( + (double)state->info.fps_denominator/state->info.fps_numerator); + } + return -1; +} diff --git a/libs/libtheora-1.1/lib/theora.def b/libs/libtheora-1.1/lib/theora.def new file mode 100644 index 00000000..22e4d659 --- /dev/null +++ b/libs/libtheora-1.1/lib/theora.def @@ -0,0 +1,56 @@ +LIBRARY libtheora +EXPORTS + theora_version_string + theora_version_number + theora_encode_init + theora_encode_YUVin + theora_encode_packetout + theora_encode_header + theora_encode_comment + theora_encode_tables + theora_decode_header + theora_decode_init + theora_decode_packetin + theora_decode_YUVout + theora_control + theora_packet_isheader + theora_packet_iskeyframe + theora_granule_shift + theora_granule_frame + theora_granule_time + theora_info_init + theora_info_clear + theora_clear + theora_comment_init + theora_comment_add + theora_comment_add_tag + theora_comment_query + theora_comment_query_count + theora_comment_clear + th_version_string + th_version_number + th_decode_headerin + th_decode_alloc + th_setup_free + th_decode_ctl + th_decode_packetin + th_decode_ycbcr_out + th_decode_free + th_packet_isheader + th_packet_iskeyframe + th_granule_frame + th_granule_time + th_info_init + th_info_clear + th_comment_init + th_comment_add + th_comment_add_tag + th_comment_query + th_comment_query_count + th_comment_clear + th_encode_alloc + th_encode_ctl + th_encode_flushheader + th_encode_packetout + th_encode_ycbcr_in + th_encode_free diff --git a/libs/libtheora-1.1/lib/theora.exp b/libs/libtheora-1.1/lib/theora.exp new file mode 100644 index 00000000..b4e0225f --- /dev/null +++ b/libs/libtheora-1.1/lib/theora.exp @@ -0,0 +1,55 @@ +# export list for libtheora +_theora_version_string +_theora_version_number +_theora_encode_init +_theora_encode_YUVin +_theora_encode_packetout +_theora_encode_header +_theora_encode_comment +_theora_encode_tables +_theora_decode_header +_theora_decode_init +_theora_decode_packetin +_theora_decode_YUVout +_theora_control +_theora_packet_isheader +_theora_packet_iskeyframe +_theora_granule_shift +_theora_granule_frame +_theora_granule_time +_theora_info_init +_theora_info_clear +_theora_clear +_theora_comment_init +_theora_comment_add +_theora_comment_add_tag +_theora_comment_query +_theora_comment_query_count +_theora_comment_clear +_th_version_string +_th_version_number +_th_decode_headerin +_th_decode_alloc +_th_setup_free +_th_decode_ctl +_th_decode_packetin +_th_decode_ycbcr_out +_th_decode_free +_th_packet_isheader +_th_packet_iskeyframe +_th_granule_frame +_th_granule_time +_th_info_init +_th_info_clear +_th_comment_init +_th_comment_add +_th_comment_add_tag +_th_comment_query +_th_comment_query_count +_th_comment_clear +_th_encode_alloc +_th_encode_ctl +_th_encode_flushheader +_th_encode_packetout +_th_encode_ycbcr_in +_th_encode_free diff --git a/libs/libtheora-1.1/lib/theoradec.exp b/libs/libtheora-1.1/lib/theoradec.exp new file mode 100644 index 00000000..41dec1c3 --- /dev/null +++ b/libs/libtheora-1.1/lib/theoradec.exp @@ -0,0 +1,43 @@ +# export list for theoradec +_th_version_string +_th_version_number +_th_decode_headerin +_th_decode_alloc +_th_setup_free +_th_decode_ctl +_th_decode_packetin +_th_decode_ycbcr_out +_th_decode_free +_th_packet_isheader +_th_packet_iskeyframe +_th_granule_frame +_th_granule_time +_th_info_init +_th_info_clear +_th_comment_init +_th_comment_add +_th_comment_add_tag +_th_comment_query +_th_comment_query_count +_th_comment_clear +_theora_version_string +_theora_version_number +_theora_decode_header +_theora_decode_init +_theora_decode_packetin +_theora_decode_YUVout +_theora_control +_theora_packet_isheader +_theora_packet_iskeyframe +_theora_granule_shift +_theora_granule_frame +_theora_granule_time +_theora_info_init +_theora_info_clear +_theora_clear +_theora_comment_init +_theora_comment_add +_theora_comment_add_tag +_theora_comment_query +_theora_comment_query_count +_theora_comment_clear diff --git a/libs/libtheora-1.1/lib/theoraenc.exp b/libs/libtheora-1.1/lib/theoraenc.exp new file mode 100644 index 00000000..d278455e --- /dev/null +++ b/libs/libtheora-1.1/lib/theoraenc.exp @@ -0,0 +1,15 @@ +# export list for theoraenc +_th_encode_alloc +_th_encode_ctl +_th_encode_flushheader +_th_encode_ycbcr_in +_th_encode_packetout +_th_encode_free +_TH_VP31_QUANT_INFO +_TH_VP31_HUFF_CODES +_theora_encode_init +_theora_encode_YUVin +_theora_encode_packetout +_theora_encode_header +_theora_encode_comment +_theora_encode_tables diff --git a/libs/libtheora-1.1/lib/tokenize.c b/libs/libtheora-1.1/lib/tokenize.c new file mode 100644 index 00000000..8533b9ff --- /dev/null +++ b/libs/libtheora-1.1/lib/tokenize.c @@ -0,0 +1,1072 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: tokenize.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ +#include +#include +#include "encint.h" + + + +static int oc_make_eob_token(int _run_count){ + if(_run_count<4)return OC_DCT_EOB1_TOKEN+_run_count-1; + else{ + int cat; + cat=OC_ILOGNZ_32(_run_count)-3; + cat=OC_MINI(cat,3); + return OC_DCT_REPEAT_RUN0_TOKEN+cat; + } +} + +static int oc_make_eob_token_full(int _run_count,int *_eb){ + if(_run_count<4){ + *_eb=0; + return OC_DCT_EOB1_TOKEN+_run_count-1; + } + else{ + int cat; + cat=OC_ILOGNZ_32(_run_count)-3; + cat=OC_MINI(cat,3); + *_eb=_run_count-OC_BYTE_TABLE32(4,8,16,0,cat); + return OC_DCT_REPEAT_RUN0_TOKEN+cat; + } +} + +/*Returns the number of blocks ended by an EOB token.*/ +static int oc_decode_eob_token(int _token,int _eb){ + return (0x20820C41U>>_token*5&0x1F)+_eb; +} + +/*TODO: This is now only used during DCT tokenization, and never for runs; it + should be simplified.*/ +static int oc_make_dct_token_full(int _zzi,int _zzj,int _val,int *_eb){ + int neg; + int zero_run; + int token; + int eb; + neg=_val<0; + _val=abs(_val); + zero_run=_zzj-_zzi; + if(zero_run>0){ + int adj; + /*Implement a minor restriction on stack 1 so that we know during DC fixups + that extending a dctrun token from stack 1 will never overflow.*/ + adj=_zzi!=1; + if(_val<2&&zero_run<17+adj){ + if(zero_run<6){ + token=OC_DCT_RUN_CAT1A+zero_run-1; + eb=neg; + } + else if(zero_run<10){ + token=OC_DCT_RUN_CAT1B; + eb=zero_run-6+(neg<<2); + } + else{ + token=OC_DCT_RUN_CAT1C; + eb=zero_run-10+(neg<<3); + } + } + else if(_val<4&&zero_run<3+adj){ + if(zero_run<2){ + token=OC_DCT_RUN_CAT2A; + eb=_val-2+(neg<<1); + } + else{ + token=OC_DCT_RUN_CAT2B; + eb=zero_run-2+(_val-2<<1)+(neg<<2); + } + } + else{ + if(zero_run<9)token=OC_DCT_SHORT_ZRL_TOKEN; + else token=OC_DCT_ZRL_TOKEN; + eb=zero_run-1; + } + } + else if(_val<3){ + token=OC_ONE_TOKEN+(_val-1<<1)+neg; + eb=0; + } + else if(_val<7){ + token=OC_DCT_VAL_CAT2+_val-3; + eb=neg; + } + else if(_val<9){ + token=OC_DCT_VAL_CAT3; + eb=_val-7+(neg<<1); + } + else if(_val<13){ + token=OC_DCT_VAL_CAT4; + eb=_val-9+(neg<<2); + } + else if(_val<21){ + token=OC_DCT_VAL_CAT5; + eb=_val-13+(neg<<3); + } + else if(_val<37){ + token=OC_DCT_VAL_CAT6; + eb=_val-21+(neg<<4); + } + else if(_val<69){ + token=OC_DCT_VAL_CAT7; + eb=_val-37+(neg<<5); + } + else{ + token=OC_DCT_VAL_CAT8; + eb=_val-69+(neg<<9); + } + *_eb=eb; + return token; +} + +/*Token logging to allow a few fragments of efficient rollback. + Late SKIP analysis is tied up in the tokenization process, so we need to be + able to undo a fragment's tokens on a whim.*/ + +static const unsigned char OC_ZZI_HUFF_OFFSET[64]={ + 0,16,16,16,16,16,32,32, + 32,32,32,32,32,32,32,48, + 48,48,48,48,48,48,48,48, + 48,48,48,48,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64 +}; + +static int oc_token_bits(oc_enc_ctx *_enc,int _huffi,int _zzi,int _token){ + return _enc->huff_codes[_huffi+OC_ZZI_HUFF_OFFSET[_zzi]][_token].nbits + +OC_DCT_TOKEN_EXTRA_BITS[_token]; +} + +static void oc_enc_tokenlog_checkpoint(oc_enc_ctx *_enc, + oc_token_checkpoint *_cp,int _pli,int _zzi){ + _cp->pli=_pli; + _cp->zzi=_zzi; + _cp->eob_run=_enc->eob_run[_pli][_zzi]; + _cp->ndct_tokens=_enc->ndct_tokens[_pli][_zzi]; +} + +void oc_enc_tokenlog_rollback(oc_enc_ctx *_enc, + const oc_token_checkpoint *_stack,int _n){ + int i; + for(i=_n;i-->0;){ + int pli; + int zzi; + pli=_stack[i].pli; + zzi=_stack[i].zzi; + _enc->eob_run[pli][zzi]=_stack[i].eob_run; + _enc->ndct_tokens[pli][zzi]=_stack[i].ndct_tokens; + } +} + +static void oc_enc_token_log(oc_enc_ctx *_enc, + int _pli,int _zzi,int _token,int _eb){ + ptrdiff_t ti; + ti=_enc->ndct_tokens[_pli][_zzi]++; + _enc->dct_tokens[_pli][_zzi][ti]=(unsigned char)_token; + _enc->extra_bits[_pli][_zzi][ti]=(ogg_uint16_t)_eb; +} + +static void oc_enc_eob_log(oc_enc_ctx *_enc, + int _pli,int _zzi,int _run_count){ + int token; + int eb; + token=oc_make_eob_token_full(_run_count,&eb); + oc_enc_token_log(_enc,_pli,_zzi,token,eb); +} + + +void oc_enc_tokenize_start(oc_enc_ctx *_enc){ + memset(_enc->ndct_tokens,0,sizeof(_enc->ndct_tokens)); + memset(_enc->eob_run,0,sizeof(_enc->eob_run)); + memset(_enc->dct_token_offs,0,sizeof(_enc->dct_token_offs)); + memset(_enc->dc_pred_last,0,sizeof(_enc->dc_pred_last)); +} + +typedef struct oc_quant_token oc_quant_token; + +/*A single node in the Viterbi trellis. + We maintain up to 2 of these per coefficient: + - A token to code if the value is zero (EOB, zero run, or combo token). + - A token to code if the value is not zero (DCT value token).*/ +struct oc_quant_token{ + unsigned char next; + signed char token; + ogg_int16_t eb; + ogg_uint32_t cost; + int bits; + int qc; +}; + +/*Tokenizes the AC coefficients, possibly adjusting the quantization, and then + dequantizes and de-zig-zags the result. + The DC coefficient is not preserved; it should be restored by the caller.*/ +int oc_enc_tokenize_ac(oc_enc_ctx *_enc,int _pli,ptrdiff_t _fragi, + ogg_int16_t *_qdct,const ogg_uint16_t *_dequant,const ogg_int16_t *_dct, + int _zzi,oc_token_checkpoint **_stack,int _acmin){ + oc_token_checkpoint *stack; + ogg_int64_t zflags; + ogg_int64_t nzflags; + ogg_int64_t best_flags; + ogg_uint32_t d2_accum[64]; + oc_quant_token tokens[64][2]; + ogg_uint16_t *eob_run; + const unsigned char *dct_fzig_zag; + ogg_uint32_t cost; + int bits; + int eob; + int token; + int eb; + int next; + int huffi; + int zzi; + int ti; + int zzj; + int qc; + huffi=_enc->huff_idxs[_enc->state.frame_type][1][_pli+1>>1]; + eob_run=_enc->eob_run[_pli]; + memset(tokens[0],0,sizeof(tokens[0])); + best_flags=nzflags=0; + zflags=1; + d2_accum[0]=0; + zzj=64; + for(zzi=OC_MINI(_zzi,63);zzi>0;zzi--){ + ogg_int32_t lambda; + ogg_uint32_t best_cost; + int best_bits=best_bits; + int best_next=best_next; + int best_token=best_token; + int best_eb=best_eb; + int best_qc=best_qc; + int flush_bits; + ogg_uint32_t d2; + int dq; + int e; + int c; + int s; + int tj; + lambda=_enc->lambda; + qc=_qdct[zzi]; + s=-(qc<0); + qc=qc+s^s; + c=_dct[OC_FZIG_ZAG[zzi]]; + if(qc<=1){ + ogg_uint32_t sum_d2; + int nzeros; + int dc_reserve; + /*The hard case: try a zero run.*/ + if(!qc){ + /*Skip runs that are already quantized to zeros. + If we considered each zero coefficient in turn, we might + theoretically find a better way to partition long zero runs (e.g., + a run of > 17 zeros followed by a 1 might be better coded as a short + zero run followed by a combo token, rather than the longer zero + token followed by a 1 value token), but zeros are so common that + this becomes very computationally expensive (quadratic instead of + linear in the number of coefficients), for a marginal gain.*/ + while(zzi>1&&!_qdct[zzi-1])zzi--; + /*The distortion of coefficients originally quantized to zero is + treated as zero (since we'll never quantize them to anything else).*/ + d2=0; + } + else{ + c=c+s^s; + d2=c*(ogg_int32_t)c; + } + eob=eob_run[zzi]; + nzeros=zzj-zzi; + zzj&=63; + sum_d2=d2+d2_accum[zzj]; + d2_accum[zzi]=sum_d2; + flush_bits=eob>0?oc_token_bits(_enc,huffi,zzi,oc_make_eob_token(eob)):0; + /*We reserve 1 spot for combo run tokens that start in the 1st AC stack + to ensure they can be extended to include the DC coefficient if + necessary; this greatly simplifies stack-rewriting later on.*/ + dc_reserve=zzi+62>>6; + best_cost=0xFFFFFFFF; + for(;;){ + if(nzflags>>zzj&1){ + int cat; + int val; + int val_s; + int zzk; + int tk; + next=tokens[zzj][1].next; + tk=next&1; + zzk=next>>1; + /*Try a pure zero run to this point.*/ + cat=nzeros+55>>6; + token=OC_DCT_SHORT_ZRL_TOKEN+cat; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + d2=sum_d2-d2_accum[zzj]; + cost=d2+lambda*bits+tokens[zzj][1].cost; + if(cost<=best_cost){ + best_next=(zzj<<1)+1; + best_token=token; + best_eb=nzeros-1; + best_cost=cost; + best_bits=bits+tokens[zzj][1].bits; + best_qc=0; + } + if(nzeros<16+dc_reserve){ + val=_qdct[zzj]; + val_s=-(val<0); + val=val+val_s^val_s; + if(val<=2){ + /*Try a +/- 1 combo token.*/ + if(nzeros<6){ + token=OC_DCT_RUN_CAT1A+nzeros-1; + eb=-val_s; + } + else{ + cat=nzeros+54>>6; + token=OC_DCT_RUN_CAT1B+cat; + eb=(-val_s<>1; + token=OC_DCT_RUN_CAT2A+cat; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + val=2+((val+val_s^val_s)>2); + e=(_dct[OC_FZIG_ZAG[zzj]]+val_s^val_s)-_dequant[zzj]*val; + d2=e*(ogg_int32_t)e+sum_d2-d2_accum[zzj]; + cost=d2+lambda*bits+tokens[zzk][tk].cost; + if(cost<=best_cost){ + best_cost=cost; + best_bits=bits+tokens[zzk][tk].bits; + best_next=next; + best_token=token; + best_eb=(-val_s<<1+cat)+(val-2<>1); + best_qc=val+val_s^val_s; + } + } + } + /*zzj can't be coded as a zero, so stop trying to extend the run.*/ + if(!(zflags>>zzj&1))break; + } + /*We could try to consider _all_ potentially non-zero coefficients, but + if we already found a bunch of them not worth coding, it's fairly + unlikely they would now be worth coding from this position; skipping + them saves a lot of work.*/ + zzj=(tokens[zzj][0].next>>1)-(tokens[zzj][0].qc!=0)&63; + if(zzj==0){ + /*We made it all the way to the end of the block; try an EOB token.*/ + if(eob<4095){ + bits=oc_token_bits(_enc,huffi,zzi,oc_make_eob_token(eob+1)) + -flush_bits; + } + else bits=oc_token_bits(_enc,huffi,zzi,OC_DCT_EOB1_TOKEN); + cost=sum_d2+bits*lambda; + /*If the best route so far is still a pure zero run to the end of the + block, force coding it as an EOB. + Even if it's not optimal for this block, it has a good chance of + getting combined with an EOB token from subsequent blocks, saving + bits overall.*/ + if(cost<=best_cost||best_token<=OC_DCT_ZRL_TOKEN&&zzi+best_eb==63){ + best_next=0; + /*This token is just a marker; in reality we may not emit any + tokens, but update eob_run[] instead.*/ + best_token=OC_DCT_EOB1_TOKEN; + best_eb=0; + best_cost=cost; + best_bits=bits; + best_qc=0; + } + break; + } + nzeros=zzj-zzi; + } + tokens[zzi][0].next=(unsigned char)best_next; + tokens[zzi][0].token=(signed char)best_token; + tokens[zzi][0].eb=(ogg_int16_t)best_eb; + tokens[zzi][0].cost=best_cost; + tokens[zzi][0].bits=best_bits; + tokens[zzi][0].qc=best_qc; + zflags|=(ogg_int64_t)1<>zzj&1; + next=(zzj<<1)+tj; + tokens[zzi][1].next=(unsigned char)next; + tokens[zzi][1].token=(signed char)token; + tokens[zzi][1].eb=0; + tokens[zzi][1].cost=d2+lambda*bits+tokens[zzj][tj].cost; + tokens[zzi][1].bits=bits+tokens[zzj][tj].bits; + tokens[zzi][1].qc=1+s^s; + nzflags|=(ogg_int64_t)1<0?oc_token_bits(_enc,huffi,zzi,oc_make_eob_token(eob)):0; + if(qc<=2){ + e=2*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_TWO_TOKEN-s; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e-=dq; + d2=e*(ogg_int32_t)e; + token=OC_ONE_TOKEN-s; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_bits=bits; + best_cost=cost; + qc--; + } + best_eb=0; + } + else if(qc<=3){ + e=3*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT2; + best_eb=-s; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e-=dq; + d2=e*(ogg_int32_t)e; + token=OC_TWO_TOKEN-s; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_eb=0; + best_bits=bits; + best_cost=cost; + qc--; + } + } + else if(qc<=6){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT2+qc-3; + best_eb=-s; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e-=dq; + d2=e*(ogg_int32_t)e; + token=best_token-1; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_bits=bits; + best_cost=cost; + qc--; + } + } + else if(qc<=8){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT3; + best_eb=(-s<<1)+qc-7; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e=6*dq-c; + d2=e*(ogg_int32_t)e; + token=OC_DCT_VAL_CAT2+3; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_eb=-s; + best_bits=bits; + best_cost=cost; + qc=6; + } + } + else if(qc<=12){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT4; + best_eb=(-s<<2)+qc-9; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e=8*dq-c; + d2=e*(ogg_int32_t)e; + token=best_token-1; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_eb=(-s<<1)+1; + best_bits=bits; + best_cost=cost; + qc=8; + } + } + else if(qc<=20){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT5; + best_eb=(-s<<3)+qc-13; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e=12*dq-c; + d2=e*(ogg_int32_t)e; + token=best_token-1; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_eb=(-s<<2)+3; + best_bits=bits; + best_cost=cost; + qc=12; + } + } + else if(qc<=36){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT6; + best_eb=(-s<<4)+qc-21; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e=20*dq-c; + d2=e*(ogg_int32_t)e; + token=best_token-1; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost<=best_cost){ + best_token=token; + best_eb=(-s<<3)+7; + best_bits=bits; + best_cost=cost; + qc=20; + } + } + else if(qc<=68){ + e=qc*dq-c; + d2=e*(ogg_int32_t)e; + best_token=OC_DCT_VAL_CAT7; + best_eb=(-s<<5)+qc-37; + best_bits=flush_bits+oc_token_bits(_enc,huffi,zzi,best_token); + best_cost=d2+lambda*best_bits; + e=36*dq-c; + d2=e*(ogg_int32_t)e; + token=best_token-1; + bits=flush_bits+oc_token_bits(_enc,huffi,zzi,token); + cost=d2+lambda*bits; + if(cost>zzj&1; + next=(zzj<<1)+tj; + tokens[zzi][1].next=(unsigned char)next; + tokens[zzi][1].token=(signed char)best_token; + tokens[zzi][1].eb=best_eb; + tokens[zzi][1].cost=best_cost+tokens[zzj][tj].cost; + tokens[zzi][1].bits=best_bits+tokens[zzj][tj].bits; + tokens[zzi][1].qc=qc+s^s; + nzflags|=(ogg_int64_t)1<state.opt_data.dct_fzig_zag; + zzi=1; + ti=best_flags>>1&1; + bits=tokens[zzi][ti].bits; + do{ + oc_enc_tokenlog_checkpoint(_enc,stack++,_pli,zzi); + eob=eob_run[zzi]; + if(tokens[zzi][ti].token=4095){ + oc_enc_eob_log(_enc,_pli,zzi,eob); + eob=0; + } + eob_run[zzi]=eob; + /*We don't include the actual EOB cost for this block in the return value. + It will be paid for by the fragment that terminates the EOB run.*/ + bits-=tokens[zzi][ti].bits; + zzi=_zzi; + break; + } + /*Emit pending EOB run if any.*/ + if(eob>0){ + oc_enc_eob_log(_enc,_pli,zzi,eob); + eob_run[zzi]=0; + } + oc_enc_token_log(_enc,_pli,zzi,tokens[zzi][ti].token,tokens[zzi][ti].eb); + next=tokens[zzi][ti].next; + qc=tokens[zzi][ti].qc; + zzj=(next>>1)-1&63; + /*TODO: It may be worth saving the dequantized coefficient in the trellis + above; we had to compute it to measure the error anyway.*/ + _qdct[dct_fzig_zag[zzj]]=(ogg_int16_t)(qc*(int)_dequant[zzj]); + zzi=next>>1; + ti=next&1; + } + while(zzi); + *_stack=stack; + return bits; +} + +void oc_enc_pred_dc_frag_rows(oc_enc_ctx *_enc, + int _pli,int _fragy0,int _frag_yend){ + const oc_fragment_plane *fplane; + const oc_fragment *frags; + ogg_int16_t *frag_dc; + ptrdiff_t fragi; + int *pred_last; + int nhfrags; + int fragx; + int fragy; + fplane=_enc->state.fplanes+_pli; + frags=_enc->state.frags; + frag_dc=_enc->frag_dc; + pred_last=_enc->dc_pred_last[_pli]; + nhfrags=fplane->nhfrags; + fragi=fplane->froffset+_fragy0*nhfrags; + for(fragy=_fragy0;fragy<_frag_yend;fragy++){ + if(fragy==0){ + /*For the first row, all of the cases reduce to just using the previous + predictor for the same reference frame.*/ + for(fragx=0;fragx=nhfrags)ur_ref=-1; + else{ + ur_ref=u_frags[fragi+1].coded? + OC_FRAME_FOR_MODE(u_frags[fragi+1].mb_mode):-1; + } + if(frags[fragi].coded){ + int pred; + int ref; + ref=OC_FRAME_FOR_MODE(frags[fragi].mb_mode); + /*We break out a separate case based on which of our neighbors use + the same reference frames. + This is somewhat faster than trying to make a generic case which + handles all of them, since it reduces lots of poorly predicted + jumps to one switch statement, and also lets a number of the + multiplications be optimized out by strength reduction.*/ + switch((l_ref==ref)|(ul_ref==ref)<<1| + (u_ref==ref)<<2|(ur_ref==ref)<<3){ + default:pred=pred_last[ref];break; + case 1: + case 3:pred=frags[fragi-1].dc;break; + case 2:pred=u_frags[fragi-1].dc;break; + case 4: + case 6: + case 12:pred=u_frags[fragi].dc;break; + case 5:pred=(frags[fragi-1].dc+u_frags[fragi].dc)/2;break; + case 8:pred=u_frags[fragi+1].dc;break; + case 9: + case 11: + case 13:{ + pred=(75*frags[fragi-1].dc+53*u_frags[fragi+1].dc)/128; + }break; + case 10:pred=(u_frags[fragi-1].dc+u_frags[fragi+1].dc)/2;break; + case 14:{ + pred=(3*(u_frags[fragi-1].dc+u_frags[fragi+1].dc) + +10*u_frags[fragi].dc)/16; + }break; + case 7: + case 15:{ + int p0; + int p1; + int p2; + p0=frags[fragi-1].dc; + p1=u_frags[fragi-1].dc; + p2=u_frags[fragi].dc; + pred=(29*(p0+p2)-26*p1)/32; + if(abs(pred-p2)>128)pred=p2; + else if(abs(pred-p0)>128)pred=p0; + else if(abs(pred-p1)>128)pred=p1; + }break; + } + frag_dc[fragi]=(ogg_int16_t)(frags[fragi].dc-pred); + pred_last[ref]=frags[fragi].dc; + l_ref=ref; + } + else l_ref=-1; + ul_ref=u_ref; + u_ref=ur_ref; + } + } + } +} + +void oc_enc_tokenize_dc_frag_list(oc_enc_ctx *_enc,int _pli, + const ptrdiff_t *_coded_fragis,ptrdiff_t _ncoded_fragis, + int _prev_ndct_tokens1,int _prev_eob_run1){ + const ogg_int16_t *frag_dc; + ptrdiff_t fragii; + unsigned char *dct_tokens0; + unsigned char *dct_tokens1; + ogg_uint16_t *extra_bits0; + ogg_uint16_t *extra_bits1; + ptrdiff_t ti0; + ptrdiff_t ti1r; + ptrdiff_t ti1w; + int eob_run0; + int eob_run1; + int neobs1; + int token; + int eb; + int token1=token1; + int eb1=eb1; + /*Return immediately if there are no coded fragments; otherwise we'd flush + any trailing EOB run into the AC 1 list and never read it back out.*/ + if(_ncoded_fragis<=0)return; + frag_dc=_enc->frag_dc; + dct_tokens0=_enc->dct_tokens[_pli][0]; + dct_tokens1=_enc->dct_tokens[_pli][1]; + extra_bits0=_enc->extra_bits[_pli][0]; + extra_bits1=_enc->extra_bits[_pli][1]; + ti0=_enc->ndct_tokens[_pli][0]; + ti1w=ti1r=_prev_ndct_tokens1; + eob_run0=_enc->eob_run[_pli][0]; + /*Flush any trailing EOB run for the 1st AC coefficient. + This is needed to allow us to track tokens to the end of the list.*/ + eob_run1=_enc->eob_run[_pli][1]; + if(eob_run1>0)oc_enc_eob_log(_enc,_pli,1,eob_run1); + /*If there was an active EOB run at the start of the 1st AC stack, read it + in and decode it.*/ + if(_prev_eob_run1>0){ + token1=dct_tokens1[ti1r]; + eb1=extra_bits1[ti1r]; + ti1r++; + eob_run1=oc_decode_eob_token(token1,eb1); + /*Consume the portion of the run that came before these fragments.*/ + neobs1=eob_run1-_prev_eob_run1; + } + else eob_run1=neobs1=0; + for(fragii=0;fragii<_ncoded_fragis;fragii++){ + int val; + /*All tokens in the 1st AC coefficient stack are regenerated as the DC + coefficients are produced. + This can be done in-place; stack 1 cannot get larger.*/ + if(!neobs1){ + /*There's no active EOB run in stack 1; read the next token.*/ + token1=dct_tokens1[ti1r]; + eb1=extra_bits1[ti1r]; + ti1r++; + if(token10){ + token=oc_make_eob_token_full(eob_run0,&eb); + dct_tokens0[ti0]=(unsigned char)token; + extra_bits0[ti0]=(ogg_uint16_t)eb; + ti0++; + eob_run0=0; + } + token=oc_make_dct_token_full(0,0,val,&eb); + dct_tokens0[ti0]=(unsigned char)token; + extra_bits0[ti0]=(ogg_uint16_t)eb; + ti0++; + } + else{ + /*Zero DC value; that means the entry in stack 1 might need to be coded + from stack 0. + This requires a stack 1 fixup.*/ + if(neobs1>0){ + /*We're in the middle of an active EOB run in stack 1. + Move it to stack 0.*/ + if(++eob_run0>=4095){ + token=oc_make_eob_token_full(eob_run0,&eb); + dct_tokens0[ti0]=(unsigned char)token; + extra_bits0[ti0]=(ogg_uint16_t)eb; + ti0++; + eob_run0=0; + } + eob_run1--; + } + else{ + /*No active EOB run in stack 1, so we can't extend one in stack 0. + Flush it if we've got it.*/ + if(eob_run0>0){ + token=oc_make_eob_token_full(eob_run0,&eb); + dct_tokens0[ti0]=(unsigned char)token; + extra_bits0[ti0]=(ogg_uint16_t)eb; + ti0++; + eob_run0=0; + } + /*Stack 1 token is one of: a pure zero run token, a single + coefficient token, or a zero run/coefficient combo token. + A zero run token is expanded and moved to token stack 0, and the + stack 1 entry dropped. + A single coefficient value may be transformed into combo token that + is moved to stack 0, or if it cannot be combined, it is left alone + and a single length-1 zero run is emitted in stack 0. + A combo token is extended and moved to stack 0. + During AC coding, we restrict the run lengths on combo tokens for + stack 1 to guarantee we can extend them.*/ + switch(token1){ + case OC_DCT_SHORT_ZRL_TOKEN:{ + if(eb1<7){ + dct_tokens0[ti0]=OC_DCT_SHORT_ZRL_TOKEN; + extra_bits0[ti0]=(ogg_uint16_t)(eb1+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + continue; + } + /*Fall through.*/ + } + case OC_DCT_ZRL_TOKEN:{ + dct_tokens0[ti0]=OC_DCT_ZRL_TOKEN; + extra_bits0[ti0]=(ogg_uint16_t)(eb1+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_ONE_TOKEN: + case OC_MINUS_ONE_TOKEN:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT1A; + extra_bits0[ti0]=(ogg_uint16_t)(token1-OC_ONE_TOKEN); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_TWO_TOKEN: + case OC_MINUS_TWO_TOKEN:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT2A; + extra_bits0[ti0]=(ogg_uint16_t)(token1-OC_TWO_TOKEN<<1); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_DCT_VAL_CAT2:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT2A; + extra_bits0[ti0]=(ogg_uint16_t)((eb1<<1)+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_DCT_RUN_CAT1A: + case OC_DCT_RUN_CAT1A+1: + case OC_DCT_RUN_CAT1A+2: + case OC_DCT_RUN_CAT1A+3:{ + dct_tokens0[ti0]=(unsigned char)(token1+1); + extra_bits0[ti0]=(ogg_uint16_t)eb1; + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_DCT_RUN_CAT1A+4:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT1B; + extra_bits0[ti0]=(ogg_uint16_t)(eb1<<2); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_DCT_RUN_CAT1B:{ + if((eb1&3)<3){ + dct_tokens0[ti0]=OC_DCT_RUN_CAT1B; + extra_bits0[ti0]=(ogg_uint16_t)(eb1+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + continue; + } + eb1=((eb1&4)<<1)-1; + /*Fall through.*/ + } + case OC_DCT_RUN_CAT1C:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT1C; + extra_bits0[ti0]=(ogg_uint16_t)(eb1+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + case OC_DCT_RUN_CAT2A:{ + eb1=(eb1<<1)-1; + /*Fall through.*/ + } + case OC_DCT_RUN_CAT2B:{ + dct_tokens0[ti0]=OC_DCT_RUN_CAT2B; + extra_bits0[ti0]=(ogg_uint16_t)(eb1+1); + ti0++; + /*Don't write the AC coefficient back out.*/ + }continue; + } + /*We can't merge tokens, write a short zero run and keep going.*/ + dct_tokens0[ti0]=OC_DCT_SHORT_ZRL_TOKEN; + extra_bits0[ti0]=0; + ti0++; + } + } + if(!neobs1){ + /*Flush any (inactive) EOB run.*/ + if(eob_run1>0){ + token=oc_make_eob_token_full(eob_run1,&eb); + dct_tokens1[ti1w]=(unsigned char)token; + extra_bits1[ti1w]=(ogg_uint16_t)eb; + ti1w++; + eob_run1=0; + } + /*There's no active EOB run, so log the current token.*/ + dct_tokens1[ti1w]=(unsigned char)token1; + extra_bits1[ti1w]=(ogg_uint16_t)eb1; + ti1w++; + } + else{ + /*Otherwise consume one EOB from the current run.*/ + neobs1--; + /*If we have more than 4095 EOBs outstanding in stack1, flush the run.*/ + if(eob_run1-neobs1>=4095){ + token=oc_make_eob_token_full(4095,&eb); + dct_tokens1[ti1w]=(unsigned char)token; + extra_bits1[ti1w]=(ogg_uint16_t)eb; + ti1w++; + eob_run1-=4095; + } + } + } + /*Save the current state.*/ + _enc->ndct_tokens[_pli][0]=ti0; + _enc->ndct_tokens[_pli][1]=ti1w; + _enc->eob_run[_pli][0]=eob_run0; + _enc->eob_run[_pli][1]=eob_run1; +} + +/*Final EOB run welding.*/ +void oc_enc_tokenize_finish(oc_enc_ctx *_enc){ + int pli; + int zzi; + /*Emit final EOB runs.*/ + for(pli=0;pli<3;pli++)for(zzi=0;zzi<64;zzi++){ + int eob_run; + eob_run=_enc->eob_run[pli][zzi]; + if(eob_run>0)oc_enc_eob_log(_enc,pli,zzi,eob_run); + } + /*Merge the final EOB run of one token list with the start of the next, if + possible.*/ + for(zzi=0;zzi<64;zzi++)for(pli=0;pli<3;pli++){ + int old_tok1; + int old_tok2; + int old_eb1; + int old_eb2; + int new_tok; + int new_eb; + int zzj; + int plj; + ptrdiff_t ti=ti; + int run_count; + /*Make sure this coefficient has tokens at all.*/ + if(_enc->ndct_tokens[pli][zzi]<=0)continue; + /*Ensure the first token is an EOB run.*/ + old_tok2=_enc->dct_tokens[pli][zzi][0]; + if(old_tok2>=OC_NDCT_EOB_TOKEN_MAX)continue; + /*Search for a previous coefficient that has any tokens at all.*/ + old_tok1=OC_NDCT_EOB_TOKEN_MAX; + for(zzj=zzi,plj=pli;zzj>=0;zzj--){ + while(plj-->0){ + ti=_enc->ndct_tokens[plj][zzj]-1; + if(ti>=_enc->dct_token_offs[plj][zzj]){ + old_tok1=_enc->dct_tokens[plj][zzj][ti]; + break; + } + } + if(plj>=0)break; + plj=3; + } + /*Ensure its last token was an EOB run.*/ + if(old_tok1>=OC_NDCT_EOB_TOKEN_MAX)continue; + /*Pull off the associated extra bits, if any, and decode the runs.*/ + old_eb1=_enc->extra_bits[plj][zzj][ti]; + old_eb2=_enc->extra_bits[pli][zzi][0]; + run_count=oc_decode_eob_token(old_tok1,old_eb1) + +oc_decode_eob_token(old_tok2,old_eb2); + /*We can't possibly combine these into one run. + It might be possible to split them more optimally, but we'll just leave + them as-is.*/ + if(run_count>=4096)continue; + /*We CAN combine them into one run.*/ + new_tok=oc_make_eob_token_full(run_count,&new_eb); + _enc->dct_tokens[plj][zzj][ti]=(unsigned char)new_tok; + _enc->extra_bits[plj][zzj][ti]=(ogg_uint16_t)new_eb; + _enc->dct_token_offs[pli][zzi]++; + } +} diff --git a/libs/libtheora-1.1/lib/x86/mmxencfrag.c b/libs/libtheora-1.1/lib/x86/mmxencfrag.c new file mode 100644 index 00000000..c79ff01f --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxencfrag.c @@ -0,0 +1,900 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: dsp_mmx.c 14579 2008-03-12 06:42:40Z xiphmont $ + + ********************************************************************/ +#include +#include "x86enc.h" + +#if defined(OC_X86_ASM) + +unsigned oc_enc_frag_sad_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride){ + ptrdiff_t ystride3; + ptrdiff_t ret; + __asm__ __volatile__( + /*Load the first 4 rows of each block.*/ + "movq (%[src]),%%mm0\n\t" + "movq (%[ref]),%%mm1\n\t" + "movq (%[src],%[ystride]),%%mm2\n\t" + "movq (%[ref],%[ystride]),%%mm3\n\t" + "lea (%[ystride],%[ystride],2),%[ystride3]\n\t" + "movq (%[src],%[ystride],2),%%mm4\n\t" + "movq (%[ref],%[ystride],2),%%mm5\n\t" + "movq (%[src],%[ystride3]),%%mm6\n\t" + "movq (%[ref],%[ystride3]),%%mm7\n\t" + /*Compute their SADs and add them in %%mm0*/ + "psadbw %%mm1,%%mm0\n\t" + "psadbw %%mm3,%%mm2\n\t" + "lea (%[src],%[ystride],4),%[src]\n\t" + "paddw %%mm2,%%mm0\n\t" + "lea (%[ref],%[ystride],4),%[ref]\n\t" + /*Load the next 3 rows as registers become available.*/ + "movq (%[src]),%%mm2\n\t" + "movq (%[ref]),%%mm3\n\t" + "psadbw %%mm5,%%mm4\n\t" + "psadbw %%mm7,%%mm6\n\t" + "paddw %%mm4,%%mm0\n\t" + "movq (%[ref],%[ystride]),%%mm5\n\t" + "movq (%[src],%[ystride]),%%mm4\n\t" + "paddw %%mm6,%%mm0\n\t" + "movq (%[ref],%[ystride],2),%%mm7\n\t" + "movq (%[src],%[ystride],2),%%mm6\n\t" + /*Start adding their SADs to %%mm0*/ + "psadbw %%mm3,%%mm2\n\t" + "psadbw %%mm5,%%mm4\n\t" + "paddw %%mm2,%%mm0\n\t" + "psadbw %%mm7,%%mm6\n\t" + /*Load last row as registers become available.*/ + "movq (%[src],%[ystride3]),%%mm2\n\t" + "movq (%[ref],%[ystride3]),%%mm3\n\t" + /*And finish adding up their SADs.*/ + "paddw %%mm4,%%mm0\n\t" + "psadbw %%mm3,%%mm2\n\t" + "paddw %%mm6,%%mm0\n\t" + "paddw %%mm2,%%mm0\n\t" + "movd %%mm0,%[ret]\n\t" + :[ret]"=a"(ret),[src]"+%r"(_src),[ref]"+r"(_ref),[ystride3]"=&r"(ystride3) + :[ystride]"r"((ptrdiff_t)_ystride) + ); + return (unsigned)ret; +} + +unsigned oc_enc_frag_sad_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + /*Early termination is for suckers.*/ + return oc_enc_frag_sad_mmxext(_src,_ref,_ystride); +} + +/*Assumes the first two rows of %[ref1] and %[ref2] are in %%mm0...%%mm3, the + first two rows of %[src] are in %%mm4,%%mm5, and {1}x8 is in %%mm7. + We pre-load the next two rows of data as registers become available.*/ +#define OC_SAD2_LOOP \ + "#OC_SAD2_LOOP\n\t" \ + /*We want to compute (%%mm0+%%mm1>>1) on unsigned bytes without overflow, but \ + pavgb computes (%%mm0+%%mm1+1>>1). \ + The latter is exactly 1 too large when the low bit of two corresponding \ + bytes is only set in one of them. \ + Therefore we pxor the operands, pand to mask out the low bits, and psubb to \ + correct the output of pavgb.*/ \ + "movq %%mm0,%%mm6\n\t" \ + "lea (%[ref1],%[ystride],2),%[ref1]\n\t" \ + "pxor %%mm1,%%mm0\n\t" \ + "pavgb %%mm1,%%mm6\n\t" \ + "lea (%[ref2],%[ystride],2),%[ref2]\n\t" \ + "movq %%mm2,%%mm1\n\t" \ + "pand %%mm7,%%mm0\n\t" \ + "pavgb %%mm3,%%mm2\n\t" \ + "pxor %%mm3,%%mm1\n\t" \ + "movq (%[ref2],%[ystride]),%%mm3\n\t" \ + "psubb %%mm0,%%mm6\n\t" \ + "movq (%[ref1]),%%mm0\n\t" \ + "pand %%mm7,%%mm1\n\t" \ + "psadbw %%mm6,%%mm4\n\t" \ + "movd %[ret],%%mm6\n\t" \ + "psubb %%mm1,%%mm2\n\t" \ + "movq (%[ref2]),%%mm1\n\t" \ + "lea (%[src],%[ystride],2),%[src]\n\t" \ + "psadbw %%mm2,%%mm5\n\t" \ + "movq (%[ref1],%[ystride]),%%mm2\n\t" \ + "paddw %%mm4,%%mm5\n\t" \ + "movq (%[src]),%%mm4\n\t" \ + "paddw %%mm5,%%mm6\n\t" \ + "movq (%[src],%[ystride]),%%mm5\n\t" \ + "movd %%mm6,%[ret]\n\t" \ + +/*Same as above, but does not pre-load the next two rows.*/ +#define OC_SAD2_TAIL \ + "#OC_SAD2_TAIL\n\t" \ + "movq %%mm0,%%mm6\n\t" \ + "pavgb %%mm1,%%mm0\n\t" \ + "pxor %%mm1,%%mm6\n\t" \ + "movq %%mm2,%%mm1\n\t" \ + "pand %%mm7,%%mm6\n\t" \ + "pavgb %%mm3,%%mm2\n\t" \ + "pxor %%mm3,%%mm1\n\t" \ + "psubb %%mm6,%%mm0\n\t" \ + "pand %%mm7,%%mm1\n\t" \ + "psadbw %%mm0,%%mm4\n\t" \ + "psubb %%mm1,%%mm2\n\t" \ + "movd %[ret],%%mm6\n\t" \ + "psadbw %%mm2,%%mm5\n\t" \ + "paddw %%mm4,%%mm5\n\t" \ + "paddw %%mm5,%%mm6\n\t" \ + "movd %%mm6,%[ret]\n\t" \ + +unsigned oc_enc_frag_sad2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + ptrdiff_t ret; + __asm__ __volatile__( + "movq (%[ref1]),%%mm0\n\t" + "movq (%[ref2]),%%mm1\n\t" + "movq (%[ref1],%[ystride]),%%mm2\n\t" + "movq (%[ref2],%[ystride]),%%mm3\n\t" + "xor %[ret],%[ret]\n\t" + "movq (%[src]),%%mm4\n\t" + "pxor %%mm7,%%mm7\n\t" + "pcmpeqb %%mm6,%%mm6\n\t" + "movq (%[src],%[ystride]),%%mm5\n\t" + "psubb %%mm6,%%mm7\n\t" + OC_SAD2_LOOP + OC_SAD2_LOOP + OC_SAD2_LOOP + OC_SAD2_TAIL + :[ret]"=&a"(ret),[src]"+r"(_src),[ref1]"+%r"(_ref1),[ref2]"+r"(_ref2) + :[ystride]"r"((ptrdiff_t)_ystride) + ); + return (unsigned)ret; +} + +/*Load an 8x4 array of pixel values from %[src] and %[ref] and compute their + 16-bit difference in %%mm0...%%mm7.*/ +#define OC_LOAD_SUB_8x4(_off) \ + "#OC_LOAD_SUB_8x4\n\t" \ + "movd "_off"(%[src]),%%mm0\n\t" \ + "movd "_off"(%[ref]),%%mm4\n\t" \ + "movd "_off"(%[src],%[src_ystride]),%%mm1\n\t" \ + "lea (%[src],%[src_ystride],2),%[src]\n\t" \ + "movd "_off"(%[ref],%[ref_ystride]),%%mm5\n\t" \ + "lea (%[ref],%[ref_ystride],2),%[ref]\n\t" \ + "movd "_off"(%[src]),%%mm2\n\t" \ + "movd "_off"(%[ref]),%%mm7\n\t" \ + "movd "_off"(%[src],%[src_ystride]),%%mm3\n\t" \ + "movd "_off"(%[ref],%[ref_ystride]),%%mm6\n\t" \ + "punpcklbw %%mm4,%%mm0\n\t" \ + "lea (%[src],%[src_ystride],2),%[src]\n\t" \ + "punpcklbw %%mm4,%%mm4\n\t" \ + "lea (%[ref],%[ref_ystride],2),%[ref]\n\t" \ + "psubw %%mm4,%%mm0\n\t" \ + "movd "_off"(%[src]),%%mm4\n\t" \ + "movq %%mm0,"_off"*2(%[buf])\n\t" \ + "movd "_off"(%[ref]),%%mm0\n\t" \ + "punpcklbw %%mm5,%%mm1\n\t" \ + "punpcklbw %%mm5,%%mm5\n\t" \ + "psubw %%mm5,%%mm1\n\t" \ + "movd "_off"(%[src],%[src_ystride]),%%mm5\n\t" \ + "punpcklbw %%mm7,%%mm2\n\t" \ + "punpcklbw %%mm7,%%mm7\n\t" \ + "psubw %%mm7,%%mm2\n\t" \ + "movd "_off"(%[ref],%[ref_ystride]),%%mm7\n\t" \ + "punpcklbw %%mm6,%%mm3\n\t" \ + "lea (%[src],%[src_ystride],2),%[src]\n\t" \ + "punpcklbw %%mm6,%%mm6\n\t" \ + "psubw %%mm6,%%mm3\n\t" \ + "movd "_off"(%[src]),%%mm6\n\t" \ + "punpcklbw %%mm0,%%mm4\n\t" \ + "lea (%[ref],%[ref_ystride],2),%[ref]\n\t" \ + "punpcklbw %%mm0,%%mm0\n\t" \ + "lea (%[src],%[src_ystride],2),%[src]\n\t" \ + "psubw %%mm0,%%mm4\n\t" \ + "movd "_off"(%[ref]),%%mm0\n\t" \ + "punpcklbw %%mm7,%%mm5\n\t" \ + "neg %[src_ystride]\n\t" \ + "punpcklbw %%mm7,%%mm7\n\t" \ + "psubw %%mm7,%%mm5\n\t" \ + "movd "_off"(%[src],%[src_ystride]),%%mm7\n\t" \ + "punpcklbw %%mm0,%%mm6\n\t" \ + "lea (%[ref],%[ref_ystride],2),%[ref]\n\t" \ + "punpcklbw %%mm0,%%mm0\n\t" \ + "neg %[ref_ystride]\n\t" \ + "psubw %%mm0,%%mm6\n\t" \ + "movd "_off"(%[ref],%[ref_ystride]),%%mm0\n\t" \ + "lea (%[src],%[src_ystride],8),%[src]\n\t" \ + "punpcklbw %%mm0,%%mm7\n\t" \ + "neg %[src_ystride]\n\t" \ + "punpcklbw %%mm0,%%mm0\n\t" \ + "lea (%[ref],%[ref_ystride],8),%[ref]\n\t" \ + "psubw %%mm0,%%mm7\n\t" \ + "neg %[ref_ystride]\n\t" \ + "movq "_off"*2(%[buf]),%%mm0\n\t" \ + +/*Load an 8x4 array of pixel values from %[src] into %%mm0...%%mm7.*/ +#define OC_LOAD_8x4(_off) \ + "#OC_LOAD_8x4\n\t" \ + "movd "_off"(%[src]),%%mm0\n\t" \ + "movd "_off"(%[src],%[ystride]),%%mm1\n\t" \ + "movd "_off"(%[src],%[ystride],2),%%mm2\n\t" \ + "pxor %%mm7,%%mm7\n\t" \ + "movd "_off"(%[src],%[ystride3]),%%mm3\n\t" \ + "punpcklbw %%mm7,%%mm0\n\t" \ + "movd "_off"(%[src4]),%%mm4\n\t" \ + "punpcklbw %%mm7,%%mm1\n\t" \ + "movd "_off"(%[src4],%[ystride]),%%mm5\n\t" \ + "punpcklbw %%mm7,%%mm2\n\t" \ + "movd "_off"(%[src4],%[ystride],2),%%mm6\n\t" \ + "punpcklbw %%mm7,%%mm3\n\t" \ + "movd "_off"(%[src4],%[ystride3]),%%mm7\n\t" \ + "punpcklbw %%mm4,%%mm4\n\t" \ + "punpcklbw %%mm5,%%mm5\n\t" \ + "psrlw $8,%%mm4\n\t" \ + "psrlw $8,%%mm5\n\t" \ + "punpcklbw %%mm6,%%mm6\n\t" \ + "punpcklbw %%mm7,%%mm7\n\t" \ + "psrlw $8,%%mm6\n\t" \ + "psrlw $8,%%mm7\n\t" \ + +/*Performs the first two stages of an 8-point 1-D Hadamard transform. + The transform is performed in place, except that outputs 0-3 are swapped with + outputs 4-7. + Outputs 2, 3, 6 and 7 from the second stage are negated (which allows us to + perform this stage in place with no temporary registers).*/ +#define OC_HADAMARD_AB_8x4 \ + "#OC_HADAMARD_AB_8x4\n\t" \ + /*Stage A: \ + Outputs 0-3 are swapped with 4-7 here.*/ \ + "paddw %%mm1,%%mm5\n\t" \ + "paddw %%mm2,%%mm6\n\t" \ + "paddw %%mm1,%%mm1\n\t" \ + "paddw %%mm2,%%mm2\n\t" \ + "psubw %%mm5,%%mm1\n\t" \ + "psubw %%mm6,%%mm2\n\t" \ + "paddw %%mm3,%%mm7\n\t" \ + "paddw %%mm0,%%mm4\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + "paddw %%mm0,%%mm0\n\t" \ + "psubw %%mm7,%%mm3\n\t" \ + "psubw %%mm4,%%mm0\n\t" \ + /*Stage B:*/ \ + "paddw %%mm2,%%mm0\n\t" \ + "paddw %%mm3,%%mm1\n\t" \ + "paddw %%mm6,%%mm4\n\t" \ + "paddw %%mm7,%%mm5\n\t" \ + "paddw %%mm2,%%mm2\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + "paddw %%mm6,%%mm6\n\t" \ + "paddw %%mm7,%%mm7\n\t" \ + "psubw %%mm0,%%mm2\n\t" \ + "psubw %%mm1,%%mm3\n\t" \ + "psubw %%mm4,%%mm6\n\t" \ + "psubw %%mm5,%%mm7\n\t" \ + +/*Performs the last stage of an 8-point 1-D Hadamard transform in place. + Ouputs 1, 3, 5, and 7 are negated (which allows us to perform this stage in + place with no temporary registers).*/ +#define OC_HADAMARD_C_8x4 \ + "#OC_HADAMARD_C_8x4\n\t" \ + /*Stage C:*/ \ + "paddw %%mm1,%%mm0\n\t" \ + "paddw %%mm3,%%mm2\n\t" \ + "paddw %%mm5,%%mm4\n\t" \ + "paddw %%mm7,%%mm6\n\t" \ + "paddw %%mm1,%%mm1\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + "paddw %%mm5,%%mm5\n\t" \ + "paddw %%mm7,%%mm7\n\t" \ + "psubw %%mm0,%%mm1\n\t" \ + "psubw %%mm2,%%mm3\n\t" \ + "psubw %%mm4,%%mm5\n\t" \ + "psubw %%mm6,%%mm7\n\t" \ + +/*Performs an 8-point 1-D Hadamard transform. + The transform is performed in place, except that outputs 0-3 are swapped with + outputs 4-7. + Outputs 1, 2, 5 and 6 are negated (which allows us to perform the transform + in place with no temporary registers).*/ +#define OC_HADAMARD_8x4 \ + OC_HADAMARD_AB_8x4 \ + OC_HADAMARD_C_8x4 \ + +/*Performs the first part of the final stage of the Hadamard transform and + summing of absolute values. + At the end of this part, %%mm1 will contain the DC coefficient of the + transform.*/ +#define OC_HADAMARD_C_ABS_ACCUM_A_8x4(_r6,_r7) \ + /*We use the fact that \ + (abs(a+b)+abs(a-b))/2=max(abs(a),abs(b)) \ + to merge the final butterfly with the abs and the first stage of \ + accumulation. \ + Thus we can avoid using pabsw, which is not available until SSSE3. \ + Emulating pabsw takes 3 instructions, so the straightforward MMXEXT \ + implementation would be (3+3)*8+7=55 instructions (+4 for spilling \ + registers). \ + Even with pabsw, it would be (3+1)*8+7=39 instructions (with no spills). \ + This implementation is only 26 (+4 for spilling registers).*/ \ + "#OC_HADAMARD_C_ABS_ACCUM_A_8x4\n\t" \ + "movq %%mm7,"_r7"(%[buf])\n\t" \ + "movq %%mm6,"_r6"(%[buf])\n\t" \ + /*mm7={0x7FFF}x4 \ + mm0=max(abs(mm0),abs(mm1))-0x7FFF*/ \ + "pcmpeqb %%mm7,%%mm7\n\t" \ + "movq %%mm0,%%mm6\n\t" \ + "psrlw $1,%%mm7\n\t" \ + "paddw %%mm1,%%mm6\n\t" \ + "pmaxsw %%mm1,%%mm0\n\t" \ + "paddsw %%mm7,%%mm6\n\t" \ + "psubw %%mm6,%%mm0\n\t" \ + /*mm2=max(abs(mm2),abs(mm3))-0x7FFF \ + mm4=max(abs(mm4),abs(mm5))-0x7FFF*/ \ + "movq %%mm2,%%mm6\n\t" \ + "movq %%mm4,%%mm1\n\t" \ + "pmaxsw %%mm3,%%mm2\n\t" \ + "pmaxsw %%mm5,%%mm4\n\t" \ + "paddw %%mm3,%%mm6\n\t" \ + "paddw %%mm5,%%mm1\n\t" \ + "movq "_r7"(%[buf]),%%mm3\n\t" \ + +/*Performs the second part of the final stage of the Hadamard transform and + summing of absolute values.*/ +#define OC_HADAMARD_C_ABS_ACCUM_B_8x4(_r6,_r7) \ + "#OC_HADAMARD_C_ABS_ACCUM_B_8x4\n\t" \ + "paddsw %%mm7,%%mm6\n\t" \ + "movq "_r6"(%[buf]),%%mm5\n\t" \ + "paddsw %%mm7,%%mm1\n\t" \ + "psubw %%mm6,%%mm2\n\t" \ + "psubw %%mm1,%%mm4\n\t" \ + /*mm7={1}x4 (needed for the horizontal add that follows) \ + mm0+=mm2+mm4+max(abs(mm3),abs(mm5))-0x7FFF*/ \ + "movq %%mm3,%%mm6\n\t" \ + "pmaxsw %%mm5,%%mm3\n\t" \ + "paddw %%mm2,%%mm0\n\t" \ + "paddw %%mm5,%%mm6\n\t" \ + "paddw %%mm4,%%mm0\n\t" \ + "paddsw %%mm7,%%mm6\n\t" \ + "paddw %%mm3,%%mm0\n\t" \ + "psrlw $14,%%mm7\n\t" \ + "psubw %%mm6,%%mm0\n\t" \ + +/*Performs the last stage of an 8-point 1-D Hadamard transform, takes the + absolute value of each component, and accumulates everything into mm0. + This is the only portion of SATD which requires MMXEXT (we could use plain + MMX, but it takes 4 instructions and an extra register to work around the + lack of a pmaxsw, which is a pretty serious penalty).*/ +#define OC_HADAMARD_C_ABS_ACCUM_8x4(_r6,_r7) \ + OC_HADAMARD_C_ABS_ACCUM_A_8x4(_r6,_r7) \ + OC_HADAMARD_C_ABS_ACCUM_B_8x4(_r6,_r7) \ + +/*Performs an 8-point 1-D Hadamard transform, takes the absolute value of each + component, and accumulates everything into mm0. + Note that mm0 will have an extra 4 added to each column, and that after + removing this value, the remainder will be half the conventional value.*/ +#define OC_HADAMARD_ABS_ACCUM_8x4(_r6,_r7) \ + OC_HADAMARD_AB_8x4 \ + OC_HADAMARD_C_ABS_ACCUM_8x4(_r6,_r7) + +/*Performs two 4x4 transposes (mostly) in place. + On input, {mm0,mm1,mm2,mm3} contains rows {e,f,g,h}, and {mm4,mm5,mm6,mm7} + contains rows {a,b,c,d}. + On output, {0x40,0x50,0x60,0x70}+_off(%[buf]) contains {e,f,g,h}^T, and + {mm4,mm5,mm6,mm7} contains the transposed rows {a,b,c,d}^T.*/ +#define OC_TRANSPOSE_4x4x2(_off) \ + "#OC_TRANSPOSE_4x4x2\n\t" \ + /*First 4x4 transpose:*/ \ + "movq %%mm5,0x10+"_off"(%[buf])\n\t" \ + /*mm0 = e3 e2 e1 e0 \ + mm1 = f3 f2 f1 f0 \ + mm2 = g3 g2 g1 g0 \ + mm3 = h3 h2 h1 h0*/ \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklwd %%mm3,%%mm2\n\t" \ + "punpckhwd %%mm3,%%mm5\n\t" \ + "movq %%mm0,%%mm3\n\t" \ + "punpcklwd %%mm1,%%mm0\n\t" \ + "punpckhwd %%mm1,%%mm3\n\t" \ + /*mm0 = f1 e1 f0 e0 \ + mm3 = f3 e3 f2 e2 \ + mm2 = h1 g1 h0 g0 \ + mm5 = h3 g3 h2 g2*/ \ + "movq %%mm0,%%mm1\n\t" \ + "punpckldq %%mm2,%%mm0\n\t" \ + "punpckhdq %%mm2,%%mm1\n\t" \ + "movq %%mm3,%%mm2\n\t" \ + "punpckhdq %%mm5,%%mm3\n\t" \ + "movq %%mm0,0x40+"_off"(%[buf])\n\t" \ + "punpckldq %%mm5,%%mm2\n\t" \ + /*mm0 = h0 g0 f0 e0 \ + mm1 = h1 g1 f1 e1 \ + mm2 = h2 g2 f2 e2 \ + mm3 = h3 g3 f3 e3*/ \ + "movq 0x10+"_off"(%[buf]),%%mm5\n\t" \ + /*Second 4x4 transpose:*/ \ + /*mm4 = a3 a2 a1 a0 \ + mm5 = b3 b2 b1 b0 \ + mm6 = c3 c2 c1 c0 \ + mm7 = d3 d2 d1 d0*/ \ + "movq %%mm6,%%mm0\n\t" \ + "punpcklwd %%mm7,%%mm6\n\t" \ + "movq %%mm1,0x50+"_off"(%[buf])\n\t" \ + "punpckhwd %%mm7,%%mm0\n\t" \ + "movq %%mm4,%%mm7\n\t" \ + "punpcklwd %%mm5,%%mm4\n\t" \ + "movq %%mm2,0x60+"_off"(%[buf])\n\t" \ + "punpckhwd %%mm5,%%mm7\n\t" \ + /*mm4 = b1 a1 b0 a0 \ + mm7 = b3 a3 b2 a2 \ + mm6 = d1 c1 d0 c0 \ + mm0 = d3 c3 d2 c2*/ \ + "movq %%mm4,%%mm5\n\t" \ + "punpckldq %%mm6,%%mm4\n\t" \ + "movq %%mm3,0x70+"_off"(%[buf])\n\t" \ + "punpckhdq %%mm6,%%mm5\n\t" \ + "movq %%mm7,%%mm6\n\t" \ + "punpckhdq %%mm0,%%mm7\n\t" \ + "punpckldq %%mm0,%%mm6\n\t" \ + /*mm4 = d0 c0 b0 a0 \ + mm5 = d1 c1 b1 a1 \ + mm6 = d2 c2 b2 a2 \ + mm7 = d3 c3 b3 a3*/ \ + +static unsigned oc_int_frag_satd_thresh_mmxext(const unsigned char *_src, + int _src_ystride,const unsigned char *_ref,int _ref_ystride,unsigned _thresh){ + OC_ALIGN8(ogg_int16_t buf[64]); + ogg_int16_t *bufp; + unsigned ret; + unsigned ret2; + bufp=buf; + __asm__ __volatile__( + OC_LOAD_SUB_8x4("0x00") + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2("0x00") + /*Finish swapping out this 8x4 block to make room for the next one. + mm0...mm3 have been swapped out already.*/ + "movq %%mm4,0x00(%[buf])\n\t" + "movq %%mm5,0x10(%[buf])\n\t" + "movq %%mm6,0x20(%[buf])\n\t" + "movq %%mm7,0x30(%[buf])\n\t" + OC_LOAD_SUB_8x4("0x04") + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2("0x08") + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, so + we only have to do half the loads.*/ + "movq 0x10(%[buf]),%%mm1\n\t" + "movq 0x20(%[buf]),%%mm2\n\t" + "movq 0x30(%[buf]),%%mm3\n\t" + "movq 0x00(%[buf]),%%mm0\n\t" + OC_HADAMARD_ABS_ACCUM_8x4("0x28","0x38") + /*Up to this point, everything fit in 16 bits (8 input + 1 for the + difference + 2*3 for the two 8-point 1-D Hadamards - 1 for the abs - 1 + for the factor of two we dropped + 3 for the vertical accumulation). + Now we finally have to promote things to dwords. + We break this part out of OC_HADAMARD_ABS_ACCUM_8x4 to hide the long + latency of pmaddwd by starting the next series of loads now.*/ + "mov %[thresh],%[ret2]\n\t" + "pmaddwd %%mm7,%%mm0\n\t" + "movq 0x50(%[buf]),%%mm1\n\t" + "movq 0x58(%[buf]),%%mm5\n\t" + "movq %%mm0,%%mm4\n\t" + "movq 0x60(%[buf]),%%mm2\n\t" + "punpckhdq %%mm0,%%mm0\n\t" + "movq 0x68(%[buf]),%%mm6\n\t" + "paddd %%mm0,%%mm4\n\t" + "movq 0x70(%[buf]),%%mm3\n\t" + "movd %%mm4,%[ret]\n\t" + "movq 0x78(%[buf]),%%mm7\n\t" + /*The sums produced by OC_HADAMARD_ABS_ACCUM_8x4 each have an extra 4 + added to them, and a factor of two removed; correct the final sum here.*/ + "lea -32(%[ret],%[ret]),%[ret]\n\t" + "movq 0x40(%[buf]),%%mm0\n\t" + "cmp %[ret2],%[ret]\n\t" + "movq 0x48(%[buf]),%%mm4\n\t" + "jae 1f\n\t" + OC_HADAMARD_ABS_ACCUM_8x4("0x68","0x78") + "pmaddwd %%mm7,%%mm0\n\t" + /*There isn't much to stick in here to hide the latency this time, but the + alternative to pmaddwd is movq->punpcklwd->punpckhwd->paddd, whose + latency is even worse.*/ + "sub $32,%[ret]\n\t" + "movq %%mm0,%%mm4\n\t" + "punpckhdq %%mm0,%%mm0\n\t" + "paddd %%mm0,%%mm4\n\t" + "movd %%mm4,%[ret2]\n\t" + "lea (%[ret],%[ret2],2),%[ret]\n\t" + ".p2align 4,,15\n\t" + "1:\n\t" + /*Although it looks like we're using 7 registers here, gcc can alias %[ret] + and %[ret2] with some of the inputs, since for once we don't write to + them until after we're done using everything but %[buf] (which is also + listed as an output to ensure gcc _doesn't_ alias them against it).*/ + /*Note that _src_ystride and _ref_ystride must be given non-overlapping + constraints, otherewise if gcc can prove they're equal it will allocate + them to the same register (which is bad); _src and _ref face a similar + problem, though those are never actually the same.*/ + :[ret]"=a"(ret),[ret2]"=r"(ret2),[buf]"+r"(bufp) + :[src]"r"(_src),[src_ystride]"c"((ptrdiff_t)_src_ystride), + [ref]"r"(_ref),[ref_ystride]"d"((ptrdiff_t)_ref_ystride), + [thresh]"m"(_thresh) + /*We have to use neg, so we actually clobber the condition codes for once + (not to mention cmp, sub, and add).*/ + :"cc" + ); + return ret; +} + +unsigned oc_enc_frag_satd_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + return oc_int_frag_satd_thresh_mmxext(_src,_ystride,_ref,_ystride,_thresh); +} + +/*Our internal implementation of frag_copy2 takes an extra stride parameter so + we can share code with oc_enc_frag_satd2_thresh_mmxext().*/ +static void oc_int_frag_copy2_mmxext(unsigned char *_dst,int _dst_ystride, + const unsigned char *_src1,const unsigned char *_src2,int _src_ystride){ + __asm__ __volatile__( + /*Load the first 3 rows.*/ + "movq (%[src1]),%%mm0\n\t" + "movq (%[src2]),%%mm1\n\t" + "movq (%[src1],%[src_ystride]),%%mm2\n\t" + "lea (%[src1],%[src_ystride],2),%[src1]\n\t" + "movq (%[src2],%[src_ystride]),%%mm3\n\t" + "lea (%[src2],%[src_ystride],2),%[src2]\n\t" + "pxor %%mm7,%%mm7\n\t" + "movq (%[src1]),%%mm4\n\t" + "pcmpeqb %%mm6,%%mm6\n\t" + "movq (%[src2]),%%mm5\n\t" + /*mm7={1}x8.*/ + "psubb %%mm6,%%mm7\n\t" + /*Start averaging %%mm0 and %%mm1 into %%mm6.*/ + "movq %%mm0,%%mm6\n\t" + "pxor %%mm1,%%mm0\n\t" + "pavgb %%mm1,%%mm6\n\t" + /*%%mm1 is free, start averaging %%mm3 into %%mm2 using %%mm1.*/ + "movq %%mm2,%%mm1\n\t" + "pand %%mm7,%%mm0\n\t" + "pavgb %%mm3,%%mm2\n\t" + "pxor %%mm3,%%mm1\n\t" + /*%%mm3 is free.*/ + "psubb %%mm0,%%mm6\n\t" + /*%%mm0 is free, start loading the next row.*/ + "movq (%[src1],%[src_ystride]),%%mm0\n\t" + /*Start averaging %%mm5 and %%mm4 using %%mm3.*/ + "movq %%mm4,%%mm3\n\t" + /*%%mm6 (row 0) is done; write it out.*/ + "movq %%mm6,(%[dst])\n\t" + "pand %%mm7,%%mm1\n\t" + "pavgb %%mm5,%%mm4\n\t" + "psubb %%mm1,%%mm2\n\t" + /*%%mm1 is free, continue loading the next row.*/ + "movq (%[src2],%[src_ystride]),%%mm1\n\t" + "pxor %%mm5,%%mm3\n\t" + "lea (%[src1],%[src_ystride],2),%[src1]\n\t" + /*%%mm2 (row 1) is done; write it out.*/ + "movq %%mm2,(%[dst],%[dst_ystride])\n\t" + "pand %%mm7,%%mm3\n\t" + /*Start loading the next row.*/ + "movq (%[src1]),%%mm2\n\t" + "lea (%[dst],%[dst_ystride],2),%[dst]\n\t" + "psubb %%mm3,%%mm4\n\t" + "lea (%[src2],%[src_ystride],2),%[src2]\n\t" + /*%%mm4 (row 2) is done; write it out.*/ + "movq %%mm4,(%[dst])\n\t" + /*Continue loading the next row.*/ + "movq (%[src2]),%%mm3\n\t" + /*Start averaging %%mm0 and %%mm1 into %%mm6.*/ + "movq %%mm0,%%mm6\n\t" + "pxor %%mm1,%%mm0\n\t" + /*Start loading the next row.*/ + "movq (%[src1],%[src_ystride]),%%mm4\n\t" + "pavgb %%mm1,%%mm6\n\t" + /*%%mm1 is free; start averaging %%mm3 into %%mm2 using %%mm1.*/ + "movq %%mm2,%%mm1\n\t" + "pand %%mm7,%%mm0\n\t" + /*Continue loading the next row.*/ + "movq (%[src2],%[src_ystride]),%%mm5\n\t" + "pavgb %%mm3,%%mm2\n\t" + "lea (%[src1],%[src_ystride],2),%[src1]\n\t" + "pxor %%mm3,%%mm1\n\t" + /*%%mm3 is free.*/ + "psubb %%mm0,%%mm6\n\t" + /*%%mm0 is free, start loading the next row.*/ + "movq (%[src1]),%%mm0\n\t" + /*Start averaging %%mm5 into %%mm4 using %%mm3.*/ + "movq %%mm4,%%mm3\n\t" + /*%%mm6 (row 3) is done; write it out.*/ + "movq %%mm6,(%[dst],%[dst_ystride])\n\t" + "pand %%mm7,%%mm1\n\t" + "lea (%[src2],%[src_ystride],2),%[src2]\n\t" + "pavgb %%mm5,%%mm4\n\t" + "lea (%[dst],%[dst_ystride],2),%[dst]\n\t" + "psubb %%mm1,%%mm2\n\t" + /*%%mm1 is free; continue loading the next row.*/ + "movq (%[src2]),%%mm1\n\t" + "pxor %%mm5,%%mm3\n\t" + /*%%mm2 (row 4) is done; write it out.*/ + "movq %%mm2,(%[dst])\n\t" + "pand %%mm7,%%mm3\n\t" + /*Start loading the next row.*/ + "movq (%[src1],%[src_ystride]),%%mm2\n\t" + "psubb %%mm3,%%mm4\n\t" + /*Start averaging %%mm0 and %%mm1 into %%mm6.*/ + "movq %%mm0,%%mm6\n\t" + /*Continue loading the next row.*/ + "movq (%[src2],%[src_ystride]),%%mm3\n\t" + /*%%mm4 (row 5) is done; write it out.*/ + "movq %%mm4,(%[dst],%[dst_ystride])\n\t" + "pxor %%mm1,%%mm0\n\t" + "pavgb %%mm1,%%mm6\n\t" + /*%%mm4 is free; start averaging %%mm3 into %%mm2 using %%mm4.*/ + "movq %%mm2,%%mm4\n\t" + "pand %%mm7,%%mm0\n\t" + "pavgb %%mm3,%%mm2\n\t" + "pxor %%mm3,%%mm4\n\t" + "lea (%[dst],%[dst_ystride],2),%[dst]\n\t" + "psubb %%mm0,%%mm6\n\t" + "pand %%mm7,%%mm4\n\t" + /*%%mm6 (row 6) is done, write it out.*/ + "movq %%mm6,(%[dst])\n\t" + "psubb %%mm4,%%mm2\n\t" + /*%%mm2 (row 7) is done, write it out.*/ + "movq %%mm2,(%[dst],%[dst_ystride])\n\t" + :[dst]"+r"(_dst),[src1]"+%r"(_src1),[src2]"+r"(_src2) + :[dst_ystride]"r"((ptrdiff_t)_dst_ystride), + [src_ystride]"r"((ptrdiff_t)_src_ystride) + :"memory" + ); +} + +unsigned oc_enc_frag_satd2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + OC_ALIGN8(unsigned char ref[64]); + oc_int_frag_copy2_mmxext(ref,8,_ref1,_ref2,_ystride); + return oc_int_frag_satd_thresh_mmxext(_src,_ystride,ref,8,_thresh); +} + +unsigned oc_enc_frag_intra_satd_mmxext(const unsigned char *_src, + int _ystride){ + OC_ALIGN8(ogg_int16_t buf[64]); + ogg_int16_t *bufp; + unsigned ret; + unsigned ret2; + bufp=buf; + __asm__ __volatile__( + OC_LOAD_8x4("0x00") + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2("0x00") + /*Finish swapping out this 8x4 block to make room for the next one. + mm0...mm3 have been swapped out already.*/ + "movq %%mm4,0x00(%[buf])\n\t" + "movq %%mm5,0x10(%[buf])\n\t" + "movq %%mm6,0x20(%[buf])\n\t" + "movq %%mm7,0x30(%[buf])\n\t" + OC_LOAD_8x4("0x04") + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2("0x08") + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, so + we only have to do half the loads.*/ + "movq 0x10(%[buf]),%%mm1\n\t" + "movq 0x20(%[buf]),%%mm2\n\t" + "movq 0x30(%[buf]),%%mm3\n\t" + "movq 0x00(%[buf]),%%mm0\n\t" + /*We split out the stages here so we can save the DC coefficient in the + middle.*/ + OC_HADAMARD_AB_8x4 + OC_HADAMARD_C_ABS_ACCUM_A_8x4("0x28","0x38") + "movd %%mm1,%[ret]\n\t" + OC_HADAMARD_C_ABS_ACCUM_B_8x4("0x28","0x38") + /*Up to this point, everything fit in 16 bits (8 input + 1 for the + difference + 2*3 for the two 8-point 1-D Hadamards - 1 for the abs - 1 + for the factor of two we dropped + 3 for the vertical accumulation). + Now we finally have to promote things to dwords. + We break this part out of OC_HADAMARD_ABS_ACCUM_8x4 to hide the long + latency of pmaddwd by starting the next series of loads now.*/ + "pmaddwd %%mm7,%%mm0\n\t" + "movq 0x50(%[buf]),%%mm1\n\t" + "movq 0x58(%[buf]),%%mm5\n\t" + "movq 0x60(%[buf]),%%mm2\n\t" + "movq %%mm0,%%mm4\n\t" + "movq 0x68(%[buf]),%%mm6\n\t" + "punpckhdq %%mm0,%%mm0\n\t" + "movq 0x70(%[buf]),%%mm3\n\t" + "paddd %%mm0,%%mm4\n\t" + "movq 0x78(%[buf]),%%mm7\n\t" + "movd %%mm4,%[ret2]\n\t" + "movq 0x40(%[buf]),%%mm0\n\t" + "movq 0x48(%[buf]),%%mm4\n\t" + OC_HADAMARD_ABS_ACCUM_8x4("0x68","0x78") + "pmaddwd %%mm7,%%mm0\n\t" + /*We assume that the DC coefficient is always positive (which is true, + because the input to the INTRA transform was not a difference).*/ + "movzx %w[ret],%[ret]\n\t" + "add %[ret2],%[ret2]\n\t" + "sub %[ret],%[ret2]\n\t" + "movq %%mm0,%%mm4\n\t" + "punpckhdq %%mm0,%%mm0\n\t" + "paddd %%mm0,%%mm4\n\t" + "movd %%mm4,%[ret]\n\t" + "lea -64(%[ret2],%[ret],2),%[ret]\n\t" + /*Although it looks like we're using 7 registers here, gcc can alias %[ret] + and %[ret2] with some of the inputs, since for once we don't write to + them until after we're done using everything but %[buf] (which is also + listed as an output to ensure gcc _doesn't_ alias them against it).*/ + :[ret]"=a"(ret),[ret2]"=r"(ret2),[buf]"+r"(bufp) + :[src]"r"(_src),[src4]"r"(_src+4*_ystride), + [ystride]"r"((ptrdiff_t)_ystride),[ystride3]"r"((ptrdiff_t)3*_ystride) + /*We have to use sub, so we actually clobber the condition codes for once + (not to mention add).*/ + :"cc" + ); + return ret; +} + +void oc_enc_frag_sub_mmx(ogg_int16_t _residue[64], + const unsigned char *_src,const unsigned char *_ref,int _ystride){ + int i; + __asm__ __volatile__("pxor %%mm7,%%mm7\n\t"::); + for(i=4;i-->0;){ + __asm__ __volatile__( + /*mm0=[src]*/ + "movq (%[src]),%%mm0\n\t" + /*mm1=[ref]*/ + "movq (%[ref]),%%mm1\n\t" + /*mm4=[src+ystride]*/ + "movq (%[src],%[ystride]),%%mm4\n\t" + /*mm5=[ref+ystride]*/ + "movq (%[ref],%[ystride]),%%mm5\n\t" + /*Compute [src]-[ref].*/ + "movq %%mm0,%%mm2\n\t" + "punpcklbw %%mm7,%%mm0\n\t" + "movq %%mm1,%%mm3\n\t" + "punpckhbw %%mm7,%%mm2\n\t" + "punpcklbw %%mm7,%%mm1\n\t" + "punpckhbw %%mm7,%%mm3\n\t" + "psubw %%mm1,%%mm0\n\t" + "psubw %%mm3,%%mm2\n\t" + /*Compute [src+ystride]-[ref+ystride].*/ + "movq %%mm4,%%mm1\n\t" + "punpcklbw %%mm7,%%mm4\n\t" + "movq %%mm5,%%mm3\n\t" + "punpckhbw %%mm7,%%mm1\n\t" + "lea (%[src],%[ystride],2),%[src]\n\t" + "punpcklbw %%mm7,%%mm5\n\t" + "lea (%[ref],%[ystride],2),%[ref]\n\t" + "punpckhbw %%mm7,%%mm3\n\t" + "psubw %%mm5,%%mm4\n\t" + "psubw %%mm3,%%mm1\n\t" + /*Write the answer out.*/ + "movq %%mm0,0x00(%[residue])\n\t" + "movq %%mm2,0x08(%[residue])\n\t" + "movq %%mm4,0x10(%[residue])\n\t" + "movq %%mm1,0x18(%[residue])\n\t" + "lea 0x20(%[residue]),%[residue]\n\t" + :[residue]"+r"(_residue),[src]"+r"(_src),[ref]"+r"(_ref) + :[ystride]"r"((ptrdiff_t)_ystride) + :"memory" + ); + } +} + +void oc_enc_frag_sub_128_mmx(ogg_int16_t _residue[64], + const unsigned char *_src,int _ystride){ + ptrdiff_t ystride3; + __asm__ __volatile__( + /*mm0=[src]*/ + "movq (%[src]),%%mm0\n\t" + /*mm1=[src+ystride]*/ + "movq (%[src],%[ystride]),%%mm1\n\t" + /*mm6={-1}x4*/ + "pcmpeqw %%mm6,%%mm6\n\t" + /*mm2=[src+2*ystride]*/ + "movq (%[src],%[ystride],2),%%mm2\n\t" + /*[ystride3]=3*[ystride]*/ + "lea (%[ystride],%[ystride],2),%[ystride3]\n\t" + /*mm6={1}x4*/ + "psllw $15,%%mm6\n\t" + /*mm3=[src+3*ystride]*/ + "movq (%[src],%[ystride3]),%%mm3\n\t" + /*mm6={128}x4*/ + "psrlw $8,%%mm6\n\t" + /*mm7=0*/ + "pxor %%mm7,%%mm7\n\t" + /*[src]=[src]+4*[ystride]*/ + "lea (%[src],%[ystride],4),%[src]\n\t" + /*Compute [src]-128 and [src+ystride]-128*/ + "movq %%mm0,%%mm4\n\t" + "punpcklbw %%mm7,%%mm0\n\t" + "movq %%mm1,%%mm5\n\t" + "punpckhbw %%mm7,%%mm4\n\t" + "psubw %%mm6,%%mm0\n\t" + "punpcklbw %%mm7,%%mm1\n\t" + "psubw %%mm6,%%mm4\n\t" + "punpckhbw %%mm7,%%mm5\n\t" + "psubw %%mm6,%%mm1\n\t" + "psubw %%mm6,%%mm5\n\t" + /*Write the answer out.*/ + "movq %%mm0,0x00(%[residue])\n\t" + "movq %%mm4,0x08(%[residue])\n\t" + "movq %%mm1,0x10(%[residue])\n\t" + "movq %%mm5,0x18(%[residue])\n\t" + /*mm0=[src+4*ystride]*/ + "movq (%[src]),%%mm0\n\t" + /*mm1=[src+5*ystride]*/ + "movq (%[src],%[ystride]),%%mm1\n\t" + /*Compute [src+2*ystride]-128 and [src+3*ystride]-128*/ + "movq %%mm2,%%mm4\n\t" + "punpcklbw %%mm7,%%mm2\n\t" + "movq %%mm3,%%mm5\n\t" + "punpckhbw %%mm7,%%mm4\n\t" + "psubw %%mm6,%%mm2\n\t" + "punpcklbw %%mm7,%%mm3\n\t" + "psubw %%mm6,%%mm4\n\t" + "punpckhbw %%mm7,%%mm5\n\t" + "psubw %%mm6,%%mm3\n\t" + "psubw %%mm6,%%mm5\n\t" + /*Write the answer out.*/ + "movq %%mm2,0x20(%[residue])\n\t" + "movq %%mm4,0x28(%[residue])\n\t" + "movq %%mm3,0x30(%[residue])\n\t" + "movq %%mm5,0x38(%[residue])\n\t" + /*mm2=[src+6*ystride]*/ + "movq (%[src],%[ystride],2),%%mm2\n\t" + /*mm3=[src+7*ystride]*/ + "movq (%[src],%[ystride3]),%%mm3\n\t" + /*Compute [src+4*ystride]-128 and [src+5*ystride]-128*/ + "movq %%mm0,%%mm4\n\t" + "punpcklbw %%mm7,%%mm0\n\t" + "movq %%mm1,%%mm5\n\t" + "punpckhbw %%mm7,%%mm4\n\t" + "psubw %%mm6,%%mm0\n\t" + "punpcklbw %%mm7,%%mm1\n\t" + "psubw %%mm6,%%mm4\n\t" + "punpckhbw %%mm7,%%mm5\n\t" + "psubw %%mm6,%%mm1\n\t" + "psubw %%mm6,%%mm5\n\t" + /*Write the answer out.*/ + "movq %%mm0,0x40(%[residue])\n\t" + "movq %%mm4,0x48(%[residue])\n\t" + "movq %%mm1,0x50(%[residue])\n\t" + "movq %%mm5,0x58(%[residue])\n\t" + /*Compute [src+6*ystride]-128 and [src+7*ystride]-128*/ + "movq %%mm2,%%mm4\n\t" + "punpcklbw %%mm7,%%mm2\n\t" + "movq %%mm3,%%mm5\n\t" + "punpckhbw %%mm7,%%mm4\n\t" + "psubw %%mm6,%%mm2\n\t" + "punpcklbw %%mm7,%%mm3\n\t" + "psubw %%mm6,%%mm4\n\t" + "punpckhbw %%mm7,%%mm5\n\t" + "psubw %%mm6,%%mm3\n\t" + "psubw %%mm6,%%mm5\n\t" + /*Write the answer out.*/ + "movq %%mm2,0x60(%[residue])\n\t" + "movq %%mm4,0x68(%[residue])\n\t" + "movq %%mm3,0x70(%[residue])\n\t" + "movq %%mm5,0x78(%[residue])\n\t" + :[src]"+r"(_src),[ystride3]"=&r"(ystride3) + :[residue]"r"(_residue),[ystride]"r"((ptrdiff_t)_ystride) + :"memory" + ); +} + +void oc_enc_frag_copy2_mmxext(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride){ + oc_int_frag_copy2_mmxext(_dst,_ystride,_src1,_src2,_ystride); +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxfdct.c b/libs/libtheora-1.1/lib/x86/mmxfdct.c new file mode 100644 index 00000000..21187525 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxfdct.c @@ -0,0 +1,665 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 1999-2006 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ********************************************************************/ +/*MMX fDCT implementation for x86_32*/ +/*$Id: fdct_ses2.c 14579 2008-03-12 06:42:40Z xiphmont $*/ +#include "x86enc.h" + +#if defined(OC_X86_ASM) + +# define OC_FDCT_STAGE1_8x4 \ + "#OC_FDCT_STAGE1_8x4\n\t" \ + /*Stage 1:*/ \ + /*mm0=t7'=t0-t7*/ \ + "psubw %%mm7,%%mm0\n\t" \ + "paddw %%mm7,%%mm7\n\t" \ + /*mm1=t6'=t1-t6*/ \ + "psubw %%mm6,%%mm1\n\t" \ + "paddw %%mm6,%%mm6\n\t" \ + /*mm2=t5'=t2-t5*/ \ + "psubw %%mm5,%%mm2\n\t" \ + "paddw %%mm5,%%mm5\n\t" \ + /*mm3=t4'=t3-t4*/ \ + "psubw %%mm4,%%mm3\n\t" \ + "paddw %%mm4,%%mm4\n\t" \ + /*mm7=t0'=t0+t7*/ \ + "paddw %%mm0,%%mm7\n\t" \ + /*mm6=t1'=t1+t6*/ \ + "paddw %%mm1,%%mm6\n\t" \ + /*mm5=t2'=t2+t5*/ \ + "paddw %%mm2,%%mm5\n\t" \ + /*mm4=t3'=t3+t4*/ \ + "paddw %%mm3,%%mm4\n\t" \ + +# define OC_FDCT8x4(_r0,_r1,_r2,_r3,_r4,_r5,_r6,_r7) \ + "#OC_FDCT8x4\n\t" \ + /*Stage 2:*/ \ + /*mm7=t3''=t0'-t3'*/ \ + "psubw %%mm4,%%mm7\n\t" \ + "paddw %%mm4,%%mm4\n\t" \ + /*mm6=t2''=t1'-t2'*/ \ + "psubw %%mm5,%%mm6\n\t" \ + "movq %%mm7,"_r6"(%[y])\n\t" \ + "paddw %%mm5,%%mm5\n\t" \ + /*mm1=t5''=t6'-t5'*/ \ + "psubw %%mm2,%%mm1\n\t" \ + "movq %%mm6,"_r2"(%[y])\n\t" \ + /*mm4=t0''=t0'+t3'*/ \ + "paddw %%mm7,%%mm4\n\t" \ + "paddw %%mm2,%%mm2\n\t" \ + /*mm5=t1''=t1'+t2'*/ \ + "movq %%mm4,"_r0"(%[y])\n\t" \ + "paddw %%mm6,%%mm5\n\t" \ + /*mm2=t6''=t6'+t5'*/ \ + "paddw %%mm1,%%mm2\n\t" \ + "movq %%mm5,"_r4"(%[y])\n\t" \ + /*mm0=t7', mm1=t5'', mm2=t6'', mm3=t4'.*/ \ + /*mm4, mm5, mm6, mm7 are free.*/ \ + /*Stage 3:*/ \ + /*mm6={2}x4, mm7={27146,0xB500>>1}x2*/ \ + "mov $0x5A806A0A,%[a]\n\t" \ + "pcmpeqb %%mm6,%%mm6\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psrlw $15,%%mm6\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddw %%mm6,%%mm6\n\t" \ + /*mm0=0, m2={-1}x4 \ + mm5:mm4=t5''*27146+0xB500*/ \ + "movq %%mm1,%%mm4\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "movq %%mm2,"_r3"(%[y])\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "movq %%mm0,"_r7"(%[y])\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pcmpeqb %%mm2,%%mm2\n\t" \ + /*mm2=t6'', mm1=t5''+(t5''!=0) \ + mm4=(t5''*27146+0xB500>>16)*/ \ + "pcmpeqw %%mm1,%%mm0\n\t" \ + "psrad $16,%%mm4\n\t" \ + "psubw %%mm2,%%mm0\n\t" \ + "movq "_r3"(%[y]),%%mm2\n\t" \ + "psrad $16,%%mm5\n\t" \ + "paddw %%mm0,%%mm1\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + /*mm4=s=(t5''*27146+0xB500>>16)+t5''+(t5''!=0)>>1*/ \ + "paddw %%mm1,%%mm4\n\t" \ + "movq "_r7"(%[y]),%%mm0\n\t" \ + "psraw $1,%%mm4\n\t" \ + "movq %%mm3,%%mm1\n\t" \ + /*mm3=t4''=t4'+s*/ \ + "paddw %%mm4,%%mm3\n\t" \ + /*mm1=t5'''=t4'-s*/ \ + "psubw %%mm4,%%mm1\n\t" \ + /*mm1=0, mm3={-1}x4 \ + mm5:mm4=t6''*27146+0xB500*/ \ + "movq %%mm2,%%mm4\n\t" \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "movq %%mm1,"_r5"(%[y])\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "movq %%mm3,"_r1"(%[y])\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "pxor %%mm1,%%mm1\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pcmpeqb %%mm3,%%mm3\n\t" \ + /*mm2=t6''+(t6''!=0), mm4=(t6''*27146+0xB500>>16)*/ \ + "psrad $16,%%mm4\n\t" \ + "pcmpeqw %%mm2,%%mm1\n\t" \ + "psrad $16,%%mm5\n\t" \ + "psubw %%mm3,%%mm1\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "paddw %%mm1,%%mm2\n\t" \ + /*mm1=t1'' \ + mm4=s=(t6''*27146+0xB500>>16)+t6''+(t6''!=0)>>1*/ \ + "paddw %%mm2,%%mm4\n\t" \ + "movq "_r4"(%[y]),%%mm1\n\t" \ + "psraw $1,%%mm4\n\t" \ + "movq %%mm0,%%mm2\n\t" \ + /*mm7={54491-0x7FFF,0x7FFF}x2 \ + mm0=t7''=t7'+s*/ \ + "paddw %%mm4,%%mm0\n\t" \ + /*mm2=t6'''=t7'-s*/ \ + "psubw %%mm4,%%mm2\n\t" \ + /*Stage 4:*/ \ + /*mm0=0, mm2=t0'' \ + mm5:mm4=t1''*27146+0xB500*/ \ + "movq %%mm1,%%mm4\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "movq %%mm2,"_r3"(%[y])\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "movq "_r0"(%[y]),%%mm2\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "movq %%mm0,"_r7"(%[y])\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + /*mm7={27146,0x4000>>1}x2 \ + mm0=s=(t1''*27146+0xB500>>16)+t1''+(t1''!=0)*/ \ + "psrad $16,%%mm4\n\t" \ + "mov $0x20006A0A,%[a]\n\t" \ + "pcmpeqw %%mm1,%%mm0\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psrad $16,%%mm5\n\t" \ + "psubw %%mm3,%%mm0\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "paddw %%mm1,%%mm0\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddw %%mm4,%%mm0\n\t" \ + /*mm6={0x00000E3D}x2 \ + mm1=-(t0''==0), mm5:mm4=t0''*27146+0x4000*/ \ + "movq %%mm2,%%mm4\n\t" \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "mov $0x0E3D,%[a]\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "movd %[a],%%mm6\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pxor %%mm1,%%mm1\n\t" \ + "punpckldq %%mm6,%%mm6\n\t" \ + "pcmpeqw %%mm2,%%mm1\n\t" \ + /*mm4=r=(t0''*27146+0x4000>>16)+t0''+(t0''!=0)*/ \ + "psrad $16,%%mm4\n\t" \ + "psubw %%mm3,%%mm1\n\t" \ + "psrad $16,%%mm5\n\t" \ + "paddw %%mm1,%%mm2\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "movq "_r5"(%[y]),%%mm1\n\t" \ + "paddw %%mm2,%%mm4\n\t" \ + /*mm2=t6'', mm0=_y[0]=u=r+s>>1 \ + The naive implementation could cause overflow, so we use \ + u=(r&s)+((r^s)>>1).*/ \ + "movq "_r3"(%[y]),%%mm2\n\t" \ + "movq %%mm0,%%mm7\n\t" \ + "pxor %%mm4,%%mm0\n\t" \ + "pand %%mm4,%%mm7\n\t" \ + "psraw $1,%%mm0\n\t" \ + "mov $0x7FFF54DC,%[a]\n\t" \ + "paddw %%mm7,%%mm0\n\t" \ + "movd %[a],%%mm7\n\t" \ + /*mm7={54491-0x7FFF,0x7FFF}x2 \ + mm4=_y[4]=v=r-u*/ \ + "psubw %%mm0,%%mm4\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "movq %%mm4,"_r4"(%[y])\n\t" \ + /*mm0=0, mm7={36410}x4 \ + mm1=(t5'''!=0), mm5:mm4=54491*t5'''+0x0E3D*/ \ + "movq %%mm1,%%mm4\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "punpcklwd %%mm1,%%mm4\n\t" \ + "mov $0x8E3A8E3A,%[a]\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "movq %%mm0,"_r0"(%[y])\n\t" \ + "punpckhwd %%mm1,%%mm5\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pcmpeqw %%mm0,%%mm1\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psubw %%mm3,%%mm1\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddd %%mm6,%%mm4\n\t" \ + "paddd %%mm6,%%mm5\n\t" \ + /*mm0=0 \ + mm3:mm1=36410*t6'''+((t5'''!=0)<<16)*/ \ + "movq %%mm2,%%mm6\n\t" \ + "movq %%mm2,%%mm3\n\t" \ + "pmulhw %%mm7,%%mm6\n\t" \ + "paddw %%mm2,%%mm1\n\t" \ + "pmullw %%mm7,%%mm3\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + "paddw %%mm1,%%mm6\n\t" \ + "movq %%mm3,%%mm1\n\t" \ + "punpckhwd %%mm6,%%mm3\n\t" \ + "punpcklwd %%mm6,%%mm1\n\t" \ + /*mm3={-1}x4, mm6={1}x4 \ + mm4=_y[5]=u=(54491*t5'''+36410*t6'''+0x0E3D>>16)+(t5'''!=0)*/ \ + "paddd %%mm3,%%mm5\n\t" \ + "paddd %%mm1,%%mm4\n\t" \ + "psrad $16,%%mm5\n\t" \ + "pxor %%mm6,%%mm6\n\t" \ + "psrad $16,%%mm4\n\t" \ + "pcmpeqb %%mm3,%%mm3\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "psubw %%mm3,%%mm6\n\t" \ + /*mm1=t7'', mm7={26568,0x3400}x2 \ + mm2=s=t6'''-(36410*u>>16)*/ \ + "movq %%mm4,%%mm1\n\t" \ + "mov $0x340067C8,%[a]\n\t" \ + "pmulhw %%mm7,%%mm4\n\t" \ + "movd %[a],%%mm7\n\t" \ + "movq %%mm1,"_r5"(%[y])\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddw %%mm1,%%mm4\n\t" \ + "movq "_r7"(%[y]),%%mm1\n\t" \ + "psubw %%mm4,%%mm2\n\t" \ + /*mm6={0x00007B1B}x2 \ + mm0=(s!=0), mm5:mm4=s*26568+0x3400*/ \ + "movq %%mm2,%%mm4\n\t" \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "pcmpeqw %%mm2,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "mov $0x7B1B,%[a]\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "movd %[a],%%mm6\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "psubw %%mm3,%%mm0\n\t" \ + "punpckldq %%mm6,%%mm6\n\t" \ + /*mm7={64277-0x7FFF,0x7FFF}x2 \ + mm2=_y[3]=v=(s*26568+0x3400>>17)+s+(s!=0)*/ \ + "psrad $17,%%mm4\n\t" \ + "paddw %%mm0,%%mm2\n\t" \ + "psrad $17,%%mm5\n\t" \ + "mov $0x7FFF7B16,%[a]\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "movd %[a],%%mm7\n\t" \ + "paddw %%mm4,%%mm2\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + /*mm0=0, mm7={12785}x4 \ + mm1=(t7''!=0), mm2=t4'', mm5:mm4=64277*t7''+0x7B1B*/ \ + "movq %%mm1,%%mm4\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "movq %%mm2,"_r3"(%[y])\n\t" \ + "punpcklwd %%mm1,%%mm4\n\t" \ + "movq "_r1"(%[y]),%%mm2\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "mov $0x31F131F1,%[a]\n\t" \ + "punpckhwd %%mm1,%%mm5\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "pcmpeqw %%mm0,%%mm1\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psubw %%mm3,%%mm1\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddd %%mm6,%%mm4\n\t" \ + "paddd %%mm6,%%mm5\n\t" \ + /*mm3:mm1=12785*t4'''+((t7''!=0)<<16)*/ \ + "movq %%mm2,%%mm6\n\t" \ + "movq %%mm2,%%mm3\n\t" \ + "pmulhw %%mm7,%%mm6\n\t" \ + "pmullw %%mm7,%%mm3\n\t" \ + "paddw %%mm1,%%mm6\n\t" \ + "movq %%mm3,%%mm1\n\t" \ + "punpckhwd %%mm6,%%mm3\n\t" \ + "punpcklwd %%mm6,%%mm1\n\t" \ + /*mm3={-1}x4, mm6={1}x4 \ + mm4=_y[1]=u=(12785*t4'''+64277*t7''+0x7B1B>>16)+(t7''!=0)*/ \ + "paddd %%mm3,%%mm5\n\t" \ + "paddd %%mm1,%%mm4\n\t" \ + "psrad $16,%%mm5\n\t" \ + "pxor %%mm6,%%mm6\n\t" \ + "psrad $16,%%mm4\n\t" \ + "pcmpeqb %%mm3,%%mm3\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "psubw %%mm3,%%mm6\n\t" \ + /*mm1=t3'', mm7={20539,0x3000}x2 \ + mm4=s=(12785*u>>16)-t4''*/ \ + "movq %%mm4,"_r1"(%[y])\n\t" \ + "pmulhw %%mm7,%%mm4\n\t" \ + "mov $0x3000503B,%[a]\n\t" \ + "movq "_r6"(%[y]),%%mm1\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psubw %%mm2,%%mm4\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + /*mm6={0x00006CB7}x2 \ + mm0=(s!=0), mm5:mm4=s*20539+0x3000*/ \ + "movq %%mm4,%%mm5\n\t" \ + "movq %%mm4,%%mm2\n\t" \ + "punpcklwd %%mm6,%%mm4\n\t" \ + "pcmpeqw %%mm2,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "mov $0x6CB7,%[a]\n\t" \ + "punpckhwd %%mm6,%%mm5\n\t" \ + "movd %[a],%%mm6\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "psubw %%mm3,%%mm0\n\t" \ + "punpckldq %%mm6,%%mm6\n\t" \ + /*mm7={60547-0x7FFF,0x7FFF}x2 \ + mm2=_y[7]=v=(s*20539+0x3000>>20)+s+(s!=0)*/ \ + "psrad $20,%%mm4\n\t" \ + "paddw %%mm0,%%mm2\n\t" \ + "psrad $20,%%mm5\n\t" \ + "mov $0x7FFF6C84,%[a]\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + "movd %[a],%%mm7\n\t" \ + "paddw %%mm4,%%mm2\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + /*mm0=0, mm7={25080}x4 \ + mm2=t2'', mm5:mm4=60547*t3''+0x6CB7*/ \ + "movq %%mm1,%%mm4\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "movq %%mm2,"_r7"(%[y])\n\t" \ + "punpcklwd %%mm1,%%mm4\n\t" \ + "movq "_r2"(%[y]),%%mm2\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "mov $0x61F861F8,%[a]\n\t" \ + "punpckhwd %%mm1,%%mm5\n\t" \ + "pxor %%mm0,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm5\n\t" \ + "movd %[a],%%mm7\n\t" \ + "pcmpeqw %%mm0,%%mm1\n\t" \ + "psubw %%mm3,%%mm1\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "paddd %%mm6,%%mm4\n\t" \ + "paddd %%mm6,%%mm5\n\t" \ + /*mm3:mm1=25080*t2''+((t3''!=0)<<16)*/ \ + "movq %%mm2,%%mm6\n\t" \ + "movq %%mm2,%%mm3\n\t" \ + "pmulhw %%mm7,%%mm6\n\t" \ + "pmullw %%mm7,%%mm3\n\t" \ + "paddw %%mm1,%%mm6\n\t" \ + "movq %%mm3,%%mm1\n\t" \ + "punpckhwd %%mm6,%%mm3\n\t" \ + "punpcklwd %%mm6,%%mm1\n\t" \ + /*mm1={-1}x4 \ + mm4=u=(25080*t2''+60547*t3''+0x6CB7>>16)+(t3''!=0)*/ \ + "paddd %%mm3,%%mm5\n\t" \ + "paddd %%mm1,%%mm4\n\t" \ + "psrad $16,%%mm5\n\t" \ + "mov $0x28005460,%[a]\n\t" \ + "psrad $16,%%mm4\n\t" \ + "pcmpeqb %%mm1,%%mm1\n\t" \ + "packssdw %%mm5,%%mm4\n\t" \ + /*mm5={1}x4, mm6=_y[2]=u, mm7={21600,0x2800}x2 \ + mm4=s=(25080*u>>16)-t2''*/ \ + "movq %%mm4,%%mm6\n\t" \ + "pmulhw %%mm7,%%mm4\n\t" \ + "pxor %%mm5,%%mm5\n\t" \ + "movd %[a],%%mm7\n\t" \ + "psubw %%mm1,%%mm5\n\t" \ + "punpckldq %%mm7,%%mm7\n\t" \ + "psubw %%mm2,%%mm4\n\t" \ + /*mm2=s+(s!=0) \ + mm4:mm3=s*21600+0x2800*/ \ + "movq %%mm4,%%mm3\n\t" \ + "movq %%mm4,%%mm2\n\t" \ + "punpckhwd %%mm5,%%mm4\n\t" \ + "pcmpeqw %%mm2,%%mm0\n\t" \ + "pmaddwd %%mm7,%%mm4\n\t" \ + "psubw %%mm1,%%mm0\n\t" \ + "punpcklwd %%mm5,%%mm3\n\t" \ + "paddw %%mm0,%%mm2\n\t" \ + "pmaddwd %%mm7,%%mm3\n\t" \ + /*mm0=_y[4], mm1=_y[7], mm4=_y[0], mm5=_y[5] \ + mm3=_y[6]=v=(s*21600+0x2800>>18)+s+(s!=0)*/ \ + "movq "_r4"(%[y]),%%mm0\n\t" \ + "psrad $18,%%mm4\n\t" \ + "movq "_r5"(%[y]),%%mm5\n\t" \ + "psrad $18,%%mm3\n\t" \ + "movq "_r7"(%[y]),%%mm1\n\t" \ + "packssdw %%mm4,%%mm3\n\t" \ + "movq "_r0"(%[y]),%%mm4\n\t" \ + "paddw %%mm2,%%mm3\n\t" \ + +/*On input, mm4=_y[0], mm6=_y[2], mm0=_y[4], mm5=_y[5], mm3=_y[6], mm1=_y[7]. + On output, {_y[4],mm1,mm2,mm3} contains the transpose of _y[4...7] and + {mm4,mm5,mm6,mm7} contains the transpose of _y[0...3].*/ +# define OC_TRANSPOSE8x4(_r0,_r1,_r2,_r3,_r4,_r5,_r6,_r7) \ + "#OC_TRANSPOSE8x4\n\t" \ + /*First 4x4 transpose:*/ \ + /*mm0 = e3 e2 e1 e0 \ + mm5 = f3 f2 f1 f0 \ + mm3 = g3 g2 g1 g0 \ + mm1 = h3 h2 h1 h0*/ \ + "movq %%mm0,%%mm2\n\t" \ + "punpcklwd %%mm5,%%mm0\n\t" \ + "punpckhwd %%mm5,%%mm2\n\t" \ + "movq %%mm3,%%mm5\n\t" \ + "punpcklwd %%mm1,%%mm3\n\t" \ + "punpckhwd %%mm1,%%mm5\n\t" \ + /*mm0 = f1 e1 f0 e0 \ + mm2 = f3 e3 f2 e2 \ + mm3 = h1 g1 h0 g0 \ + mm5 = h3 g3 h2 g2*/ \ + "movq %%mm0,%%mm1\n\t" \ + "punpckldq %%mm3,%%mm0\n\t" \ + "movq %%mm0,"_r4"(%[y])\n\t" \ + "punpckhdq %%mm3,%%mm1\n\t" \ + "movq "_r1"(%[y]),%%mm0\n\t" \ + "movq %%mm2,%%mm3\n\t" \ + "punpckldq %%mm5,%%mm2\n\t" \ + "punpckhdq %%mm5,%%mm3\n\t" \ + "movq "_r3"(%[y]),%%mm5\n\t" \ + /*_y[4] = h0 g0 f0 e0 \ + mm1 = h1 g1 f1 e1 \ + mm2 = h2 g2 f2 e2 \ + mm3 = h3 g3 f3 e3*/ \ + /*Second 4x4 transpose:*/ \ + /*mm4 = a3 a2 a1 a0 \ + mm0 = b3 b2 b1 b0 \ + mm6 = c3 c2 c1 c0 \ + mm5 = d3 d2 d1 d0*/ \ + "movq %%mm4,%%mm7\n\t" \ + "punpcklwd %%mm0,%%mm4\n\t" \ + "punpckhwd %%mm0,%%mm7\n\t" \ + "movq %%mm6,%%mm0\n\t" \ + "punpcklwd %%mm5,%%mm6\n\t" \ + "punpckhwd %%mm5,%%mm0\n\t" \ + /*mm4 = b1 a1 b0 a0 \ + mm7 = b3 a3 b2 a2 \ + mm6 = d1 c1 d0 c0 \ + mm0 = d3 c3 d2 c2*/ \ + "movq %%mm4,%%mm5\n\t" \ + "punpckldq %%mm6,%%mm4\n\t" \ + "punpckhdq %%mm6,%%mm5\n\t" \ + "movq %%mm7,%%mm6\n\t" \ + "punpckhdq %%mm0,%%mm7\n\t" \ + "punpckldq %%mm0,%%mm6\n\t" \ + /*mm4 = d0 c0 b0 a0 \ + mm5 = d1 c1 b1 a1 \ + mm6 = d2 c2 b2 a2 \ + mm7 = d3 c3 b3 a3*/ \ + +/*MMX implementation of the fDCT.*/ +void oc_enc_fdct8x8_mmx(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + ptrdiff_t a; + __asm__ __volatile__( + /*Add two extra bits of working precision to improve accuracy; any more and + we could overflow.*/ + /*We also add biases to correct for some systematic error that remains in + the full fDCT->iDCT round trip.*/ + "movq 0x00(%[x]),%%mm0\n\t" + "movq 0x10(%[x]),%%mm1\n\t" + "movq 0x20(%[x]),%%mm2\n\t" + "movq 0x30(%[x]),%%mm3\n\t" + "pcmpeqb %%mm4,%%mm4\n\t" + "pxor %%mm7,%%mm7\n\t" + "movq %%mm0,%%mm5\n\t" + "psllw $2,%%mm0\n\t" + "pcmpeqw %%mm7,%%mm5\n\t" + "movq 0x70(%[x]),%%mm7\n\t" + "psllw $2,%%mm1\n\t" + "psubw %%mm4,%%mm5\n\t" + "psllw $2,%%mm2\n\t" + "mov $1,%[a]\n\t" + "pslld $16,%%mm5\n\t" + "movd %[a],%%mm6\n\t" + "psllq $16,%%mm5\n\t" + "mov $0x10001,%[a]\n\t" + "psllw $2,%%mm3\n\t" + "movd %[a],%%mm4\n\t" + "punpckhwd %%mm6,%%mm5\n\t" + "psubw %%mm6,%%mm1\n\t" + "movq 0x60(%[x]),%%mm6\n\t" + "paddw %%mm5,%%mm0\n\t" + "movq 0x50(%[x]),%%mm5\n\t" + "paddw %%mm4,%%mm0\n\t" + "movq 0x40(%[x]),%%mm4\n\t" + /*We inline stage1 of the transform here so we can get better instruction + scheduling with the shifts.*/ + /*mm0=t7'=t0-t7*/ + "psllw $2,%%mm7\n\t" + "psubw %%mm7,%%mm0\n\t" + "psllw $2,%%mm6\n\t" + "paddw %%mm7,%%mm7\n\t" + /*mm1=t6'=t1-t6*/ + "psllw $2,%%mm5\n\t" + "psubw %%mm6,%%mm1\n\t" + "psllw $2,%%mm4\n\t" + "paddw %%mm6,%%mm6\n\t" + /*mm2=t5'=t2-t5*/ + "psubw %%mm5,%%mm2\n\t" + "paddw %%mm5,%%mm5\n\t" + /*mm3=t4'=t3-t4*/ + "psubw %%mm4,%%mm3\n\t" + "paddw %%mm4,%%mm4\n\t" + /*mm7=t0'=t0+t7*/ + "paddw %%mm0,%%mm7\n\t" + /*mm6=t1'=t1+t6*/ + "paddw %%mm1,%%mm6\n\t" + /*mm5=t2'=t2+t5*/ + "paddw %%mm2,%%mm5\n\t" + /*mm4=t3'=t3+t4*/ + "paddw %%mm3,%%mm4\n\t" + OC_FDCT8x4("0x00","0x10","0x20","0x30","0x40","0x50","0x60","0x70") + OC_TRANSPOSE8x4("0x00","0x10","0x20","0x30","0x40","0x50","0x60","0x70") + /*Swap out this 8x4 block for the next one.*/ + "movq 0x08(%[x]),%%mm0\n\t" + "movq %%mm7,0x30(%[y])\n\t" + "movq 0x78(%[x]),%%mm7\n\t" + "movq %%mm1,0x50(%[y])\n\t" + "movq 0x18(%[x]),%%mm1\n\t" + "movq %%mm6,0x20(%[y])\n\t" + "movq 0x68(%[x]),%%mm6\n\t" + "movq %%mm2,0x60(%[y])\n\t" + "movq 0x28(%[x]),%%mm2\n\t" + "movq %%mm5,0x10(%[y])\n\t" + "movq 0x58(%[x]),%%mm5\n\t" + "movq %%mm3,0x70(%[y])\n\t" + "movq 0x38(%[x]),%%mm3\n\t" + /*And increase its working precision, too.*/ + "psllw $2,%%mm0\n\t" + "movq %%mm4,0x00(%[y])\n\t" + "psllw $2,%%mm7\n\t" + "movq 0x48(%[x]),%%mm4\n\t" + /*We inline stage1 of the transform here so we can get better instruction + scheduling with the shifts.*/ + /*mm0=t7'=t0-t7*/ + "psubw %%mm7,%%mm0\n\t" + "psllw $2,%%mm1\n\t" + "paddw %%mm7,%%mm7\n\t" + "psllw $2,%%mm6\n\t" + /*mm1=t6'=t1-t6*/ + "psubw %%mm6,%%mm1\n\t" + "psllw $2,%%mm2\n\t" + "paddw %%mm6,%%mm6\n\t" + "psllw $2,%%mm5\n\t" + /*mm2=t5'=t2-t5*/ + "psubw %%mm5,%%mm2\n\t" + "psllw $2,%%mm3\n\t" + "paddw %%mm5,%%mm5\n\t" + "psllw $2,%%mm4\n\t" + /*mm3=t4'=t3-t4*/ + "psubw %%mm4,%%mm3\n\t" + "paddw %%mm4,%%mm4\n\t" + /*mm7=t0'=t0+t7*/ + "paddw %%mm0,%%mm7\n\t" + /*mm6=t1'=t1+t6*/ + "paddw %%mm1,%%mm6\n\t" + /*mm5=t2'=t2+t5*/ + "paddw %%mm2,%%mm5\n\t" + /*mm4=t3'=t3+t4*/ + "paddw %%mm3,%%mm4\n\t" + OC_FDCT8x4("0x08","0x18","0x28","0x38","0x48","0x58","0x68","0x78") + OC_TRANSPOSE8x4("0x08","0x18","0x28","0x38","0x48","0x58","0x68","0x78") + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, + so we only have to do half the stores and loads.*/ + "movq 0x00(%[y]),%%mm0\n\t" + "movq %%mm1,0x58(%[y])\n\t" + "movq 0x10(%[y]),%%mm1\n\t" + "movq %%mm2,0x68(%[y])\n\t" + "movq 0x20(%[y]),%%mm2\n\t" + "movq %%mm3,0x78(%[y])\n\t" + "movq 0x30(%[y]),%%mm3\n\t" + OC_FDCT_STAGE1_8x4 + OC_FDCT8x4("0x00","0x10","0x20","0x30","0x08","0x18","0x28","0x38") + OC_TRANSPOSE8x4("0x00","0x10","0x20","0x30","0x08","0x18","0x28","0x38") + /*mm0={-2}x4*/ + "pcmpeqw %%mm0,%%mm0\n\t" + "paddw %%mm0,%%mm0\n\t" + /*Round the results.*/ + "psubw %%mm0,%%mm1\n\t" + "psubw %%mm0,%%mm2\n\t" + "psraw $2,%%mm1\n\t" + "psubw %%mm0,%%mm3\n\t" + "movq %%mm1,0x18(%[y])\n\t" + "psraw $2,%%mm2\n\t" + "psubw %%mm0,%%mm4\n\t" + "movq 0x08(%[y]),%%mm1\n\t" + "psraw $2,%%mm3\n\t" + "psubw %%mm0,%%mm5\n\t" + "psraw $2,%%mm4\n\t" + "psubw %%mm0,%%mm6\n\t" + "psraw $2,%%mm5\n\t" + "psubw %%mm0,%%mm7\n\t" + "psraw $2,%%mm6\n\t" + "psubw %%mm0,%%mm1\n\t" + "psraw $2,%%mm7\n\t" + "movq 0x40(%[y]),%%mm0\n\t" + "psraw $2,%%mm1\n\t" + "movq %%mm7,0x30(%[y])\n\t" + "movq 0x78(%[y]),%%mm7\n\t" + "movq %%mm1,0x08(%[y])\n\t" + "movq 0x50(%[y]),%%mm1\n\t" + "movq %%mm6,0x20(%[y])\n\t" + "movq 0x68(%[y]),%%mm6\n\t" + "movq %%mm2,0x28(%[y])\n\t" + "movq 0x60(%[y]),%%mm2\n\t" + "movq %%mm5,0x10(%[y])\n\t" + "movq 0x58(%[y]),%%mm5\n\t" + "movq %%mm3,0x38(%[y])\n\t" + "movq 0x70(%[y]),%%mm3\n\t" + "movq %%mm4,0x00(%[y])\n\t" + "movq 0x48(%[y]),%%mm4\n\t" + OC_FDCT_STAGE1_8x4 + OC_FDCT8x4("0x40","0x50","0x60","0x70","0x48","0x58","0x68","0x78") + OC_TRANSPOSE8x4("0x40","0x50","0x60","0x70","0x48","0x58","0x68","0x78") + /*mm0={-2}x4*/ + "pcmpeqw %%mm0,%%mm0\n\t" + "paddw %%mm0,%%mm0\n\t" + /*Round the results.*/ + "psubw %%mm0,%%mm1\n\t" + "psubw %%mm0,%%mm2\n\t" + "psraw $2,%%mm1\n\t" + "psubw %%mm0,%%mm3\n\t" + "movq %%mm1,0x58(%[y])\n\t" + "psraw $2,%%mm2\n\t" + "psubw %%mm0,%%mm4\n\t" + "movq 0x48(%[y]),%%mm1\n\t" + "psraw $2,%%mm3\n\t" + "psubw %%mm0,%%mm5\n\t" + "movq %%mm2,0x68(%[y])\n\t" + "psraw $2,%%mm4\n\t" + "psubw %%mm0,%%mm6\n\t" + "movq %%mm3,0x78(%[y])\n\t" + "psraw $2,%%mm5\n\t" + "psubw %%mm0,%%mm7\n\t" + "movq %%mm4,0x40(%[y])\n\t" + "psraw $2,%%mm6\n\t" + "psubw %%mm0,%%mm1\n\t" + "movq %%mm5,0x50(%[y])\n\t" + "psraw $2,%%mm7\n\t" + "movq %%mm6,0x60(%[y])\n\t" + "psraw $2,%%mm1\n\t" + "movq %%mm7,0x70(%[y])\n\t" + "movq %%mm1,0x48(%[y])\n\t" + :[a]"=&r"(a) + :[y]"r"(_y),[x]"r"(_x) + :"memory" + ); +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxfrag.c b/libs/libtheora-1.1/lib/x86/mmxfrag.c new file mode 100644 index 00000000..2792cd41 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxfrag.c @@ -0,0 +1,293 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxfrag.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*MMX acceleration of fragment reconstruction for motion compensation. + Originally written by Rudolf Marek. + Additional optimization by Nils Pipenbrinck. + Note: Loops are unrolled for best performance. + The iteration each instruction belongs to is marked in the comments as #i.*/ +#include +#include "x86int.h" +#include "mmxfrag.h" + +#if defined(OC_X86_ASM) + +/*Copies an 8x8 block of pixels from _src to _dst, assuming _ystride bytes + between rows.*/ +void oc_frag_copy_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride){ + OC_FRAG_COPY_MMX(_dst,_src,_ystride); +} + +void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride, + const ogg_int16_t *_residue){ + __asm__ __volatile__( + /*Set mm0 to 0xFFFFFFFFFFFFFFFF.*/ + "pcmpeqw %%mm0,%%mm0\n\t" + /*#0 Load low residue.*/ + "movq 0*8(%[residue]),%%mm1\n\t" + /*#0 Load high residue.*/ + "movq 1*8(%[residue]),%%mm2\n\t" + /*Set mm0 to 0x8000800080008000.*/ + "psllw $15,%%mm0\n\t" + /*#1 Load low residue.*/ + "movq 2*8(%[residue]),%%mm3\n\t" + /*#1 Load high residue.*/ + "movq 3*8(%[residue]),%%mm4\n\t" + /*Set mm0 to 0x0080008000800080.*/ + "psrlw $8,%%mm0\n\t" + /*#2 Load low residue.*/ + "movq 4*8(%[residue]),%%mm5\n\t" + /*#2 Load high residue.*/ + "movq 5*8(%[residue]),%%mm6\n\t" + /*#0 Bias low residue.*/ + "paddsw %%mm0,%%mm1\n\t" + /*#0 Bias high residue.*/ + "paddsw %%mm0,%%mm2\n\t" + /*#0 Pack to byte.*/ + "packuswb %%mm2,%%mm1\n\t" + /*#1 Bias low residue.*/ + "paddsw %%mm0,%%mm3\n\t" + /*#1 Bias high residue.*/ + "paddsw %%mm0,%%mm4\n\t" + /*#1 Pack to byte.*/ + "packuswb %%mm4,%%mm3\n\t" + /*#2 Bias low residue.*/ + "paddsw %%mm0,%%mm5\n\t" + /*#2 Bias high residue.*/ + "paddsw %%mm0,%%mm6\n\t" + /*#2 Pack to byte.*/ + "packuswb %%mm6,%%mm5\n\t" + /*#0 Write row.*/ + "movq %%mm1,(%[dst])\n\t" + /*#1 Write row.*/ + "movq %%mm3,(%[dst],%[ystride])\n\t" + /*#2 Write row.*/ + "movq %%mm5,(%[dst],%[ystride],2)\n\t" + /*#3 Load low residue.*/ + "movq 6*8(%[residue]),%%mm1\n\t" + /*#3 Load high residue.*/ + "movq 7*8(%[residue]),%%mm2\n\t" + /*#4 Load high residue.*/ + "movq 8*8(%[residue]),%%mm3\n\t" + /*#4 Load high residue.*/ + "movq 9*8(%[residue]),%%mm4\n\t" + /*#5 Load high residue.*/ + "movq 10*8(%[residue]),%%mm5\n\t" + /*#5 Load high residue.*/ + "movq 11*8(%[residue]),%%mm6\n\t" + /*#3 Bias low residue.*/ + "paddsw %%mm0,%%mm1\n\t" + /*#3 Bias high residue.*/ + "paddsw %%mm0,%%mm2\n\t" + /*#3 Pack to byte.*/ + "packuswb %%mm2,%%mm1\n\t" + /*#4 Bias low residue.*/ + "paddsw %%mm0,%%mm3\n\t" + /*#4 Bias high residue.*/ + "paddsw %%mm0,%%mm4\n\t" + /*#4 Pack to byte.*/ + "packuswb %%mm4,%%mm3\n\t" + /*#5 Bias low residue.*/ + "paddsw %%mm0,%%mm5\n\t" + /*#5 Bias high residue.*/ + "paddsw %%mm0,%%mm6\n\t" + /*#5 Pack to byte.*/ + "packuswb %%mm6,%%mm5\n\t" + /*#3 Write row.*/ + "movq %%mm1,(%[dst],%[ystride3])\n\t" + /*#4 Write row.*/ + "movq %%mm3,(%[dst4])\n\t" + /*#5 Write row.*/ + "movq %%mm5,(%[dst4],%[ystride])\n\t" + /*#6 Load low residue.*/ + "movq 12*8(%[residue]),%%mm1\n\t" + /*#6 Load high residue.*/ + "movq 13*8(%[residue]),%%mm2\n\t" + /*#7 Load low residue.*/ + "movq 14*8(%[residue]),%%mm3\n\t" + /*#7 Load high residue.*/ + "movq 15*8(%[residue]),%%mm4\n\t" + /*#6 Bias low residue.*/ + "paddsw %%mm0,%%mm1\n\t" + /*#6 Bias high residue.*/ + "paddsw %%mm0,%%mm2\n\t" + /*#6 Pack to byte.*/ + "packuswb %%mm2,%%mm1\n\t" + /*#7 Bias low residue.*/ + "paddsw %%mm0,%%mm3\n\t" + /*#7 Bias high residue.*/ + "paddsw %%mm0,%%mm4\n\t" + /*#7 Pack to byte.*/ + "packuswb %%mm4,%%mm3\n\t" + /*#6 Write row.*/ + "movq %%mm1,(%[dst4],%[ystride],2)\n\t" + /*#7 Write row.*/ + "movq %%mm3,(%[dst4],%[ystride3])\n\t" + : + :[residue]"r"(_residue), + [dst]"r"(_dst), + [dst4]"r"(_dst+(_ystride<<2)), + [ystride]"r"((ptrdiff_t)_ystride), + [ystride3]"r"((ptrdiff_t)_ystride*3) + :"memory" + ); +} + +void oc_frag_recon_inter_mmx(unsigned char *_dst,const unsigned char *_src, + int _ystride,const ogg_int16_t *_residue){ + int i; + /*Zero mm0.*/ + __asm__ __volatile__("pxor %%mm0,%%mm0\n\t"::); + for(i=4;i-->0;){ + __asm__ __volatile__( + /*#0 Load source.*/ + "movq (%[src]),%%mm3\n\t" + /*#1 Load source.*/ + "movq (%[src],%[ystride]),%%mm7\n\t" + /*#0 Get copy of src.*/ + "movq %%mm3,%%mm4\n\t" + /*#0 Expand high source.*/ + "punpckhbw %%mm0,%%mm4\n\t" + /*#0 Expand low source.*/ + "punpcklbw %%mm0,%%mm3\n\t" + /*#0 Add residue high.*/ + "paddsw 8(%[residue]),%%mm4\n\t" + /*#1 Get copy of src.*/ + "movq %%mm7,%%mm2\n\t" + /*#0 Add residue low.*/ + "paddsw (%[residue]), %%mm3\n\t" + /*#1 Expand high source.*/ + "punpckhbw %%mm0,%%mm2\n\t" + /*#0 Pack final row pixels.*/ + "packuswb %%mm4,%%mm3\n\t" + /*#1 Expand low source.*/ + "punpcklbw %%mm0,%%mm7\n\t" + /*#1 Add residue low.*/ + "paddsw 16(%[residue]),%%mm7\n\t" + /*#1 Add residue high.*/ + "paddsw 24(%[residue]),%%mm2\n\t" + /*Advance residue.*/ + "lea 32(%[residue]),%[residue]\n\t" + /*#1 Pack final row pixels.*/ + "packuswb %%mm2,%%mm7\n\t" + /*Advance src.*/ + "lea (%[src],%[ystride],2),%[src]\n\t" + /*#0 Write row.*/ + "movq %%mm3,(%[dst])\n\t" + /*#1 Write row.*/ + "movq %%mm7,(%[dst],%[ystride])\n\t" + /*Advance dst.*/ + "lea (%[dst],%[ystride],2),%[dst]\n\t" + :[residue]"+r"(_residue),[dst]"+r"(_dst),[src]"+r"(_src) + :[ystride]"r"((ptrdiff_t)_ystride) + :"memory" + ); + } +} + +void oc_frag_recon_inter2_mmx(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t *_residue){ + int i; + /*Zero mm7.*/ + __asm__ __volatile__("pxor %%mm7,%%mm7\n\t"::); + for(i=4;i-->0;){ + __asm__ __volatile__( + /*#0 Load src1.*/ + "movq (%[src1]),%%mm0\n\t" + /*#0 Load src2.*/ + "movq (%[src2]),%%mm2\n\t" + /*#0 Copy src1.*/ + "movq %%mm0,%%mm1\n\t" + /*#0 Copy src2.*/ + "movq %%mm2,%%mm3\n\t" + /*#1 Load src1.*/ + "movq (%[src1],%[ystride]),%%mm4\n\t" + /*#0 Unpack lower src1.*/ + "punpcklbw %%mm7,%%mm0\n\t" + /*#1 Load src2.*/ + "movq (%[src2],%[ystride]),%%mm5\n\t" + /*#0 Unpack higher src1.*/ + "punpckhbw %%mm7,%%mm1\n\t" + /*#0 Unpack lower src2.*/ + "punpcklbw %%mm7,%%mm2\n\t" + /*#0 Unpack higher src2.*/ + "punpckhbw %%mm7,%%mm3\n\t" + /*Advance src1 ptr.*/ + "lea (%[src1],%[ystride],2),%[src1]\n\t" + /*Advance src2 ptr.*/ + "lea (%[src2],%[ystride],2),%[src2]\n\t" + /*#0 Lower src1+src2.*/ + "paddsw %%mm2,%%mm0\n\t" + /*#0 Higher src1+src2.*/ + "paddsw %%mm3,%%mm1\n\t" + /*#1 Copy src1.*/ + "movq %%mm4,%%mm2\n\t" + /*#0 Build lo average.*/ + "psraw $1,%%mm0\n\t" + /*#1 Copy src2.*/ + "movq %%mm5,%%mm3\n\t" + /*#1 Unpack lower src1.*/ + "punpcklbw %%mm7,%%mm4\n\t" + /*#0 Build hi average.*/ + "psraw $1,%%mm1\n\t" + /*#1 Unpack higher src1.*/ + "punpckhbw %%mm7,%%mm2\n\t" + /*#0 low+=residue.*/ + "paddsw (%[residue]),%%mm0\n\t" + /*#1 Unpack lower src2.*/ + "punpcklbw %%mm7,%%mm5\n\t" + /*#0 high+=residue.*/ + "paddsw 8(%[residue]),%%mm1\n\t" + /*#1 Unpack higher src2.*/ + "punpckhbw %%mm7,%%mm3\n\t" + /*#1 Lower src1+src2.*/ + "paddsw %%mm4,%%mm5\n\t" + /*#0 Pack and saturate.*/ + "packuswb %%mm1,%%mm0\n\t" + /*#1 Higher src1+src2.*/ + "paddsw %%mm2,%%mm3\n\t" + /*#0 Write row.*/ + "movq %%mm0,(%[dst])\n\t" + /*#1 Build lo average.*/ + "psraw $1,%%mm5\n\t" + /*#1 Build hi average.*/ + "psraw $1,%%mm3\n\t" + /*#1 low+=residue.*/ + "paddsw 16(%[residue]),%%mm5\n\t" + /*#1 high+=residue.*/ + "paddsw 24(%[residue]),%%mm3\n\t" + /*#1 Pack and saturate.*/ + "packuswb %%mm3,%%mm5\n\t" + /*#1 Write row ptr.*/ + "movq %%mm5,(%[dst],%[ystride])\n\t" + /*Advance residue ptr.*/ + "add $32,%[residue]\n\t" + /*Advance dest ptr.*/ + "lea (%[dst],%[ystride],2),%[dst]\n\t" + :[dst]"+r"(_dst),[residue]"+r"(_residue), + [src1]"+%r"(_src1),[src2]"+r"(_src2) + :[ystride]"r"((ptrdiff_t)_ystride) + :"memory" + ); + } +} + +void oc_restore_fpu_mmx(void){ + __asm__ __volatile__("emms\n\t"); +} +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxfrag.h b/libs/libtheora-1.1/lib/x86/mmxfrag.h new file mode 100644 index 00000000..a3984276 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxfrag.h @@ -0,0 +1,64 @@ +#if !defined(_x86_mmxfrag_H) +# define _x86_mmxfrag_H (1) +# include +# include "x86int.h" + +#if defined(OC_X86_ASM) + +/*Copies an 8x8 block of pixels from _src to _dst, assuming _ystride bytes + between rows.*/ +#define OC_FRAG_COPY_MMX(_dst,_src,_ystride) \ + do{ \ + const unsigned char *src; \ + unsigned char *dst; \ + ptrdiff_t ystride3; \ + src=(_src); \ + dst=(_dst); \ + __asm__ __volatile__( \ + /*src+0*ystride*/ \ + "movq (%[src]),%%mm0\n\t" \ + /*src+1*ystride*/ \ + "movq (%[src],%[ystride]),%%mm1\n\t" \ + /*ystride3=ystride*3*/ \ + "lea (%[ystride],%[ystride],2),%[ystride3]\n\t" \ + /*src+2*ystride*/ \ + "movq (%[src],%[ystride],2),%%mm2\n\t" \ + /*src+3*ystride*/ \ + "movq (%[src],%[ystride3]),%%mm3\n\t" \ + /*dst+0*ystride*/ \ + "movq %%mm0,(%[dst])\n\t" \ + /*dst+1*ystride*/ \ + "movq %%mm1,(%[dst],%[ystride])\n\t" \ + /*Pointer to next 4.*/ \ + "lea (%[src],%[ystride],4),%[src]\n\t" \ + /*dst+2*ystride*/ \ + "movq %%mm2,(%[dst],%[ystride],2)\n\t" \ + /*dst+3*ystride*/ \ + "movq %%mm3,(%[dst],%[ystride3])\n\t" \ + /*Pointer to next 4.*/ \ + "lea (%[dst],%[ystride],4),%[dst]\n\t" \ + /*src+0*ystride*/ \ + "movq (%[src]),%%mm0\n\t" \ + /*src+1*ystride*/ \ + "movq (%[src],%[ystride]),%%mm1\n\t" \ + /*src+2*ystride*/ \ + "movq (%[src],%[ystride],2),%%mm2\n\t" \ + /*src+3*ystride*/ \ + "movq (%[src],%[ystride3]),%%mm3\n\t" \ + /*dst+0*ystride*/ \ + "movq %%mm0,(%[dst])\n\t" \ + /*dst+1*ystride*/ \ + "movq %%mm1,(%[dst],%[ystride])\n\t" \ + /*dst+2*ystride*/ \ + "movq %%mm2,(%[dst],%[ystride],2)\n\t" \ + /*dst+3*ystride*/ \ + "movq %%mm3,(%[dst],%[ystride3])\n\t" \ + :[dst]"+r"(dst),[src]"+r"(src),[ystride3]"=&r"(ystride3) \ + :[ystride]"r"((ptrdiff_t)(_ystride)) \ + :"memory" \ + ); \ + } \ + while(0) + +# endif +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxidct.c b/libs/libtheora-1.1/lib/x86/mmxidct.c new file mode 100644 index 00000000..e65561b7 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxidct.c @@ -0,0 +1,564 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxidct.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*MMX acceleration of Theora's iDCT. + Originally written by Rudolf Marek, based on code from On2's VP3.*/ +#include "x86int.h" +#include "../dct.h" + +#if defined(OC_X86_ASM) + +/*These are offsets into the table of constants below.*/ +/*7 rows of cosines, in order: pi/16 * (1 ... 7).*/ +#define OC_COSINE_OFFSET (0) +/*A row of 8's.*/ +#define OC_EIGHT_OFFSET (56) + + + +/*A table of constants used by the MMX routines.*/ +static const ogg_uint16_t __attribute__((aligned(8),used)) + OC_IDCT_CONSTS[(7+1)*4]={ + (ogg_uint16_t)OC_C1S7,(ogg_uint16_t)OC_C1S7, + (ogg_uint16_t)OC_C1S7,(ogg_uint16_t)OC_C1S7, + (ogg_uint16_t)OC_C2S6,(ogg_uint16_t)OC_C2S6, + (ogg_uint16_t)OC_C2S6,(ogg_uint16_t)OC_C2S6, + (ogg_uint16_t)OC_C3S5,(ogg_uint16_t)OC_C3S5, + (ogg_uint16_t)OC_C3S5,(ogg_uint16_t)OC_C3S5, + (ogg_uint16_t)OC_C4S4,(ogg_uint16_t)OC_C4S4, + (ogg_uint16_t)OC_C4S4,(ogg_uint16_t)OC_C4S4, + (ogg_uint16_t)OC_C5S3,(ogg_uint16_t)OC_C5S3, + (ogg_uint16_t)OC_C5S3,(ogg_uint16_t)OC_C5S3, + (ogg_uint16_t)OC_C6S2,(ogg_uint16_t)OC_C6S2, + (ogg_uint16_t)OC_C6S2,(ogg_uint16_t)OC_C6S2, + (ogg_uint16_t)OC_C7S1,(ogg_uint16_t)OC_C7S1, + (ogg_uint16_t)OC_C7S1,(ogg_uint16_t)OC_C7S1, + 8, 8, 8, 8 +}; + +/*Converts the expression in the argument to a string.*/ +#define OC_M2STR(_s) #_s + +/*38 cycles*/ +#define OC_IDCT_BEGIN \ + "#OC_IDCT_BEGIN\n\t" \ + "movq "OC_I(3)",%%mm2\n\t" \ + "movq "OC_C(3)",%%mm6\n\t" \ + "movq %%mm2,%%mm4\n\t" \ + "movq "OC_J(5)",%%mm7\n\t" \ + "pmulhw %%mm6,%%mm4\n\t" \ + "movq "OC_C(5)",%%mm1\n\t" \ + "pmulhw %%mm7,%%mm6\n\t" \ + "movq %%mm1,%%mm5\n\t" \ + "pmulhw %%mm2,%%mm1\n\t" \ + "movq "OC_I(1)",%%mm3\n\t" \ + "pmulhw %%mm7,%%mm5\n\t" \ + "movq "OC_C(1)",%%mm0\n\t" \ + "paddw %%mm2,%%mm4\n\t" \ + "paddw %%mm7,%%mm6\n\t" \ + "paddw %%mm1,%%mm2\n\t" \ + "movq "OC_J(7)",%%mm1\n\t" \ + "paddw %%mm5,%%mm7\n\t" \ + "movq %%mm0,%%mm5\n\t" \ + "pmulhw %%mm3,%%mm0\n\t" \ + "paddw %%mm7,%%mm4\n\t" \ + "pmulhw %%mm1,%%mm5\n\t" \ + "movq "OC_C(7)",%%mm7\n\t" \ + "psubw %%mm2,%%mm6\n\t" \ + "paddw %%mm3,%%mm0\n\t" \ + "pmulhw %%mm7,%%mm3\n\t" \ + "movq "OC_I(2)",%%mm2\n\t" \ + "pmulhw %%mm1,%%mm7\n\t" \ + "paddw %%mm1,%%mm5\n\t" \ + "movq %%mm2,%%mm1\n\t" \ + "pmulhw "OC_C(2)",%%mm2\n\t" \ + "psubw %%mm5,%%mm3\n\t" \ + "movq "OC_J(6)",%%mm5\n\t" \ + "paddw %%mm7,%%mm0\n\t" \ + "movq %%mm5,%%mm7\n\t" \ + "psubw %%mm4,%%mm0\n\t" \ + "pmulhw "OC_C(2)",%%mm5\n\t" \ + "paddw %%mm1,%%mm2\n\t" \ + "pmulhw "OC_C(6)",%%mm1\n\t" \ + "paddw %%mm4,%%mm4\n\t" \ + "paddw %%mm0,%%mm4\n\t" \ + "psubw %%mm6,%%mm3\n\t" \ + "paddw %%mm7,%%mm5\n\t" \ + "paddw %%mm6,%%mm6\n\t" \ + "pmulhw "OC_C(6)",%%mm7\n\t" \ + "paddw %%mm3,%%mm6\n\t" \ + "movq %%mm4,"OC_I(1)"\n\t" \ + "psubw %%mm5,%%mm1\n\t" \ + "movq "OC_C(4)",%%mm4\n\t" \ + "movq %%mm3,%%mm5\n\t" \ + "pmulhw %%mm4,%%mm3\n\t" \ + "paddw %%mm2,%%mm7\n\t" \ + "movq %%mm6,"OC_I(2)"\n\t" \ + "movq %%mm0,%%mm2\n\t" \ + "movq "OC_I(0)",%%mm6\n\t" \ + "pmulhw %%mm4,%%mm0\n\t" \ + "paddw %%mm3,%%mm5\n\t" \ + "movq "OC_J(4)",%%mm3\n\t" \ + "psubw %%mm1,%%mm5\n\t" \ + "paddw %%mm0,%%mm2\n\t" \ + "psubw %%mm3,%%mm6\n\t" \ + "movq %%mm6,%%mm0\n\t" \ + "pmulhw %%mm4,%%mm6\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + "paddw %%mm1,%%mm1\n\t" \ + "paddw %%mm0,%%mm3\n\t" \ + "paddw %%mm5,%%mm1\n\t" \ + "pmulhw %%mm3,%%mm4\n\t" \ + "paddw %%mm0,%%mm6\n\t" \ + "psubw %%mm2,%%mm6\n\t" \ + "paddw %%mm2,%%mm2\n\t" \ + "movq "OC_I(1)",%%mm0\n\t" \ + "paddw %%mm6,%%mm2\n\t" \ + "paddw %%mm3,%%mm4\n\t" \ + "psubw %%mm1,%%mm2\n\t" \ + "#end OC_IDCT_BEGIN\n\t" \ + +/*38+8=46 cycles.*/ +#define OC_ROW_IDCT \ + "#OC_ROW_IDCT\n" \ + OC_IDCT_BEGIN \ + /*r3=D'*/ \ + "movq "OC_I(2)",%%mm3\n\t" \ + /*r4=E'=E-G*/ \ + "psubw %%mm7,%%mm4\n\t" \ + /*r1=H'+H'*/ \ + "paddw %%mm1,%%mm1\n\t" \ + /*r7=G+G*/ \ + "paddw %%mm7,%%mm7\n\t" \ + /*r1=R1=A''+H'*/ \ + "paddw %%mm2,%%mm1\n\t" \ + /*r7=G'=E+G*/ \ + "paddw %%mm4,%%mm7\n\t" \ + /*r4=R4=E'-D'*/ \ + "psubw %%mm3,%%mm4\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + /*r6=R6=F'-B''*/ \ + "psubw %%mm5,%%mm6\n\t" \ + "paddw %%mm5,%%mm5\n\t" \ + /*r3=R3=E'+D'*/ \ + "paddw %%mm4,%%mm3\n\t" \ + /*r5=R5=F'+B''*/ \ + "paddw %%mm6,%%mm5\n\t" \ + /*r7=R7=G'-C'*/ \ + "psubw %%mm0,%%mm7\n\t" \ + "paddw %%mm0,%%mm0\n\t" \ + /*Save R1.*/ \ + "movq %%mm1,"OC_I(1)"\n\t" \ + /*r0=R0=G.+C.*/ \ + "paddw %%mm7,%%mm0\n\t" \ + "#end OC_ROW_IDCT\n\t" \ + +/*The following macro does two 4x4 transposes in place. + At entry, we assume: + r0 = a3 a2 a1 a0 + I(1) = b3 b2 b1 b0 + r2 = c3 c2 c1 c0 + r3 = d3 d2 d1 d0 + + r4 = e3 e2 e1 e0 + r5 = f3 f2 f1 f0 + r6 = g3 g2 g1 g0 + r7 = h3 h2 h1 h0 + + At exit, we have: + I(0) = d0 c0 b0 a0 + I(1) = d1 c1 b1 a1 + I(2) = d2 c2 b2 a2 + I(3) = d3 c3 b3 a3 + + J(4) = h0 g0 f0 e0 + J(5) = h1 g1 f1 e1 + J(6) = h2 g2 f2 e2 + J(7) = h3 g3 f3 e3 + + I(0) I(1) I(2) I(3) is the transpose of r0 I(1) r2 r3. + J(4) J(5) J(6) J(7) is the transpose of r4 r5 r6 r7. + + Since r1 is free at entry, we calculate the Js first.*/ +/*19 cycles.*/ +#define OC_TRANSPOSE \ + "#OC_TRANSPOSE\n\t" \ + "movq %%mm4,%%mm1\n\t" \ + "punpcklwd %%mm5,%%mm4\n\t" \ + "movq %%mm0,"OC_I(0)"\n\t" \ + "punpckhwd %%mm5,%%mm1\n\t" \ + "movq %%mm6,%%mm0\n\t" \ + "punpcklwd %%mm7,%%mm6\n\t" \ + "movq %%mm4,%%mm5\n\t" \ + "punpckldq %%mm6,%%mm4\n\t" \ + "punpckhdq %%mm6,%%mm5\n\t" \ + "movq %%mm1,%%mm6\n\t" \ + "movq %%mm4,"OC_J(4)"\n\t" \ + "punpckhwd %%mm7,%%mm0\n\t" \ + "movq %%mm5,"OC_J(5)"\n\t" \ + "punpckhdq %%mm0,%%mm6\n\t" \ + "movq "OC_I(0)",%%mm4\n\t" \ + "punpckldq %%mm0,%%mm1\n\t" \ + "movq "OC_I(1)",%%mm5\n\t" \ + "movq %%mm4,%%mm0\n\t" \ + "movq %%mm6,"OC_J(7)"\n\t" \ + "punpcklwd %%mm5,%%mm0\n\t" \ + "movq %%mm1,"OC_J(6)"\n\t" \ + "punpckhwd %%mm5,%%mm4\n\t" \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklwd %%mm3,%%mm2\n\t" \ + "movq %%mm0,%%mm1\n\t" \ + "punpckldq %%mm2,%%mm0\n\t" \ + "punpckhdq %%mm2,%%mm1\n\t" \ + "movq %%mm4,%%mm2\n\t" \ + "movq %%mm0,"OC_I(0)"\n\t" \ + "punpckhwd %%mm3,%%mm5\n\t" \ + "movq %%mm1,"OC_I(1)"\n\t" \ + "punpckhdq %%mm5,%%mm4\n\t" \ + "punpckldq %%mm5,%%mm2\n\t" \ + "movq %%mm4,"OC_I(3)"\n\t" \ + "movq %%mm2,"OC_I(2)"\n\t" \ + "#end OC_TRANSPOSE\n\t" \ + +/*38+19=57 cycles.*/ +#define OC_COLUMN_IDCT \ + "#OC_COLUMN_IDCT\n" \ + OC_IDCT_BEGIN \ + "paddw "OC_8",%%mm2\n\t" \ + /*r1=H'+H'*/ \ + "paddw %%mm1,%%mm1\n\t" \ + /*r1=R1=A''+H'*/ \ + "paddw %%mm2,%%mm1\n\t" \ + /*r2=NR2*/ \ + "psraw $4,%%mm2\n\t" \ + /*r4=E'=E-G*/ \ + "psubw %%mm7,%%mm4\n\t" \ + /*r1=NR1*/ \ + "psraw $4,%%mm1\n\t" \ + /*r3=D'*/ \ + "movq "OC_I(2)",%%mm3\n\t" \ + /*r7=G+G*/ \ + "paddw %%mm7,%%mm7\n\t" \ + /*Store NR2 at I(2).*/ \ + "movq %%mm2,"OC_I(2)"\n\t" \ + /*r7=G'=E+G*/ \ + "paddw %%mm4,%%mm7\n\t" \ + /*Store NR1 at I(1).*/ \ + "movq %%mm1,"OC_I(1)"\n\t" \ + /*r4=R4=E'-D'*/ \ + "psubw %%mm3,%%mm4\n\t" \ + "paddw "OC_8",%%mm4\n\t" \ + /*r3=D'+D'*/ \ + "paddw %%mm3,%%mm3\n\t" \ + /*r3=R3=E'+D'*/ \ + "paddw %%mm4,%%mm3\n\t" \ + /*r4=NR4*/ \ + "psraw $4,%%mm4\n\t" \ + /*r6=R6=F'-B''*/ \ + "psubw %%mm5,%%mm6\n\t" \ + /*r3=NR3*/ \ + "psraw $4,%%mm3\n\t" \ + "paddw "OC_8",%%mm6\n\t" \ + /*r5=B''+B''*/ \ + "paddw %%mm5,%%mm5\n\t" \ + /*r5=R5=F'+B''*/ \ + "paddw %%mm6,%%mm5\n\t" \ + /*r6=NR6*/ \ + "psraw $4,%%mm6\n\t" \ + /*Store NR4 at J(4).*/ \ + "movq %%mm4,"OC_J(4)"\n\t" \ + /*r5=NR5*/ \ + "psraw $4,%%mm5\n\t" \ + /*Store NR3 at I(3).*/ \ + "movq %%mm3,"OC_I(3)"\n\t" \ + /*r7=R7=G'-C'*/ \ + "psubw %%mm0,%%mm7\n\t" \ + "paddw "OC_8",%%mm7\n\t" \ + /*r0=C'+C'*/ \ + "paddw %%mm0,%%mm0\n\t" \ + /*r0=R0=G'+C'*/ \ + "paddw %%mm7,%%mm0\n\t" \ + /*r7=NR7*/ \ + "psraw $4,%%mm7\n\t" \ + /*Store NR6 at J(6).*/ \ + "movq %%mm6,"OC_J(6)"\n\t" \ + /*r0=NR0*/ \ + "psraw $4,%%mm0\n\t" \ + /*Store NR5 at J(5).*/ \ + "movq %%mm5,"OC_J(5)"\n\t" \ + /*Store NR7 at J(7).*/ \ + "movq %%mm7,"OC_J(7)"\n\t" \ + /*Store NR0 at I(0).*/ \ + "movq %%mm0,"OC_I(0)"\n\t" \ + "#end OC_COLUMN_IDCT\n\t" \ + +#define OC_MID(_m,_i) OC_M2STR(_m+(_i)*8)"(%[c])" +#define OC_C(_i) OC_MID(OC_COSINE_OFFSET,_i-1) +#define OC_8 OC_MID(OC_EIGHT_OFFSET,0) + +static void oc_idct8x8_slow(ogg_int16_t _y[64]){ + /*This routine accepts an 8x8 matrix, but in partially transposed form. + Every 4x4 block is transposed.*/ + __asm__ __volatile__( +#define OC_I(_k) OC_M2STR((_k*16))"(%[y])" +#define OC_J(_k) OC_M2STR(((_k-4)*16)+8)"(%[y])" + OC_ROW_IDCT + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) OC_M2STR((_k*16)+64)"(%[y])" +#define OC_J(_k) OC_M2STR(((_k-4)*16)+72)"(%[y])" + OC_ROW_IDCT + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) OC_M2STR((_k*16))"(%[y])" +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT +#undef OC_I +#undef OC_J +#define OC_I(_k) OC_M2STR((_k*16)+8)"(%[y])" +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT +#undef OC_I +#undef OC_J + : + :[y]"r"(_y),[c]"r"(OC_IDCT_CONSTS) + ); +} + +/*25 cycles.*/ +#define OC_IDCT_BEGIN_10 \ + "#OC_IDCT_BEGIN_10\n\t" \ + "movq "OC_I(3)",%%mm2\n\t" \ + "nop\n\t" \ + "movq "OC_C(3)",%%mm6\n\t" \ + "movq %%mm2,%%mm4\n\t" \ + "movq "OC_C(5)",%%mm1\n\t" \ + "pmulhw %%mm6,%%mm4\n\t" \ + "movq "OC_I(1)",%%mm3\n\t" \ + "pmulhw %%mm2,%%mm1\n\t" \ + "movq "OC_C(1)",%%mm0\n\t" \ + "paddw %%mm2,%%mm4\n\t" \ + "pxor %%mm6,%%mm6\n\t" \ + "paddw %%mm1,%%mm2\n\t" \ + "movq "OC_I(2)",%%mm5\n\t" \ + "pmulhw %%mm3,%%mm0\n\t" \ + "movq %%mm5,%%mm1\n\t" \ + "paddw %%mm3,%%mm0\n\t" \ + "pmulhw "OC_C(7)",%%mm3\n\t" \ + "psubw %%mm2,%%mm6\n\t" \ + "pmulhw "OC_C(2)",%%mm5\n\t" \ + "psubw %%mm4,%%mm0\n\t" \ + "movq "OC_I(2)",%%mm7\n\t" \ + "paddw %%mm4,%%mm4\n\t" \ + "paddw %%mm5,%%mm7\n\t" \ + "paddw %%mm0,%%mm4\n\t" \ + "pmulhw "OC_C(6)",%%mm1\n\t" \ + "psubw %%mm6,%%mm3\n\t" \ + "movq %%mm4,"OC_I(1)"\n\t" \ + "paddw %%mm6,%%mm6\n\t" \ + "movq "OC_C(4)",%%mm4\n\t" \ + "paddw %%mm3,%%mm6\n\t" \ + "movq %%mm3,%%mm5\n\t" \ + "pmulhw %%mm4,%%mm3\n\t" \ + "movq %%mm6,"OC_I(2)"\n\t" \ + "movq %%mm0,%%mm2\n\t" \ + "movq "OC_I(0)",%%mm6\n\t" \ + "pmulhw %%mm4,%%mm0\n\t" \ + "paddw %%mm3,%%mm5\n\t" \ + "paddw %%mm0,%%mm2\n\t" \ + "psubw %%mm1,%%mm5\n\t" \ + "pmulhw %%mm4,%%mm6\n\t" \ + "paddw "OC_I(0)",%%mm6\n\t" \ + "paddw %%mm1,%%mm1\n\t" \ + "movq %%mm6,%%mm4\n\t" \ + "paddw %%mm5,%%mm1\n\t" \ + "psubw %%mm2,%%mm6\n\t" \ + "paddw %%mm2,%%mm2\n\t" \ + "movq "OC_I(1)",%%mm0\n\t" \ + "paddw %%mm6,%%mm2\n\t" \ + "psubw %%mm1,%%mm2\n\t" \ + "nop\n\t" \ + "#end OC_IDCT_BEGIN_10\n\t" \ + +/*25+8=33 cycles.*/ +#define OC_ROW_IDCT_10 \ + "#OC_ROW_IDCT_10\n\t" \ + OC_IDCT_BEGIN_10 \ + /*r3=D'*/ \ + "movq "OC_I(2)",%%mm3\n\t" \ + /*r4=E'=E-G*/ \ + "psubw %%mm7,%%mm4\n\t" \ + /*r1=H'+H'*/ \ + "paddw %%mm1,%%mm1\n\t" \ + /*r7=G+G*/ \ + "paddw %%mm7,%%mm7\n\t" \ + /*r1=R1=A''+H'*/ \ + "paddw %%mm2,%%mm1\n\t" \ + /*r7=G'=E+G*/ \ + "paddw %%mm4,%%mm7\n\t" \ + /*r4=R4=E'-D'*/ \ + "psubw %%mm3,%%mm4\n\t" \ + "paddw %%mm3,%%mm3\n\t" \ + /*r6=R6=F'-B''*/ \ + "psubw %%mm5,%%mm6\n\t" \ + "paddw %%mm5,%%mm5\n\t" \ + /*r3=R3=E'+D'*/ \ + "paddw %%mm4,%%mm3\n\t" \ + /*r5=R5=F'+B''*/ \ + "paddw %%mm6,%%mm5\n\t" \ + /*r7=R7=G'-C'*/ \ + "psubw %%mm0,%%mm7\n\t" \ + "paddw %%mm0,%%mm0\n\t" \ + /*Save R1.*/ \ + "movq %%mm1,"OC_I(1)"\n\t" \ + /*r0=R0=G'+C'*/ \ + "paddw %%mm7,%%mm0\n\t" \ + "#end OC_ROW_IDCT_10\n\t" \ + +/*25+19=44 cycles'*/ +#define OC_COLUMN_IDCT_10 \ + "#OC_COLUMN_IDCT_10\n\t" \ + OC_IDCT_BEGIN_10 \ + "paddw "OC_8",%%mm2\n\t" \ + /*r1=H'+H'*/ \ + "paddw %%mm1,%%mm1\n\t" \ + /*r1=R1=A''+H'*/ \ + "paddw %%mm2,%%mm1\n\t" \ + /*r2=NR2*/ \ + "psraw $4,%%mm2\n\t" \ + /*r4=E'=E-G*/ \ + "psubw %%mm7,%%mm4\n\t" \ + /*r1=NR1*/ \ + "psraw $4,%%mm1\n\t" \ + /*r3=D'*/ \ + "movq "OC_I(2)",%%mm3\n\t" \ + /*r7=G+G*/ \ + "paddw %%mm7,%%mm7\n\t" \ + /*Store NR2 at I(2).*/ \ + "movq %%mm2,"OC_I(2)"\n\t" \ + /*r7=G'=E+G*/ \ + "paddw %%mm4,%%mm7\n\t" \ + /*Store NR1 at I(1).*/ \ + "movq %%mm1,"OC_I(1)"\n\t" \ + /*r4=R4=E'-D'*/ \ + "psubw %%mm3,%%mm4\n\t" \ + "paddw "OC_8",%%mm4\n\t" \ + /*r3=D'+D'*/ \ + "paddw %%mm3,%%mm3\n\t" \ + /*r3=R3=E'+D'*/ \ + "paddw %%mm4,%%mm3\n\t" \ + /*r4=NR4*/ \ + "psraw $4,%%mm4\n\t" \ + /*r6=R6=F'-B''*/ \ + "psubw %%mm5,%%mm6\n\t" \ + /*r3=NR3*/ \ + "psraw $4,%%mm3\n\t" \ + "paddw "OC_8",%%mm6\n\t" \ + /*r5=B''+B''*/ \ + "paddw %%mm5,%%mm5\n\t" \ + /*r5=R5=F'+B''*/ \ + "paddw %%mm6,%%mm5\n\t" \ + /*r6=NR6*/ \ + "psraw $4,%%mm6\n\t" \ + /*Store NR4 at J(4).*/ \ + "movq %%mm4,"OC_J(4)"\n\t" \ + /*r5=NR5*/ \ + "psraw $4,%%mm5\n\t" \ + /*Store NR3 at I(3).*/ \ + "movq %%mm3,"OC_I(3)"\n\t" \ + /*r7=R7=G'-C'*/ \ + "psubw %%mm0,%%mm7\n\t" \ + "paddw "OC_8",%%mm7\n\t" \ + /*r0=C'+C'*/ \ + "paddw %%mm0,%%mm0\n\t" \ + /*r0=R0=G'+C'*/ \ + "paddw %%mm7,%%mm0\n\t" \ + /*r7=NR7*/ \ + "psraw $4,%%mm7\n\t" \ + /*Store NR6 at J(6).*/ \ + "movq %%mm6,"OC_J(6)"\n\t" \ + /*r0=NR0*/ \ + "psraw $4,%%mm0\n\t" \ + /*Store NR5 at J(5).*/ \ + "movq %%mm5,"OC_J(5)"\n\t" \ + /*Store NR7 at J(7).*/ \ + "movq %%mm7,"OC_J(7)"\n\t" \ + /*Store NR0 at I(0).*/ \ + "movq %%mm0,"OC_I(0)"\n\t" \ + "#end OC_COLUMN_IDCT_10\n\t" \ + +static void oc_idct8x8_10(ogg_int16_t _y[64]){ + __asm__ __volatile__( +#define OC_I(_k) OC_M2STR((_k*16))"(%[y])" +#define OC_J(_k) OC_M2STR(((_k-4)*16)+8)"(%[y])" + /*Done with dequant, descramble, and partial transpose. + Now do the iDCT itself.*/ + OC_ROW_IDCT_10 + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) OC_M2STR((_k*16))"(%[y])" +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT_10 +#undef OC_I +#undef OC_J +#define OC_I(_k) OC_M2STR((_k*16)+8)"(%[y])" +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT_10 +#undef OC_I +#undef OC_J + : + :[y]"r"(_y),[c]"r"(OC_IDCT_CONSTS) + ); +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform.*/ +void oc_idct8x8_mmx(ogg_int16_t _y[64],int _last_zzi){ + /*_last_zzi is subtly different from an actual count of the number of + coefficients we decoded for this block. + It contains the value of zzi BEFORE the final token in the block was + decoded. + In most cases this is an EOB token (the continuation of an EOB run from a + previous block counts), and so this is the same as the coefficient count. + However, in the case that the last token was NOT an EOB token, but filled + the block up with exactly 64 coefficients, _last_zzi will be less than 64. + Provided the last token was not a pure zero run, the minimum value it can + be is 46, and so that doesn't affect any of the cases in this routine. + However, if the last token WAS a pure zero run of length 63, then _last_zzi + will be 1 while the number of coefficients decoded is 64. + Thus, we will trigger the following special case, where the real + coefficient count would not. + Note also that a zero run of length 64 will give _last_zzi a value of 0, + but we still process the DC coefficient, which might have a non-zero value + due to DC prediction. + Although convoluted, this is arguably the correct behavior: it allows us to + use a smaller transform when the block ends with a long zero run instead + of a normal EOB token. + It could be smarter... multiple separate zero runs at the end of a block + will fool it, but an encoder that generates these really deserves what it + gets. + Needless to say we inherited this approach from VP3.*/ + /*Then perform the iDCT.*/ + if(_last_zzi<10)oc_idct8x8_10(_y); + else oc_idct8x8_slow(_y); +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxloop.h b/libs/libtheora-1.1/lib/x86/mmxloop.h new file mode 100644 index 00000000..2e870c79 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxloop.h @@ -0,0 +1,215 @@ +#if !defined(_x86_mmxloop_H) +# define _x86_mmxloop_H (1) +# include +# include "x86int.h" + +#if defined(OC_X86_ASM) + +/*On entry, mm0={a0,...,a7}, mm1={b0,...,b7}, mm2={c0,...,c7}, mm3={d0,...d7}. + On exit, mm1={b0+lflim(R_0,L),...,b7+lflim(R_7,L)} and + mm2={c0-lflim(R_0,L),...,c7-lflim(R_7,L)}; mm0 and mm3 are clobbered.*/ +#define OC_LOOP_FILTER8_MMX \ + "#OC_LOOP_FILTER8_MMX\n\t" \ + /*mm7=0*/ \ + "pxor %%mm7,%%mm7\n\t" \ + /*mm6:mm0={a0,...,a7}*/ \ + "movq %%mm0,%%mm6\n\t" \ + "punpcklbw %%mm7,%%mm0\n\t" \ + "punpckhbw %%mm7,%%mm6\n\t" \ + /*mm3:mm5={d0,...,d7}*/ \ + "movq %%mm3,%%mm5\n\t" \ + "punpcklbw %%mm7,%%mm3\n\t" \ + "punpckhbw %%mm7,%%mm5\n\t" \ + /*mm6:mm0={a0-d0,...,a7-d7}*/ \ + "psubw %%mm3,%%mm0\n\t" \ + "psubw %%mm5,%%mm6\n\t" \ + /*mm3:mm1={b0,...,b7}*/ \ + "movq %%mm1,%%mm3\n\t" \ + "punpcklbw %%mm7,%%mm1\n\t" \ + "movq %%mm2,%%mm4\n\t" \ + "punpckhbw %%mm7,%%mm3\n\t" \ + /*mm5:mm4={c0,...,c7}*/ \ + "movq %%mm2,%%mm5\n\t" \ + "punpcklbw %%mm7,%%mm4\n\t" \ + "punpckhbw %%mm7,%%mm5\n\t" \ + /*mm7={3}x4 \ + mm5:mm4={c0-b0,...,c7-b7}*/ \ + "pcmpeqw %%mm7,%%mm7\n\t" \ + "psubw %%mm1,%%mm4\n\t" \ + "psrlw $14,%%mm7\n\t" \ + "psubw %%mm3,%%mm5\n\t" \ + /*Scale by 3.*/ \ + "pmullw %%mm7,%%mm4\n\t" \ + "pmullw %%mm7,%%mm5\n\t" \ + /*mm7={4}x4 \ + mm5:mm4=f={a0-d0+3*(c0-b0),...,a7-d7+3*(c7-b7)}*/ \ + "psrlw $1,%%mm7\n\t" \ + "paddw %%mm0,%%mm4\n\t" \ + "psllw $2,%%mm7\n\t" \ + "movq (%[ll]),%%mm0\n\t" \ + "paddw %%mm6,%%mm5\n\t" \ + /*R_i has the range [-127,128], so we compute -R_i instead. \ + mm4=-R_i=-(f+4>>3)=0xFF^(f-4>>3)*/ \ + "psubw %%mm7,%%mm4\n\t" \ + "psubw %%mm7,%%mm5\n\t" \ + "psraw $3,%%mm4\n\t" \ + "psraw $3,%%mm5\n\t" \ + "pcmpeqb %%mm7,%%mm7\n\t" \ + "packsswb %%mm5,%%mm4\n\t" \ + "pxor %%mm6,%%mm6\n\t" \ + "pxor %%mm7,%%mm4\n\t" \ + "packuswb %%mm3,%%mm1\n\t" \ + /*Now compute lflim of -mm4 cf. Section 7.10 of the sepc.*/ \ + /*There's no unsigned byte+signed byte with unsigned saturation op code, so \ + we have to split things by sign (the other option is to work in 16 bits, \ + but working in 8 bits gives much better parallelism). \ + We compute abs(R_i), but save a mask of which terms were negative in mm6. \ + Then we compute mm4=abs(lflim(R_i,L))=min(abs(R_i),max(2*L-abs(R_i),0)). \ + Finally, we split mm4 into positive and negative pieces using the mask in \ + mm6, and add and subtract them as appropriate.*/ \ + /*mm4=abs(-R_i)*/ \ + /*mm7=255-2*L*/ \ + "pcmpgtb %%mm4,%%mm6\n\t" \ + "psubb %%mm0,%%mm7\n\t" \ + "pxor %%mm6,%%mm4\n\t" \ + "psubb %%mm0,%%mm7\n\t" \ + "psubb %%mm6,%%mm4\n\t" \ + /*mm7=255-max(2*L-abs(R_i),0)*/ \ + "paddusb %%mm4,%%mm7\n\t" \ + /*mm4=min(abs(R_i),max(2*L-abs(R_i),0))*/ \ + "paddusb %%mm7,%%mm4\n\t" \ + "psubusb %%mm7,%%mm4\n\t" \ + /*Now split mm4 by the original sign of -R_i.*/ \ + "movq %%mm4,%%mm5\n\t" \ + "pand %%mm6,%%mm4\n\t" \ + "pandn %%mm5,%%mm6\n\t" \ + /*mm1={b0+lflim(R_0,L),...,b7+lflim(R_7,L)}*/ \ + /*mm2={c0-lflim(R_0,L),...,c7-lflim(R_7,L)}*/ \ + "paddusb %%mm4,%%mm1\n\t" \ + "psubusb %%mm4,%%mm2\n\t" \ + "psubusb %%mm6,%%mm1\n\t" \ + "paddusb %%mm6,%%mm2\n\t" \ + +#define OC_LOOP_FILTER_V_MMX(_pix,_ystride,_ll) \ + do{ \ + ptrdiff_t ystride3__; \ + __asm__ __volatile__( \ + /*mm0={a0,...,a7}*/ \ + "movq (%[pix]),%%mm0\n\t" \ + /*ystride3=_ystride*3*/ \ + "lea (%[ystride],%[ystride],2),%[ystride3]\n\t" \ + /*mm3={d0,...,d7}*/ \ + "movq (%[pix],%[ystride3]),%%mm3\n\t" \ + /*mm1={b0,...,b7}*/ \ + "movq (%[pix],%[ystride]),%%mm1\n\t" \ + /*mm2={c0,...,c7}*/ \ + "movq (%[pix],%[ystride],2),%%mm2\n\t" \ + OC_LOOP_FILTER8_MMX \ + /*Write it back out.*/ \ + "movq %%mm1,(%[pix],%[ystride])\n\t" \ + "movq %%mm2,(%[pix],%[ystride],2)\n\t" \ + :[ystride3]"=&r"(ystride3__) \ + :[pix]"r"(_pix-_ystride*2),[ystride]"r"((ptrdiff_t)(_ystride)), \ + [ll]"r"(_ll) \ + :"memory" \ + ); \ + } \ + while(0) + +#define OC_LOOP_FILTER_H_MMX(_pix,_ystride,_ll) \ + do{ \ + unsigned char *pix__; \ + ptrdiff_t ystride3__; \ + ptrdiff_t d__; \ + pix__=(_pix)-2; \ + __asm__ __volatile__( \ + /*x x x x d0 c0 b0 a0*/ \ + "movd (%[pix]),%%mm0\n\t" \ + /*x x x x d1 c1 b1 a1*/ \ + "movd (%[pix],%[ystride]),%%mm1\n\t" \ + /*ystride3=_ystride*3*/ \ + "lea (%[ystride],%[ystride],2),%[ystride3]\n\t" \ + /*x x x x d2 c2 b2 a2*/ \ + "movd (%[pix],%[ystride],2),%%mm2\n\t" \ + /*x x x x d3 c3 b3 a3*/ \ + "lea (%[pix],%[ystride],4),%[d]\n\t" \ + "movd (%[pix],%[ystride3]),%%mm3\n\t" \ + /*x x x x d4 c4 b4 a4*/ \ + "movd (%[d]),%%mm4\n\t" \ + /*x x x x d5 c5 b5 a5*/ \ + "movd (%[d],%[ystride]),%%mm5\n\t" \ + /*x x x x d6 c6 b6 a6*/ \ + "movd (%[d],%[ystride],2),%%mm6\n\t" \ + /*x x x x d7 c7 b7 a7*/ \ + "movd (%[d],%[ystride3]),%%mm7\n\t" \ + /*mm0=d1 d0 c1 c0 b1 b0 a1 a0*/ \ + "punpcklbw %%mm1,%%mm0\n\t" \ + /*mm2=d3 d2 c3 c2 b3 b2 a3 a2*/ \ + "punpcklbw %%mm3,%%mm2\n\t" \ + /*mm3=d1 d0 c1 c0 b1 b0 a1 a0*/ \ + "movq %%mm0,%%mm3\n\t" \ + /*mm0=b3 b2 b1 b0 a3 a2 a1 a0*/ \ + "punpcklwd %%mm2,%%mm0\n\t" \ + /*mm3=d3 d2 d1 d0 c3 c2 c1 c0*/ \ + "punpckhwd %%mm2,%%mm3\n\t" \ + /*mm1=b3 b2 b1 b0 a3 a2 a1 a0*/ \ + "movq %%mm0,%%mm1\n\t" \ + /*mm4=d5 d4 c5 c4 b5 b4 a5 a4*/ \ + "punpcklbw %%mm5,%%mm4\n\t" \ + /*mm6=d7 d6 c7 c6 b7 b6 a7 a6*/ \ + "punpcklbw %%mm7,%%mm6\n\t" \ + /*mm5=d5 d4 c5 c4 b5 b4 a5 a4*/ \ + "movq %%mm4,%%mm5\n\t" \ + /*mm4=b7 b6 b5 b4 a7 a6 a5 a4*/ \ + "punpcklwd %%mm6,%%mm4\n\t" \ + /*mm5=d7 d6 d5 d4 c7 c6 c5 c4*/ \ + "punpckhwd %%mm6,%%mm5\n\t" \ + /*mm2=d3 d2 d1 d0 c3 c2 c1 c0*/ \ + "movq %%mm3,%%mm2\n\t" \ + /*mm0=a7 a6 a5 a4 a3 a2 a1 a0*/ \ + "punpckldq %%mm4,%%mm0\n\t" \ + /*mm1=b7 b6 b5 b4 b3 b2 b1 b0*/ \ + "punpckhdq %%mm4,%%mm1\n\t" \ + /*mm2=c7 c6 c5 c4 c3 c2 c1 c0*/ \ + "punpckldq %%mm5,%%mm2\n\t" \ + /*mm3=d7 d6 d5 d4 d3 d2 d1 d0*/ \ + "punpckhdq %%mm5,%%mm3\n\t" \ + OC_LOOP_FILTER8_MMX \ + /*mm2={b0+R_0'',...,b7+R_7''}*/ \ + "movq %%mm1,%%mm0\n\t" \ + /*mm1={b0+R_0'',c0-R_0'',...,b3+R_3'',c3-R_3''}*/ \ + "punpcklbw %%mm2,%%mm1\n\t" \ + /*mm2={b4+R_4'',c4-R_4'',...,b7+R_7'',c7-R_7''}*/ \ + "punpckhbw %%mm2,%%mm0\n\t" \ + /*[d]=c1 b1 c0 b0*/ \ + "movd %%mm1,%[d]\n\t" \ + "movw %w[d],1(%[pix])\n\t" \ + "psrlq $32,%%mm1\n\t" \ + "shr $16,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride])\n\t" \ + /*[d]=c3 b3 c2 b2*/ \ + "movd %%mm1,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride],2)\n\t" \ + "shr $16,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride3])\n\t" \ + "lea (%[pix],%[ystride],4),%[pix]\n\t" \ + /*[d]=c5 b5 c4 b4*/ \ + "movd %%mm0,%[d]\n\t" \ + "movw %w[d],1(%[pix])\n\t" \ + "psrlq $32,%%mm0\n\t" \ + "shr $16,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride])\n\t" \ + /*[d]=c7 b7 c6 b6*/ \ + "movd %%mm0,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride],2)\n\t" \ + "shr $16,%[d]\n\t" \ + "movw %w[d],1(%[pix],%[ystride3])\n\t" \ + :[pix]"+r"(pix__),[ystride3]"=&r"(ystride3__),[d]"=&r"(d__) \ + :[ystride]"r"((ptrdiff_t)(_ystride)),[ll]"r"(_ll) \ + :"memory" \ + ); \ + } \ + while(0) + +# endif +#endif diff --git a/libs/libtheora-1.1/lib/x86/mmxstate.c b/libs/libtheora-1.1/lib/x86/mmxstate.c new file mode 100644 index 00000000..f8955083 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/mmxstate.c @@ -0,0 +1,188 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxstate.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*MMX acceleration of complete fragment reconstruction algorithm. + Originally written by Rudolf Marek.*/ +#include +#include "x86int.h" +#include "mmxfrag.h" +#include "mmxloop.h" + +#if defined(OC_X86_ASM) + +void oc_state_frag_recon_mmx(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ + unsigned char *dst; + ptrdiff_t frag_buf_off; + int ystride; + int mb_mode; + /*Apply the inverse transform.*/ + /*Special case only having a DC component.*/ + if(_last_zzi<2){ + /*Note that this value must be unsigned, to keep the __asm__ block from + sign-extending it when it puts it in a register.*/ + ogg_uint16_t p; + /*We round this dequant product (and not any of the others) because there's + no iDCT rounding.*/ + p=(ogg_int16_t)(_dct_coeffs[0]*(ogg_int32_t)_dc_quant+15>>5); + /*Fill _dct_coeffs with p.*/ + __asm__ __volatile__( + /*mm0=0000 0000 0000 AAAA*/ + "movd %[p],%%mm0\n\t" + /*mm0=0000 0000 AAAA AAAA*/ + "punpcklwd %%mm0,%%mm0\n\t" + /*mm0=AAAA AAAA AAAA AAAA*/ + "punpckldq %%mm0,%%mm0\n\t" + "movq %%mm0,(%[y])\n\t" + "movq %%mm0,8(%[y])\n\t" + "movq %%mm0,16(%[y])\n\t" + "movq %%mm0,24(%[y])\n\t" + "movq %%mm0,32(%[y])\n\t" + "movq %%mm0,40(%[y])\n\t" + "movq %%mm0,48(%[y])\n\t" + "movq %%mm0,56(%[y])\n\t" + "movq %%mm0,64(%[y])\n\t" + "movq %%mm0,72(%[y])\n\t" + "movq %%mm0,80(%[y])\n\t" + "movq %%mm0,88(%[y])\n\t" + "movq %%mm0,96(%[y])\n\t" + "movq %%mm0,104(%[y])\n\t" + "movq %%mm0,112(%[y])\n\t" + "movq %%mm0,120(%[y])\n\t" + : + :[y]"r"(_dct_coeffs),[p]"r"((unsigned)p) + :"memory" + ); + } + else{ + /*Dequantize the DC coefficient.*/ + _dct_coeffs[0]=(ogg_int16_t)(_dct_coeffs[0]*(int)_dc_quant); + oc_idct8x8_mmx(_dct_coeffs,_last_zzi); + } + /*Fill in the target buffer.*/ + frag_buf_off=_state->frag_buf_offs[_fragi]; + mb_mode=_state->frags[_fragi].mb_mode; + ystride=_state->ref_ystride[_pli]; + dst=_state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_SELF]]+frag_buf_off; + if(mb_mode==OC_MODE_INTRA)oc_frag_recon_intra_mmx(dst,ystride,_dct_coeffs); + else{ + const unsigned char *ref; + int mvoffsets[2]; + ref= + _state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_FOR_MODE(mb_mode)]] + +frag_buf_off; + if(oc_state_get_mv_offsets(_state,mvoffsets,_pli, + _state->frag_mvs[_fragi][0],_state->frag_mvs[_fragi][1])>1){ + oc_frag_recon_inter2_mmx(dst,ref+mvoffsets[0],ref+mvoffsets[1],ystride, + _dct_coeffs); + } + else oc_frag_recon_inter_mmx(dst,ref+mvoffsets[0],ystride,_dct_coeffs); + } +} + +/*We copy these entire function to inline the actual MMX routines so that we + use only a single indirect call.*/ + +/*Copies the fragments specified by the lists of fragment indices from one + frame to another. + _fragis: A pointer to a list of fragment indices. + _nfragis: The number of fragment indices to copy. + _dst_frame: The reference frame to copy to. + _src_frame: The reference frame to copy from. + _pli: The color plane the fragments lie in.*/ +void oc_state_frag_copy_list_mmx(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli){ + const ptrdiff_t *frag_buf_offs; + const unsigned char *src_frame_data; + unsigned char *dst_frame_data; + ptrdiff_t fragii; + int ystride; + dst_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_dst_frame]]; + src_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_src_frame]]; + ystride=_state->ref_ystride[_pli]; + frag_buf_offs=_state->frag_buf_offs; + for(fragii=0;fragii<_nfragis;fragii++){ + ptrdiff_t frag_buf_off; + frag_buf_off=frag_buf_offs[_fragis[fragii]]; + OC_FRAG_COPY_MMX(dst_frame_data+frag_buf_off, + src_frame_data+frag_buf_off,ystride); + } +} + +/*Apply the loop filter to a given set of fragment rows in the given plane. + The filter may be run on the bottom edge, affecting pixels in the next row of + fragments, so this row also needs to be available. + _bv: The bounding values array. + _refi: The index of the frame buffer to filter. + _pli: The color plane to filter. + _fragy0: The Y coordinate of the first fragment row to filter. + _fragy_end: The Y coordinate of the fragment row to stop filtering at.*/ +void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end){ + OC_ALIGN8(unsigned char ll[8]); + const oc_fragment_plane *fplane; + const oc_fragment *frags; + const ptrdiff_t *frag_buf_offs; + unsigned char *ref_frame_data; + ptrdiff_t fragi_top; + ptrdiff_t fragi_bot; + ptrdiff_t fragi0; + ptrdiff_t fragi0_end; + int ystride; + int nhfrags; + memset(ll,_state->loop_filter_limits[_state->qis[0]],sizeof(ll)); + fplane=_state->fplanes+_pli; + nhfrags=fplane->nhfrags; + fragi_top=fplane->froffset; + fragi_bot=fragi_top+fplane->nfrags; + fragi0=fragi_top+_fragy0*(ptrdiff_t)nhfrags; + fragi0_end=fragi0+(_fragy_end-_fragy0)*(ptrdiff_t)nhfrags; + ystride=_state->ref_ystride[_pli]; + frags=_state->frags; + frag_buf_offs=_state->frag_buf_offs; + ref_frame_data=_state->ref_frame_data[_refi]; + /*The following loops are constructed somewhat non-intuitively on purpose. + The main idea is: if a block boundary has at least one coded fragment on + it, the filter is applied to it. + However, the order that the filters are applied in matters, and VP3 chose + the somewhat strange ordering used below.*/ + while(fragi0fragi0)OC_LOOP_FILTER_H_MMX(ref,ystride,ll); + if(fragi0>fragi_top)OC_LOOP_FILTER_V_MMX(ref,ystride,ll); + if(fragi+1 +#include "x86enc.h" + +#if defined(OC_X86_64_ASM) + +# define OC_FDCT8x8 \ + /*Note: xmm15={0}x8 and xmm14={-1}x8.*/ \ + "#OC_FDCT8x8\n\t" \ + /*Stage 1:*/ \ + "movdqa %%xmm0,%%xmm11\n\t" \ + "movdqa %%xmm1,%%xmm10\n\t" \ + "movdqa %%xmm2,%%xmm9\n\t" \ + "movdqa %%xmm3,%%xmm8\n\t" \ + /*xmm11=t7'=t0-t7*/ \ + "psubw %%xmm7,%%xmm11\n\t" \ + /*xmm10=t6'=t1-t6*/ \ + "psubw %%xmm6,%%xmm10\n\t" \ + /*xmm9=t5'=t2-t5*/ \ + "psubw %%xmm5,%%xmm9\n\t" \ + /*xmm8=t4'=t3-t4*/ \ + "psubw %%xmm4,%%xmm8\n\t" \ + /*xmm0=t0'=t0+t7*/ \ + "paddw %%xmm7,%%xmm0\n\t" \ + /*xmm1=t1'=t1+t6*/ \ + "paddw %%xmm6,%%xmm1\n\t" \ + /*xmm5=t2'=t2+t5*/ \ + "paddw %%xmm2,%%xmm5\n\t" \ + /*xmm4=t3'=t3+t4*/ \ + "paddw %%xmm3,%%xmm4\n\t" \ + /*xmm2,3,6,7 are now free.*/ \ + /*Stage 2:*/ \ + "movdqa %%xmm0,%%xmm3\n\t" \ + "mov $0x5A806A0A,%[a]\n\t" \ + "movdqa %%xmm1,%%xmm2\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "movdqa %%xmm10,%%xmm6\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + /*xmm2=t2''=t1'-t2'*/ \ + "psubw %%xmm5,%%xmm2\n\t" \ + "pxor %%xmm12,%%xmm12\n\t" \ + /*xmm3=t3''=t0'-t3'*/ \ + "psubw %%xmm4,%%xmm3\n\t" \ + "psubw %%xmm14,%%xmm12\n\t" \ + /*xmm10=t5''=t6'-t5'*/ \ + "psubw %%xmm9,%%xmm10\n\t" \ + "paddw %%xmm12,%%xmm12\n\t" \ + /*xmm4=t0''=t0'+t3'*/ \ + "paddw %%xmm0,%%xmm4\n\t" \ + /*xmm1=t1''=t1'+t2'*/ \ + "paddw %%xmm5,%%xmm1\n\t" \ + /*xmm6=t6''=t6'+t5'*/ \ + "paddw %%xmm9,%%xmm6\n\t" \ + /*xmm0,xmm5,xmm9 are now free.*/ \ + /*Stage 3:*/ \ + /*xmm10:xmm5=t5''*27146+0xB500 \ + xmm0=t5''*/ \ + "movdqa %%xmm10,%%xmm5\n\t" \ + "movdqa %%xmm10,%%xmm0\n\t" \ + "punpckhwd %%xmm12,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + "punpcklwd %%xmm12,%%xmm5\n\t" \ + "pmaddwd %%xmm13,%%xmm5\n\t" \ + /*xmm5=(t5''*27146+0xB500>>16)+t5''*/ \ + "psrad $16,%%xmm10\n\t" \ + "psrad $16,%%xmm5\n\t" \ + "packssdw %%xmm10,%%xmm5\n\t" \ + "paddw %%xmm0,%%xmm5\n\t" \ + /*xmm0=s=(t5''*27146+0xB500>>16)+t5''+(t5''!=0)>>1*/ \ + "pcmpeqw %%xmm15,%%xmm0\n\t" \ + "psubw %%xmm14,%%xmm0\n\t" \ + "paddw %%xmm5,%%xmm0\n\t" \ + "movdqa %%xmm8,%%xmm5\n\t" \ + "psraw $1,%%xmm0\n\t" \ + /*xmm5=t5'''=t4'-s*/ \ + "psubw %%xmm0,%%xmm5\n\t" \ + /*xmm8=t4''=t4'+s*/ \ + "paddw %%xmm0,%%xmm8\n\t" \ + /*xmm0,xmm7,xmm9,xmm10 are free.*/ \ + /*xmm7:xmm9=t6''*27146+0xB500*/ \ + "movdqa %%xmm6,%%xmm7\n\t" \ + "movdqa %%xmm6,%%xmm9\n\t" \ + "punpckhwd %%xmm12,%%xmm7\n\t" \ + "pmaddwd %%xmm13,%%xmm7\n\t" \ + "punpcklwd %%xmm12,%%xmm9\n\t" \ + "pmaddwd %%xmm13,%%xmm9\n\t" \ + /*xmm9=(t6''*27146+0xB500>>16)+t6''*/ \ + "psrad $16,%%xmm7\n\t" \ + "psrad $16,%%xmm9\n\t" \ + "packssdw %%xmm7,%%xmm9\n\t" \ + "paddw %%xmm6,%%xmm9\n\t" \ + /*xmm9=s=(t6''*27146+0xB500>>16)+t6''+(t6''!=0)>>1*/ \ + "pcmpeqw %%xmm15,%%xmm6\n\t" \ + "psubw %%xmm14,%%xmm6\n\t" \ + "paddw %%xmm6,%%xmm9\n\t" \ + "movdqa %%xmm11,%%xmm7\n\t" \ + "psraw $1,%%xmm9\n\t" \ + /*xmm7=t6'''=t7'-s*/ \ + "psubw %%xmm9,%%xmm7\n\t" \ + /*xmm9=t7''=t7'+s*/ \ + "paddw %%xmm11,%%xmm9\n\t" \ + /*xmm0,xmm6,xmm10,xmm11 are free.*/ \ + /*Stage 4:*/ \ + /*xmm10:xmm0=t1''*27146+0xB500*/ \ + "movdqa %%xmm1,%%xmm0\n\t" \ + "movdqa %%xmm1,%%xmm10\n\t" \ + "punpcklwd %%xmm12,%%xmm0\n\t" \ + "pmaddwd %%xmm13,%%xmm0\n\t" \ + "punpckhwd %%xmm12,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + /*xmm0=(t1''*27146+0xB500>>16)+t1''*/ \ + "psrad $16,%%xmm0\n\t" \ + "psrad $16,%%xmm10\n\t" \ + "mov $0x20006A0A,%[a]\n\t" \ + "packssdw %%xmm10,%%xmm0\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddw %%xmm1,%%xmm0\n\t" \ + /*xmm0=s=(t1''*27146+0xB500>>16)+t1''+(t1''!=0)*/ \ + "pcmpeqw %%xmm15,%%xmm1\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "psubw %%xmm14,%%xmm1\n\t" \ + "paddw %%xmm1,%%xmm0\n\t" \ + /*xmm10:xmm4=t0''*27146+0x4000*/ \ + "movdqa %%xmm4,%%xmm1\n\t" \ + "movdqa %%xmm4,%%xmm10\n\t" \ + "punpcklwd %%xmm12,%%xmm4\n\t" \ + "pmaddwd %%xmm13,%%xmm4\n\t" \ + "punpckhwd %%xmm12,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + /*xmm4=(t0''*27146+0x4000>>16)+t0''*/ \ + "psrad $16,%%xmm4\n\t" \ + "psrad $16,%%xmm10\n\t" \ + "mov $0x6CB7,%[a]\n\t" \ + "packssdw %%xmm10,%%xmm4\n\t" \ + "movd %[a],%%xmm12\n\t" \ + "paddw %%xmm1,%%xmm4\n\t" \ + /*xmm4=r=(t0''*27146+0x4000>>16)+t0''+(t0''!=0)*/ \ + "pcmpeqw %%xmm15,%%xmm1\n\t" \ + "pshufd $00,%%xmm12,%%xmm12\n\t" \ + "psubw %%xmm14,%%xmm1\n\t" \ + "mov $0x7FFF6C84,%[a]\n\t" \ + "paddw %%xmm1,%%xmm4\n\t" \ + /*xmm0=_y[0]=u=r+s>>1 \ + The naive implementation could cause overflow, so we use \ + u=(r&s)+((r^s)>>1).*/ \ + "movdqa %%xmm0,%%xmm6\n\t" \ + "pxor %%xmm4,%%xmm0\n\t" \ + "pand %%xmm4,%%xmm6\n\t" \ + "psraw $1,%%xmm0\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddw %%xmm6,%%xmm0\n\t" \ + /*xmm4=_y[4]=v=r-u*/ \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "psubw %%xmm0,%%xmm4\n\t" \ + /*xmm1,xmm6,xmm10,xmm11 are free.*/ \ + /*xmm6:xmm10=60547*t3''+0x6CB7*/ \ + "movdqa %%xmm3,%%xmm10\n\t" \ + "movdqa %%xmm3,%%xmm6\n\t" \ + "punpcklwd %%xmm3,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + "mov $0x61F861F8,%[a]\n\t" \ + "punpckhwd %%xmm3,%%xmm6\n\t" \ + "pmaddwd %%xmm13,%%xmm6\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm6\n\t" \ + /*xmm1:xmm2=25080*t2'' \ + xmm12=t2''*/ \ + "movdqa %%xmm2,%%xmm11\n\t" \ + "movdqa %%xmm2,%%xmm12\n\t" \ + "pmullw %%xmm13,%%xmm2\n\t" \ + "pmulhw %%xmm13,%%xmm11\n\t" \ + "movdqa %%xmm2,%%xmm1\n\t" \ + "punpcklwd %%xmm11,%%xmm2\n\t" \ + "punpckhwd %%xmm11,%%xmm1\n\t" \ + /*xmm10=u=(25080*t2''+60547*t3''+0x6CB7>>16)+(t3''!=0)*/ \ + "paddd %%xmm2,%%xmm10\n\t" \ + "paddd %%xmm1,%%xmm6\n\t" \ + "psrad $16,%%xmm10\n\t" \ + "pcmpeqw %%xmm15,%%xmm3\n\t" \ + "psrad $16,%%xmm6\n\t" \ + "psubw %%xmm14,%%xmm3\n\t" \ + "packssdw %%xmm6,%%xmm10\n\t" \ + "paddw %%xmm3,%%xmm10\n\t" \ + /*xmm2=_y[2]=u \ + xmm10=s=(25080*u>>16)-t2''*/ \ + "movdqa %%xmm10,%%xmm2\n\t" \ + "pmulhw %%xmm13,%%xmm10\n\t" \ + "psubw %%xmm12,%%xmm10\n\t" \ + /*xmm1:xmm6=s*21600+0x2800*/ \ + "pxor %%xmm12,%%xmm12\n\t" \ + "psubw %%xmm14,%%xmm12\n\t" \ + "mov $0x28005460,%[a]\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "movdqa %%xmm10,%%xmm6\n\t" \ + "movdqa %%xmm10,%%xmm1\n\t" \ + "punpcklwd %%xmm12,%%xmm6\n\t" \ + "pmaddwd %%xmm13,%%xmm6\n\t" \ + "mov $0x0E3D,%[a]\n\t" \ + "punpckhwd %%xmm12,%%xmm1\n\t" \ + "pmaddwd %%xmm13,%%xmm1\n\t" \ + /*xmm6=(s*21600+0x2800>>18)+s*/ \ + "psrad $18,%%xmm6\n\t" \ + "psrad $18,%%xmm1\n\t" \ + "movd %[a],%%xmm12\n\t" \ + "packssdw %%xmm1,%%xmm6\n\t" \ + "pshufd $00,%%xmm12,%%xmm12\n\t" \ + "paddw %%xmm10,%%xmm6\n\t" \ + /*xmm6=_y[6]=v=(s*21600+0x2800>>18)+s+(s!=0)*/ \ + "mov $0x7FFF54DC,%[a]\n\t" \ + "pcmpeqw %%xmm15,%%xmm10\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "psubw %%xmm14,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "paddw %%xmm10,%%xmm6\n\t " \ + /*xmm1,xmm3,xmm10,xmm11 are free.*/ \ + /*xmm11:xmm10=54491*t5'''+0x0E3D*/ \ + "movdqa %%xmm5,%%xmm10\n\t" \ + "movdqa %%xmm5,%%xmm11\n\t" \ + "punpcklwd %%xmm5,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + "mov $0x8E3A8E3A,%[a]\n\t" \ + "punpckhwd %%xmm5,%%xmm11\n\t" \ + "pmaddwd %%xmm13,%%xmm11\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm11\n\t" \ + /*xmm7:xmm12=36410*t6''' \ + xmm1=t6'''*/ \ + "movdqa %%xmm7,%%xmm3\n\t" \ + "movdqa %%xmm7,%%xmm1\n\t" \ + "pmulhw %%xmm13,%%xmm3\n\t" \ + "pmullw %%xmm13,%%xmm7\n\t" \ + "paddw %%xmm1,%%xmm3\n\t" \ + "movdqa %%xmm7,%%xmm12\n\t" \ + "punpckhwd %%xmm3,%%xmm7\n\t" \ + "punpcklwd %%xmm3,%%xmm12\n\t" \ + /*xmm10=u=(54491*t5'''+36410*t6'''+0x0E3D>>16)+(t5'''!=0)*/ \ + "paddd %%xmm12,%%xmm10\n\t" \ + "paddd %%xmm7,%%xmm11\n\t" \ + "psrad $16,%%xmm10\n\t" \ + "pcmpeqw %%xmm15,%%xmm5\n\t" \ + "psrad $16,%%xmm11\n\t" \ + "psubw %%xmm14,%%xmm5\n\t" \ + "packssdw %%xmm11,%%xmm10\n\t" \ + "pxor %%xmm12,%%xmm12\n\t" \ + "paddw %%xmm5,%%xmm10\n\t" \ + /*xmm5=_y[5]=u \ + xmm1=s=t6'''-(36410*u>>16)*/ \ + "psubw %%xmm14,%%xmm12\n\t" \ + "movdqa %%xmm10,%%xmm5\n\t" \ + "mov $0x340067C8,%[a]\n\t" \ + "pmulhw %%xmm13,%%xmm10\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddw %%xmm5,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "psubw %%xmm10,%%xmm1\n\t" \ + /*xmm11:xmm3=s*26568+0x3400*/ \ + "movdqa %%xmm1,%%xmm3\n\t" \ + "movdqa %%xmm1,%%xmm11\n\t" \ + "punpcklwd %%xmm12,%%xmm3\n\t" \ + "pmaddwd %%xmm13,%%xmm3\n\t" \ + "mov $0x7B1B,%[a]\n\t" \ + "punpckhwd %%xmm12,%%xmm11\n\t" \ + "pmaddwd %%xmm13,%%xmm11\n\t" \ + /*xmm3=(s*26568+0x3400>>17)+s*/ \ + "psrad $17,%%xmm3\n\t" \ + "psrad $17,%%xmm11\n\t" \ + "movd %[a],%%xmm12\n\t" \ + "packssdw %%xmm11,%%xmm3\n\t" \ + "pshufd $00,%%xmm12,%%xmm12\n\t" \ + "paddw %%xmm1,%%xmm3\n\t" \ + /*xmm3=_y[3]=v=(s*26568+0x3400>>17)+s+(s!=0)*/ \ + "mov $0x7FFF7B16,%[a]\n\t" \ + "pcmpeqw %%xmm15,%%xmm1\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "psubw %%xmm14,%%xmm1\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "paddw %%xmm1,%%xmm3\n\t " \ + /*xmm1,xmm7,xmm10,xmm11 are free.*/ \ + /*xmm11:xmm10=64277*t7''+0x7B1B*/ \ + "movdqa %%xmm9,%%xmm10\n\t" \ + "movdqa %%xmm9,%%xmm11\n\t" \ + "punpcklwd %%xmm9,%%xmm10\n\t" \ + "pmaddwd %%xmm13,%%xmm10\n\t" \ + "mov $0x31F131F1,%[a]\n\t" \ + "punpckhwd %%xmm9,%%xmm11\n\t" \ + "pmaddwd %%xmm13,%%xmm11\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + "paddd %%xmm12,%%xmm11\n\t" \ + /*xmm12:xmm7=12785*t4''*/ \ + "movdqa %%xmm8,%%xmm7\n\t" \ + "movdqa %%xmm8,%%xmm1\n\t" \ + "pmullw %%xmm13,%%xmm7\n\t" \ + "pmulhw %%xmm13,%%xmm1\n\t" \ + "movdqa %%xmm7,%%xmm12\n\t" \ + "punpcklwd %%xmm1,%%xmm7\n\t" \ + "punpckhwd %%xmm1,%%xmm12\n\t" \ + /*xmm10=u=(12785*t4''+64277*t7''+0x7B1B>>16)+(t7''!=0)*/ \ + "paddd %%xmm7,%%xmm10\n\t" \ + "paddd %%xmm12,%%xmm11\n\t" \ + "psrad $16,%%xmm10\n\t" \ + "pcmpeqw %%xmm15,%%xmm9\n\t" \ + "psrad $16,%%xmm11\n\t" \ + "psubw %%xmm14,%%xmm9\n\t" \ + "packssdw %%xmm11,%%xmm10\n\t" \ + "pxor %%xmm12,%%xmm12\n\t" \ + "paddw %%xmm9,%%xmm10\n\t" \ + /*xmm1=_y[1]=u \ + xmm10=s=(12785*u>>16)-t4''*/ \ + "psubw %%xmm14,%%xmm12\n\t" \ + "movdqa %%xmm10,%%xmm1\n\t" \ + "mov $0x3000503B,%[a]\n\t" \ + "pmulhw %%xmm13,%%xmm10\n\t" \ + "movd %[a],%%xmm13\n\t" \ + "psubw %%xmm8,%%xmm10\n\t" \ + "pshufd $00,%%xmm13,%%xmm13\n\t" \ + /*xmm8:xmm7=s*20539+0x3000*/ \ + "movdqa %%xmm10,%%xmm7\n\t" \ + "movdqa %%xmm10,%%xmm8\n\t" \ + "punpcklwd %%xmm12,%%xmm7\n\t" \ + "pmaddwd %%xmm13,%%xmm7\n\t" \ + "punpckhwd %%xmm12,%%xmm8\n\t" \ + "pmaddwd %%xmm13,%%xmm8\n\t" \ + /*xmm7=(s*20539+0x3000>>20)+s*/ \ + "psrad $20,%%xmm7\n\t" \ + "psrad $20,%%xmm8\n\t" \ + "packssdw %%xmm8,%%xmm7\n\t" \ + "paddw %%xmm10,%%xmm7\n\t" \ + /*xmm7=_y[7]=v=(s*20539+0x3000>>20)+s+(s!=0)*/ \ + "pcmpeqw %%xmm15,%%xmm10\n\t" \ + "psubw %%xmm14,%%xmm10\n\t" \ + "paddw %%xmm10,%%xmm7\n\t " \ + +# define OC_TRANSPOSE8x8 \ + "#OC_TRANSPOSE8x8\n\t" \ + "movdqa %%xmm4,%%xmm8\n\t" \ + /*xmm4 = f3 e3 f2 e2 f1 e1 f0 e0*/ \ + "punpcklwd %%xmm5,%%xmm4\n\t" \ + /*xmm8 = f7 e7 f6 e6 f5 e5 f4 e4*/ \ + "punpckhwd %%xmm5,%%xmm8\n\t" \ + /*xmm5 is free.*/ \ + "movdqa %%xmm0,%%xmm5\n\t" \ + /*xmm0 = b3 a3 b2 a2 b1 a1 b0 a0*/ \ + "punpcklwd %%xmm1,%%xmm0\n\t" \ + /*xmm5 = b7 a7 b6 a6 b5 a5 b4 a4*/ \ + "punpckhwd %%xmm1,%%xmm5\n\t" \ + /*xmm1 is free.*/ \ + "movdqa %%xmm6,%%xmm1\n\t" \ + /*xmm6 = h3 g3 h2 g2 h1 g1 h0 g0*/ \ + "punpcklwd %%xmm7,%%xmm6\n\t" \ + /*xmm1 = h7 g7 h6 g6 h5 g5 h4 g4*/ \ + "punpckhwd %%xmm7,%%xmm1\n\t" \ + /*xmm7 is free.*/ \ + "movdqa %%xmm2,%%xmm7\n\t" \ + /*xmm7 = d3 c3 d2 c2 d1 c1 d0 c0*/ \ + "punpcklwd %%xmm3,%%xmm7\n\t" \ + /*xmm2 = d7 c7 d6 c6 d5 c5 d4 c4*/ \ + "punpckhwd %%xmm3,%%xmm2\n\t" \ + /*xmm3 is free.*/ \ + "movdqa %%xmm0,%%xmm3\n\t" \ + /*xmm0 = d1 c1 b1 a1 d0 c0 b0 a0*/ \ + "punpckldq %%xmm7,%%xmm0\n\t" \ + /*xmm3 = d3 c3 b3 a3 d2 c2 b2 a2*/ \ + "punpckhdq %%xmm7,%%xmm3\n\t" \ + /*xmm7 is free.*/ \ + "movdqa %%xmm5,%%xmm7\n\t" \ + /*xmm5 = d5 c5 b5 a5 d4 c4 b4 a4*/ \ + "punpckldq %%xmm2,%%xmm5\n\t" \ + /*xmm7 = d7 c7 b7 a7 d6 c6 b6 a6*/ \ + "punpckhdq %%xmm2,%%xmm7\n\t" \ + /*xmm2 is free.*/ \ + "movdqa %%xmm4,%%xmm2\n\t" \ + /*xmm2 = h1 g1 f1 e1 h0 g0 f0 e0*/ \ + "punpckldq %%xmm6,%%xmm2\n\t" \ + /*xmm4 = h3 g3 f3 e3 h2 g2 f2 e2*/ \ + "punpckhdq %%xmm6,%%xmm4\n\t" \ + /*xmm6 is free.*/ \ + "movdqa %%xmm8,%%xmm6\n\t" \ + /*xmm6 = h5 g5 f5 e5 h4 g4 f4 e4*/ \ + "punpckldq %%xmm1,%%xmm6\n\t" \ + /*xmm8 = h7 g7 f7 e7 h6 g6 f6 e6*/ \ + "punpckhdq %%xmm1,%%xmm8\n\t" \ + /*xmm1 is free.*/ \ + "movdqa %%xmm0,%%xmm1\n\t" \ + /*xmm0 = h0 g0 f0 e0 d0 c0 b0 a0*/ \ + "punpcklqdq %%xmm2,%%xmm0\n\t" \ + /*xmm1 = h1 g1 f1 e1 d1 c1 b1 a1*/ \ + "punpckhqdq %%xmm2,%%xmm1\n\t" \ + /*xmm2 is free.*/ \ + "movdqa %%xmm3,%%xmm2\n\t" \ + /*xmm2 = h2 g2 f2 e2 d2 c2 b2 a2*/ \ + "punpcklqdq %%xmm4,%%xmm2\n\t" \ + /*xmm3 = h3 g3 f3 e3 d3 c3 b3 a3*/ \ + "punpckhqdq %%xmm4,%%xmm3\n\t" \ + /*xmm4 is free.*/ \ + "movdqa %%xmm5,%%xmm4\n\t" \ + /*xmm4 = h4 g4 f4 e4 d4 c4 b4 a4*/ \ + "punpcklqdq %%xmm6,%%xmm4\n\t" \ + /*xmm5 = h5 g5 f5 e5 d5 c5 b5 a5*/ \ + "punpckhqdq %%xmm6,%%xmm5\n\t" \ + /*xmm6 is free.*/ \ + "movdqa %%xmm7,%%xmm6\n\t" \ + /*xmm6 = h6 g6 f6 e6 d6 c6 b6 a6*/ \ + "punpcklqdq %%xmm8,%%xmm6\n\t" \ + /*xmm7 = h7 g7 f7 e7 d7 c7 b7 a7*/ \ + "punpckhqdq %%xmm8,%%xmm7\n\t" \ + /*xmm8 is free.*/ \ + +/*SSE2 implementation of the fDCT for x86-64 only. + Because of the 8 extra XMM registers on x86-64, this version can operate + without any temporary stack access at all.*/ +void oc_enc_fdct8x8_x86_64sse2(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + ptrdiff_t a; + __asm__ __volatile__( + /*Load the input.*/ + "movdqa 0x00(%[x]),%%xmm0\n\t" + "movdqa 0x10(%[x]),%%xmm1\n\t" + "movdqa 0x20(%[x]),%%xmm2\n\t" + "movdqa 0x30(%[x]),%%xmm3\n\t" + "movdqa 0x40(%[x]),%%xmm4\n\t" + "movdqa 0x50(%[x]),%%xmm5\n\t" + "movdqa 0x60(%[x]),%%xmm6\n\t" + "movdqa 0x70(%[x]),%%xmm7\n\t" + /*Add two extra bits of working precision to improve accuracy; any more and + we could overflow.*/ + /*We also add a few biases to correct for some systematic error that + remains in the full fDCT->iDCT round trip.*/ + /*xmm15={0}x8*/ + "pxor %%xmm15,%%xmm15\n\t" + /*xmm14={-1}x8*/ + "pcmpeqb %%xmm14,%%xmm14\n\t" + "psllw $2,%%xmm0\n\t" + /*xmm8=xmm0*/ + "movdqa %%xmm0,%%xmm8\n\t" + "psllw $2,%%xmm1\n\t" + /*xmm8={_x[7...0]==0}*/ + "pcmpeqw %%xmm15,%%xmm8\n\t" + "psllw $2,%%xmm2\n\t" + /*xmm8={_x[7...0]!=0}*/ + "psubw %%xmm14,%%xmm8\n\t" + "psllw $2,%%xmm3\n\t" + /*%[a]=1*/ + "mov $1,%[a]\n\t" + /*xmm8={_x[6]!=0,0,_x[4]!=0,0,_x[2]!=0,0,_x[0]!=0,0}*/ + "pslld $16,%%xmm8\n\t" + "psllw $2,%%xmm4\n\t" + /*xmm9={0,0,0,0,0,0,0,1}*/ + "movd %[a],%%xmm9\n\t" + /*xmm8={0,0,_x[2]!=0,0,_x[0]!=0,0}*/ + "pshufhw $0x00,%%xmm8,%%xmm8\n\t" + "psllw $2,%%xmm5\n\t" + /*%[a]={1}x2*/ + "mov $0x10001,%[a]\n\t" + /*xmm8={0,0,0,0,0,0,0,_x[0]!=0}*/ + "pshuflw $0x01,%%xmm8,%%xmm8\n\t" + "psllw $2,%%xmm6\n\t" + /*xmm10={0,0,0,0,0,0,1,1}*/ + "movd %[a],%%xmm10\n\t" + /*xmm0=_x[7...0]+{0,0,0,0,0,0,0,_x[0]!=0}*/ + "paddw %%xmm8,%%xmm0\n\t" + "psllw $2,%%xmm7\n\t" + /*xmm0=_x[7...0]+{0,0,0,0,0,0,1,(_x[0]!=0)+1}*/ + "paddw %%xmm10,%%xmm0\n\t" + /*xmm1=_x[15...8]-{0,0,0,0,0,0,0,1}*/ + "psubw %%xmm9,%%xmm1\n\t" + /*Transform columns.*/ + OC_FDCT8x8 + /*Transform rows.*/ + OC_TRANSPOSE8x8 + OC_FDCT8x8 + /*TODO: zig-zag ordering?*/ + OC_TRANSPOSE8x8 + /*xmm14={-2,-2,-2,-2,-2,-2,-2,-2}*/ + "paddw %%xmm14,%%xmm14\n\t" + "psubw %%xmm14,%%xmm0\n\t" + "psubw %%xmm14,%%xmm1\n\t" + "psraw $2,%%xmm0\n\t" + "psubw %%xmm14,%%xmm2\n\t" + "psraw $2,%%xmm1\n\t" + "psubw %%xmm14,%%xmm3\n\t" + "psraw $2,%%xmm2\n\t" + "psubw %%xmm14,%%xmm4\n\t" + "psraw $2,%%xmm3\n\t" + "psubw %%xmm14,%%xmm5\n\t" + "psraw $2,%%xmm4\n\t" + "psubw %%xmm14,%%xmm6\n\t" + "psraw $2,%%xmm5\n\t" + "psubw %%xmm14,%%xmm7\n\t" + "psraw $2,%%xmm6\n\t" + "psraw $2,%%xmm7\n\t" + /*Store the result.*/ + "movdqa %%xmm0,0x00(%[y])\n\t" + "movdqa %%xmm1,0x10(%[y])\n\t" + "movdqa %%xmm2,0x20(%[y])\n\t" + "movdqa %%xmm3,0x30(%[y])\n\t" + "movdqa %%xmm4,0x40(%[y])\n\t" + "movdqa %%xmm5,0x50(%[y])\n\t" + "movdqa %%xmm6,0x60(%[y])\n\t" + "movdqa %%xmm7,0x70(%[y])\n\t" + :[a]"=&r"(a) + :[y]"r"(_y),[x]"r"(_x) + :"memory" + ); +} +#endif diff --git a/libs/libtheora-1.1/lib/x86/x86enc.c b/libs/libtheora-1.1/lib/x86/x86enc.c new file mode 100644 index 00000000..43b7be3e --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/x86enc.c @@ -0,0 +1,49 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86state.c 15675 2009-02-06 09:43:27Z tterribe $ + + ********************************************************************/ +#include "x86enc.h" + +#if defined(OC_X86_ASM) + +#include "../cpu.c" + +void oc_enc_vtable_init_x86(oc_enc_ctx *_enc){ + ogg_uint32_t cpu_flags; + cpu_flags=oc_cpu_flags_get(); + oc_enc_vtable_init_c(_enc); + if(cpu_flags&OC_CPU_X86_MMX){ + _enc->opt_vtable.frag_sub=oc_enc_frag_sub_mmx; + _enc->opt_vtable.frag_sub_128=oc_enc_frag_sub_128_mmx; + _enc->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx; + _enc->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx; + _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_mmx; + } + if(cpu_flags&OC_CPU_X86_MMXEXT){ + _enc->opt_vtable.frag_sad=oc_enc_frag_sad_mmxext; + _enc->opt_vtable.frag_sad_thresh=oc_enc_frag_sad_thresh_mmxext; + _enc->opt_vtable.frag_sad2_thresh=oc_enc_frag_sad2_thresh_mmxext; + _enc->opt_vtable.frag_satd_thresh=oc_enc_frag_satd_thresh_mmxext; + _enc->opt_vtable.frag_satd2_thresh=oc_enc_frag_satd2_thresh_mmxext; + _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_mmxext; + _enc->opt_vtable.frag_copy2=oc_enc_frag_copy2_mmxext; + } + if(cpu_flags&OC_CPU_X86_SSE2){ +# if defined(OC_X86_64_ASM) + /*_enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_x86_64sse2;*/ +# endif + } +} +#endif diff --git a/libs/libtheora-1.1/lib/x86/x86enc.h b/libs/libtheora-1.1/lib/x86/x86enc.h new file mode 100644 index 00000000..06c3908b --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/x86enc.h @@ -0,0 +1,47 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86int.h 15675 2009-02-06 09:43:27Z tterribe $ + + ********************************************************************/ + +#if !defined(_x86_x86enc_H) +# define _x86_x86enc_H (1) +# include "../encint.h" +# include "x86int.h" + +void oc_enc_vtable_init_x86(oc_enc_ctx *_enc); + +unsigned oc_enc_frag_sad_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride); +unsigned oc_enc_frag_sad_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_sad2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_satd_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_satd2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_intra_satd_mmxext(const unsigned char *_src,int _ystride); +void oc_enc_frag_sub_mmx(ogg_int16_t _diff[64], + const unsigned char *_x,const unsigned char *_y,int _stride); +void oc_enc_frag_sub_128_mmx(ogg_int16_t _diff[64], + const unsigned char *_x,int _stride); +void oc_enc_frag_copy2_mmxext(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride); +void oc_enc_fdct8x8_mmx(ogg_int16_t _y[64],const ogg_int16_t _x[64]); +void oc_enc_fdct8x8_x86_64sse2(ogg_int16_t _y[64],const ogg_int16_t _x[64]); + +#endif diff --git a/libs/libtheora-1.1/lib/x86/x86int.h b/libs/libtheora-1.1/lib/x86/x86int.h new file mode 100644 index 00000000..5ca30ac7 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/x86int.h @@ -0,0 +1,42 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86int.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_x86_x86int_H) +# define _x86_x86int_H (1) +# include "../internal.h" + +void oc_state_vtable_init_x86(oc_theora_state *_state); + +void oc_frag_copy_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride); +void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride, + const ogg_int16_t *_residue); +void oc_frag_recon_inter_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t *_residue); +void oc_frag_recon_inter2_mmx(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t *_residue); +void oc_idct8x8_mmx(ogg_int16_t _y[64],int _last_zzi); +void oc_state_frag_recon_mmx(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant); +void oc_state_frag_copy_list_mmx(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli); +void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); +void oc_restore_fpu_mmx(void); + +#endif diff --git a/libs/libtheora-1.1/lib/x86/x86state.c b/libs/libtheora-1.1/lib/x86/x86state.c new file mode 100644 index 00000000..8450b644 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86/x86state.c @@ -0,0 +1,62 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86state.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include "x86int.h" + +#if defined(OC_X86_ASM) + +#include "../cpu.c" + +/*This table has been modified from OC_FZIG_ZAG by baking a 4x4 transpose into + each quadrant of the destination.*/ +static const unsigned char OC_FZIG_ZAG_MMX[128]={ + 0, 8, 1, 2, 9,16,24,17, + 10, 3,32,11,18,25, 4,12, + 5,26,19,40,33,34,41,48, + 27, 6,13,20,28,21,14, 7, + 56,49,42,35,43,50,57,36, + 15,22,29,30,23,44,37,58, + 51,59,38,45,52,31,60,53, + 46,39,47,54,61,62,55,63, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, +}; + +void oc_state_vtable_init_x86(oc_theora_state *_state){ + _state->cpu_flags=oc_cpu_flags_get(); + if(_state->cpu_flags&OC_CPU_X86_MMX){ + _state->opt_vtable.frag_copy=oc_frag_copy_mmx; + _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx; + _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx; + _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx; + _state->opt_vtable.idct8x8=oc_idct8x8_mmx; + _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx; + _state->opt_vtable.state_frag_copy_list=oc_state_frag_copy_list_mmx; + _state->opt_vtable.state_loop_filter_frag_rows= + oc_state_loop_filter_frag_rows_mmx; + _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx; + _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_MMX; + } + else oc_state_vtable_init_c(_state); +} +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxencfrag.c b/libs/libtheora-1.1/lib/x86_vc/mmxencfrag.c new file mode 100644 index 00000000..ac9dacf3 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxencfrag.c @@ -0,0 +1,969 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: dsp_mmx.c 14579 2008-03-12 06:42:40Z xiphmont $ + + ********************************************************************/ +#include +#include "x86enc.h" + +#if defined(OC_X86_ASM) + +unsigned oc_enc_frag_sad_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride){ + ptrdiff_t ret; + __asm{ +#define SRC esi +#define REF edx +#define YSTRIDE ecx +#define YSTRIDE3 edi + mov YSTRIDE,_ystride + mov SRC,_src + mov REF,_ref + /*Load the first 4 rows of each block.*/ + movq mm0,[SRC] + movq mm1,[REF] + movq mm2,[SRC][YSTRIDE] + movq mm3,[REF][YSTRIDE] + lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] + movq mm4,[SRC+YSTRIDE*2] + movq mm5,[REF+YSTRIDE*2] + movq mm6,[SRC+YSTRIDE3] + movq mm7,[REF+YSTRIDE3] + /*Compute their SADs and add them in mm0*/ + psadbw mm0,mm1 + psadbw mm2,mm3 + lea SRC,[SRC+YSTRIDE*4] + paddw mm0,mm2 + lea REF,[REF+YSTRIDE*4] + /*Load the next 3 rows as registers become available.*/ + movq mm2,[SRC] + movq mm3,[REF] + psadbw mm4,mm5 + psadbw mm6,mm7 + paddw mm0,mm4 + movq mm5,[REF+YSTRIDE] + movq mm4,[SRC+YSTRIDE] + paddw mm0,mm6 + movq mm7,[REF+YSTRIDE*2] + movq mm6,[SRC+YSTRIDE*2] + /*Start adding their SADs to mm0*/ + psadbw mm2,mm3 + psadbw mm4,mm5 + paddw mm0,mm2 + psadbw mm6,mm7 + /*Load last row as registers become available.*/ + movq mm2,[SRC+YSTRIDE3] + movq mm3,[REF+YSTRIDE3] + /*And finish adding up their SADs.*/ + paddw mm0,mm4 + psadbw mm2,mm3 + paddw mm0,mm6 + paddw mm0,mm2 + movd [ret],mm0 +#undef SRC +#undef REF +#undef YSTRIDE +#undef YSTRIDE3 + } + return (unsigned)ret; +} + +unsigned oc_enc_frag_sad_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + /*Early termination is for suckers.*/ + return oc_enc_frag_sad_mmxext(_src,_ref,_ystride); +} + +#define OC_SAD2_LOOP __asm{ \ + /*We want to compute (mm0+mm1>>1) on unsigned bytes without overflow, but \ + pavgb computes (mm0+mm1+1>>1). \ + The latter is exactly 1 too large when the low bit of two corresponding \ + bytes is only set in one of them. \ + Therefore we pxor the operands, pand to mask out the low bits, and psubb to \ + correct the output of pavgb.*/ \ + __asm movq mm6,mm0 \ + __asm lea REF1,[REF1+YSTRIDE*2] \ + __asm pxor mm0,mm1 \ + __asm pavgb mm6,mm1 \ + __asm lea REF2,[REF2+YSTRIDE*2] \ + __asm movq mm1,mm2 \ + __asm pand mm0,mm7 \ + __asm pavgb mm2,mm3 \ + __asm pxor mm1,mm3 \ + __asm movq mm3,[REF2+YSTRIDE] \ + __asm psubb mm6,mm0 \ + __asm movq mm0,[REF1] \ + __asm pand mm1,mm7 \ + __asm psadbw mm4,mm6 \ + __asm movd mm6,RET \ + __asm psubb mm2,mm1 \ + __asm movq mm1,[REF2] \ + __asm lea SRC,[SRC+YSTRIDE*2] \ + __asm psadbw mm5,mm2 \ + __asm movq mm2,[REF1+YSTRIDE] \ + __asm paddw mm5,mm4 \ + __asm movq mm4,[SRC] \ + __asm paddw mm6,mm5 \ + __asm movq mm5,[SRC+YSTRIDE] \ + __asm movd RET,mm6 \ +} + +/*Same as above, but does not pre-load the next two rows.*/ +#define OC_SAD2_TAIL __asm{ \ + __asm movq mm6,mm0 \ + __asm pavgb mm0,mm1 \ + __asm pxor mm6,mm1 \ + __asm movq mm1,mm2 \ + __asm pand mm6,mm7 \ + __asm pavgb mm2,mm3 \ + __asm pxor mm1,mm3 \ + __asm psubb mm0,mm6 \ + __asm pand mm1,mm7 \ + __asm psadbw mm4,mm0 \ + __asm psubb mm2,mm1 \ + __asm movd mm6,RET \ + __asm psadbw mm5,mm2 \ + __asm paddw mm5,mm4 \ + __asm paddw mm6,mm5 \ + __asm movd RET,mm6 \ +} + +unsigned oc_enc_frag_sad2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + ptrdiff_t ret; + __asm{ +#define REF1 ecx +#define REF2 edi +#define YSTRIDE esi +#define SRC edx +#define RET eax + mov YSTRIDE,_ystride + mov SRC,_src + mov REF1,_ref1 + mov REF2,_ref2 + movq mm0,[REF1] + movq mm1,[REF2] + movq mm2,[REF1+YSTRIDE] + movq mm3,[REF2+YSTRIDE] + xor RET,RET + movq mm4,[SRC] + pxor mm7,mm7 + pcmpeqb mm6,mm6 + movq mm5,[SRC+YSTRIDE] + psubb mm7,mm6 + OC_SAD2_LOOP + OC_SAD2_LOOP + OC_SAD2_LOOP + OC_SAD2_TAIL + mov [ret],RET +#undef REF1 +#undef REF2 +#undef YSTRIDE +#undef SRC +#undef RET + } + return (unsigned)ret; +} + +/*Load an 8x4 array of pixel values from %[src] and %[ref] and compute their + 16-bit difference in mm0...mm7.*/ +#define OC_LOAD_SUB_8x4(_off) __asm{ \ + __asm movd mm0,[_off+SRC] \ + __asm movd mm4,[_off+REF] \ + __asm movd mm1,[_off+SRC+SRC_YSTRIDE] \ + __asm lea SRC,[SRC+SRC_YSTRIDE*2] \ + __asm movd mm5,[_off+REF+REF_YSTRIDE] \ + __asm lea REF,[REF+REF_YSTRIDE*2] \ + __asm movd mm2,[_off+SRC] \ + __asm movd mm7,[_off+REF] \ + __asm movd mm3,[_off+SRC+SRC_YSTRIDE] \ + __asm movd mm6,[_off+REF+REF_YSTRIDE] \ + __asm punpcklbw mm0,mm4 \ + __asm lea SRC,[SRC+SRC_YSTRIDE*2] \ + __asm punpcklbw mm4,mm4 \ + __asm lea REF,[REF+REF_YSTRIDE*2] \ + __asm psubw mm0,mm4 \ + __asm movd mm4,[_off+SRC] \ + __asm movq [_off*2+BUF],mm0 \ + __asm movd mm0,[_off+REF] \ + __asm punpcklbw mm1,mm5 \ + __asm punpcklbw mm5,mm5 \ + __asm psubw mm1,mm5 \ + __asm movd mm5,[_off+SRC+SRC_YSTRIDE] \ + __asm punpcklbw mm2,mm7 \ + __asm punpcklbw mm7,mm7 \ + __asm psubw mm2,mm7 \ + __asm movd mm7,[_off+REF+REF_YSTRIDE] \ + __asm punpcklbw mm3,mm6 \ + __asm lea SRC,[SRC+SRC_YSTRIDE*2] \ + __asm punpcklbw mm6,mm6 \ + __asm psubw mm3,mm6 \ + __asm movd mm6,[_off+SRC] \ + __asm punpcklbw mm4,mm0 \ + __asm lea REF,[REF+REF_YSTRIDE*2] \ + __asm punpcklbw mm0,mm0 \ + __asm lea SRC,[SRC+SRC_YSTRIDE*2] \ + __asm psubw mm4,mm0 \ + __asm movd mm0,[_off+REF] \ + __asm punpcklbw mm5,mm7 \ + __asm neg SRC_YSTRIDE \ + __asm punpcklbw mm7,mm7 \ + __asm psubw mm5,mm7 \ + __asm movd mm7,[_off+SRC+SRC_YSTRIDE] \ + __asm punpcklbw mm6,mm0 \ + __asm lea REF,[REF+REF_YSTRIDE*2] \ + __asm punpcklbw mm0,mm0 \ + __asm neg REF_YSTRIDE \ + __asm psubw mm6,mm0 \ + __asm movd mm0,[_off+REF+REF_YSTRIDE] \ + __asm lea SRC,[SRC+SRC_YSTRIDE*8] \ + __asm punpcklbw mm7,mm0 \ + __asm neg SRC_YSTRIDE \ + __asm punpcklbw mm0,mm0 \ + __asm lea REF,[REF+REF_YSTRIDE*8] \ + __asm psubw mm7,mm0 \ + __asm neg REF_YSTRIDE \ + __asm movq mm0,[_off*2+BUF] \ +} + +/*Load an 8x4 array of pixel values from %[src] into %%mm0...%%mm7.*/ +#define OC_LOAD_8x4(_off) __asm{ \ + __asm movd mm0,[_off+SRC] \ + __asm movd mm1,[_off+SRC+YSTRIDE] \ + __asm movd mm2,[_off+SRC+YSTRIDE*2] \ + __asm pxor mm7,mm7 \ + __asm movd mm3,[_off+SRC+YSTRIDE3] \ + __asm punpcklbw mm0,mm7 \ + __asm movd mm4,[_off+SRC4] \ + __asm punpcklbw mm1,mm7 \ + __asm movd mm5,[_off+SRC4+YSTRIDE] \ + __asm punpcklbw mm2,mm7 \ + __asm movd mm6,[_off+SRC4+YSTRIDE*2] \ + __asm punpcklbw mm3,mm7 \ + __asm movd mm7,[_off+SRC4+YSTRIDE3] \ + __asm punpcklbw mm4,mm4 \ + __asm punpcklbw mm5,mm5 \ + __asm psrlw mm4,8 \ + __asm psrlw mm5,8 \ + __asm punpcklbw mm6,mm6 \ + __asm punpcklbw mm7,mm7 \ + __asm psrlw mm6,8 \ + __asm psrlw mm7,8 \ +} + +/*Performs the first two stages of an 8-point 1-D Hadamard transform. + The transform is performed in place, except that outputs 0-3 are swapped with + outputs 4-7. + Outputs 2, 3, 6 and 7 from the second stage are negated (which allows us to + perform this stage in place with no temporary registers).*/ +#define OC_HADAMARD_AB_8x4 __asm{ \ + /*Stage A: \ + Outputs 0-3 are swapped with 4-7 here.*/ \ + __asm paddw mm5,mm1 \ + __asm paddw mm6,mm2 \ + __asm paddw mm1,mm1 \ + __asm paddw mm2,mm2 \ + __asm psubw mm1,mm5 \ + __asm psubw mm2,mm6 \ + __asm paddw mm7,mm3 \ + __asm paddw mm4,mm0 \ + __asm paddw mm3,mm3 \ + __asm paddw mm0,mm0 \ + __asm psubw mm3,mm7 \ + __asm psubw mm0,mm4 \ + /*Stage B:*/ \ + __asm paddw mm0,mm2 \ + __asm paddw mm1,mm3 \ + __asm paddw mm4,mm6 \ + __asm paddw mm5,mm7 \ + __asm paddw mm2,mm2 \ + __asm paddw mm3,mm3 \ + __asm paddw mm6,mm6 \ + __asm paddw mm7,mm7 \ + __asm psubw mm2,mm0 \ + __asm psubw mm3,mm1 \ + __asm psubw mm6,mm4 \ + __asm psubw mm7,mm5 \ +} + +/*Performs the last stage of an 8-point 1-D Hadamard transform in place. + Ouputs 1, 3, 5, and 7 are negated (which allows us to perform this stage in + place with no temporary registers).*/ +#define OC_HADAMARD_C_8x4 __asm{ \ + /*Stage C:*/ \ + __asm paddw mm0,mm1 \ + __asm paddw mm2,mm3 \ + __asm paddw mm4,mm5 \ + __asm paddw mm6,mm7 \ + __asm paddw mm1,mm1 \ + __asm paddw mm3,mm3 \ + __asm paddw mm5,mm5 \ + __asm paddw mm7,mm7 \ + __asm psubw mm1,mm0 \ + __asm psubw mm3,mm2 \ + __asm psubw mm5,mm4 \ + __asm psubw mm7,mm6 \ +} + +/*Performs an 8-point 1-D Hadamard transform. + The transform is performed in place, except that outputs 0-3 are swapped with + outputs 4-7. + Outputs 1, 2, 5 and 6 are negated (which allows us to perform the transform + in place with no temporary registers).*/ +#define OC_HADAMARD_8x4 __asm{ \ + OC_HADAMARD_AB_8x4 \ + OC_HADAMARD_C_8x4 \ +} + +/*Performs the first part of the final stage of the Hadamard transform and + summing of absolute values. + At the end of this part, mm1 will contain the DC coefficient of the + transform.*/ +#define OC_HADAMARD_C_ABS_ACCUM_A_8x4(_r6,_r7) __asm{ \ + /*We use the fact that \ + (abs(a+b)+abs(a-b))/2=max(abs(a),abs(b)) \ + to merge the final butterfly with the abs and the first stage of \ + accumulation. \ + Thus we can avoid using pabsw, which is not available until SSSE3. \ + Emulating pabsw takes 3 instructions, so the straightforward MMXEXT \ + implementation would be (3+3)*8+7=55 instructions (+4 for spilling \ + registers). \ + Even with pabsw, it would be (3+1)*8+7=39 instructions (with no spills). \ + This implementation is only 26 (+4 for spilling registers).*/ \ + __asm movq [_r7+BUF],mm7 \ + __asm movq [_r6+BUF],mm6 \ + /*mm7={0x7FFF}x4 \ + mm0=max(abs(mm0),abs(mm1))-0x7FFF*/ \ + __asm pcmpeqb mm7,mm7 \ + __asm movq mm6,mm0 \ + __asm psrlw mm7,1 \ + __asm paddw mm6,mm1 \ + __asm pmaxsw mm0,mm1 \ + __asm paddsw mm6,mm7 \ + __asm psubw mm0,mm6 \ + /*mm2=max(abs(mm2),abs(mm3))-0x7FFF \ + mm4=max(abs(mm4),abs(mm5))-0x7FFF*/ \ + __asm movq mm6,mm2 \ + __asm movq mm1,mm4 \ + __asm pmaxsw mm2,mm3 \ + __asm pmaxsw mm4,mm5 \ + __asm paddw mm6,mm3 \ + __asm paddw mm1,mm5 \ + __asm movq mm3,[_r7+BUF] \ +} + +/*Performs the second part of the final stage of the Hadamard transform and + summing of absolute values.*/ +#define OC_HADAMARD_C_ABS_ACCUM_B_8x4(_r6,_r7) __asm{ \ + __asm paddsw mm6,mm7 \ + __asm movq mm5,[_r6+BUF] \ + __asm paddsw mm1,mm7 \ + __asm psubw mm2,mm6 \ + __asm psubw mm4,mm1 \ + /*mm7={1}x4 (needed for the horizontal add that follows) \ + mm0+=mm2+mm4+max(abs(mm3),abs(mm5))-0x7FFF*/ \ + __asm movq mm6,mm3 \ + __asm pmaxsw mm3,mm5 \ + __asm paddw mm0,mm2 \ + __asm paddw mm6,mm5 \ + __asm paddw mm0,mm4 \ + __asm paddsw mm6,mm7 \ + __asm paddw mm0,mm3 \ + __asm psrlw mm7,14 \ + __asm psubw mm0,mm6 \ +} + +/*Performs the last stage of an 8-point 1-D Hadamard transform, takes the + absolute value of each component, and accumulates everything into mm0. + This is the only portion of SATD which requires MMXEXT (we could use plain + MMX, but it takes 4 instructions and an extra register to work around the + lack of a pmaxsw, which is a pretty serious penalty).*/ +#define OC_HADAMARD_C_ABS_ACCUM_8x4(_r6,_r7) __asm{ \ + OC_HADAMARD_C_ABS_ACCUM_A_8x4(_r6,_r7) \ + OC_HADAMARD_C_ABS_ACCUM_B_8x4(_r6,_r7) \ +} + +/*Performs an 8-point 1-D Hadamard transform, takes the absolute value of each + component, and accumulates everything into mm0. + Note that mm0 will have an extra 4 added to each column, and that after + removing this value, the remainder will be half the conventional value.*/ +#define OC_HADAMARD_ABS_ACCUM_8x4(_r6,_r7) __asm{ \ + OC_HADAMARD_AB_8x4 \ + OC_HADAMARD_C_ABS_ACCUM_8x4(_r6,_r7) \ +} + +/*Performs two 4x4 transposes (mostly) in place. + On input, {mm0,mm1,mm2,mm3} contains rows {e,f,g,h}, and {mm4,mm5,mm6,mm7} + contains rows {a,b,c,d}. + On output, {0x40,0x50,0x60,0x70}+_off+BUF contains {e,f,g,h}^T, and + {mm4,mm5,mm6,mm7} contains the transposed rows {a,b,c,d}^T.*/ +#define OC_TRANSPOSE_4x4x2(_off) __asm{ \ + /*First 4x4 transpose:*/ \ + __asm movq [0x10+_off+BUF],mm5 \ + /*mm0 = e3 e2 e1 e0 \ + mm1 = f3 f2 f1 f0 \ + mm2 = g3 g2 g1 g0 \ + mm3 = h3 h2 h1 h0*/ \ + __asm movq mm5,mm2 \ + __asm punpcklwd mm2,mm3 \ + __asm punpckhwd mm5,mm3 \ + __asm movq mm3,mm0 \ + __asm punpcklwd mm0,mm1 \ + __asm punpckhwd mm3,mm1 \ + /*mm0 = f1 e1 f0 e0 \ + mm3 = f3 e3 f2 e2 \ + mm2 = h1 g1 h0 g0 \ + mm5 = h3 g3 h2 g2*/ \ + __asm movq mm1,mm0 \ + __asm punpckldq mm0,mm2 \ + __asm punpckhdq mm1,mm2 \ + __asm movq mm2,mm3 \ + __asm punpckhdq mm3,mm5 \ + __asm movq [0x40+_off+BUF],mm0 \ + __asm punpckldq mm2,mm5 \ + /*mm0 = h0 g0 f0 e0 \ + mm1 = h1 g1 f1 e1 \ + mm2 = h2 g2 f2 e2 \ + mm3 = h3 g3 f3 e3*/ \ + __asm movq mm5,[0x10+_off+BUF] \ + /*Second 4x4 transpose:*/ \ + /*mm4 = a3 a2 a1 a0 \ + mm5 = b3 b2 b1 b0 \ + mm6 = c3 c2 c1 c0 \ + mm7 = d3 d2 d1 d0*/ \ + __asm movq mm0,mm6 \ + __asm punpcklwd mm6,mm7 \ + __asm movq [0x50+_off+BUF],mm1 \ + __asm punpckhwd mm0,mm7 \ + __asm movq mm7,mm4 \ + __asm punpcklwd mm4,mm5 \ + __asm movq [0x60+_off+BUF],mm2 \ + __asm punpckhwd mm7,mm5 \ + /*mm4 = b1 a1 b0 a0 \ + mm7 = b3 a3 b2 a2 \ + mm6 = d1 c1 d0 c0 \ + mm0 = d3 c3 d2 c2*/ \ + __asm movq mm5,mm4 \ + __asm punpckldq mm4,mm6 \ + __asm movq [0x70+_off+BUF],mm3 \ + __asm punpckhdq mm5,mm6 \ + __asm movq mm6,mm7 \ + __asm punpckhdq mm7,mm0 \ + __asm punpckldq mm6,mm0 \ + /*mm4 = d0 c0 b0 a0 \ + mm5 = d1 c1 b1 a1 \ + mm6 = d2 c2 b2 a2 \ + mm7 = d3 c3 b3 a3*/ \ +} + +static unsigned oc_int_frag_satd_thresh_mmxext(const unsigned char *_src, + int _src_ystride,const unsigned char *_ref,int _ref_ystride,unsigned _thresh){ + OC_ALIGN8(ogg_int16_t buf[64]); + ogg_int16_t *bufp; + unsigned ret1; + unsigned ret2; + bufp=buf; + __asm{ +#define SRC esi +#define REF eax +#define SRC_YSTRIDE ecx +#define REF_YSTRIDE edx +#define BUF edi +#define RET eax +#define RET2 edx + mov SRC,_src + mov SRC_YSTRIDE,_src_ystride + mov REF,_ref + mov REF_YSTRIDE,_ref_ystride + mov BUF,bufp + OC_LOAD_SUB_8x4(0x00) + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2(0x00) + /*Finish swapping out this 8x4 block to make room for the next one. + mm0...mm3 have been swapped out already.*/ + movq [0x00+BUF],mm4 + movq [0x10+BUF],mm5 + movq [0x20+BUF],mm6 + movq [0x30+BUF],mm7 + OC_LOAD_SUB_8x4(0x04) + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2(0x08) + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, so + we only have to do half the loads.*/ + movq mm1,[0x10+BUF] + movq mm2,[0x20+BUF] + movq mm3,[0x30+BUF] + movq mm0,[0x00+BUF] + OC_HADAMARD_ABS_ACCUM_8x4(0x28,0x38) + /*Up to this point, everything fit in 16 bits (8 input + 1 for the + difference + 2*3 for the two 8-point 1-D Hadamards - 1 for the abs - 1 + for the factor of two we dropped + 3 for the vertical accumulation). + Now we finally have to promote things to dwords. + We break this part out of OC_HADAMARD_ABS_ACCUM_8x4 to hide the long + latency of pmaddwd by starting the next series of loads now.*/ + mov RET2,_thresh + pmaddwd mm0,mm7 + movq mm1,[0x50+BUF] + movq mm5,[0x58+BUF] + movq mm4,mm0 + movq mm2,[0x60+BUF] + punpckhdq mm0,mm0 + movq mm6,[0x68+BUF] + paddd mm4,mm0 + movq mm3,[0x70+BUF] + movd RET,mm4 + movq mm7,[0x78+BUF] + /*The sums produced by OC_HADAMARD_ABS_ACCUM_8x4 each have an extra 4 + added to them, and a factor of two removed; correct the final sum here.*/ + lea RET,[RET+RET-32] + movq mm0,[0x40+BUF] + cmp RET,RET2 + movq mm4,[0x48+BUF] + jae at_end + OC_HADAMARD_ABS_ACCUM_8x4(0x68,0x78) + pmaddwd mm0,mm7 + /*There isn't much to stick in here to hide the latency this time, but the + alternative to pmaddwd is movq->punpcklwd->punpckhwd->paddd, whose + latency is even worse.*/ + sub RET,32 + movq mm4,mm0 + punpckhdq mm0,mm0 + paddd mm4,mm0 + movd RET2,mm4 + lea RET,[RET+RET2*2] + align 16 +at_end: + mov ret1,RET +#undef SRC +#undef REF +#undef SRC_YSTRIDE +#undef REF_YSTRIDE +#undef BUF +#undef RET +#undef RET2 + } + return ret1; +} + +unsigned oc_enc_frag_satd_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh){ + return oc_int_frag_satd_thresh_mmxext(_src,_ystride,_ref,_ystride,_thresh); +} + + +/*Our internal implementation of frag_copy2 takes an extra stride parameter so + we can share code with oc_enc_frag_satd2_thresh_mmxext().*/ +static void oc_int_frag_copy2_mmxext(unsigned char *_dst,int _dst_ystride, + const unsigned char *_src1,const unsigned char *_src2,int _src_ystride){ + __asm{ + /*Load the first 3 rows.*/ +#define DST_YSTRIDE edi +#define SRC_YSTRIDE esi +#define DST eax +#define SRC1 edx +#define SRC2 ecx + mov DST_YSTRIDE,_dst_ystride + mov SRC_YSTRIDE,_src_ystride + mov DST,_dst + mov SRC1,_src1 + mov SRC2,_src2 + movq mm0,[SRC1] + movq mm1,[SRC2] + movq mm2,[SRC1+SRC_YSTRIDE] + lea SRC1,[SRC1+SRC_YSTRIDE*2] + movq mm3,[SRC2+SRC_YSTRIDE] + lea SRC2,[SRC2+SRC_YSTRIDE*2] + pxor mm7,mm7 + movq mm4,[SRC1] + pcmpeqb mm6,mm6 + movq mm5,[SRC2] + /*mm7={1}x8.*/ + psubb mm7,mm6 + /*Start averaging mm0 and mm1 into mm6.*/ + movq mm6,mm0 + pxor mm0,mm1 + pavgb mm6,mm1 + /*mm1 is free, start averaging mm3 into mm2 using mm1.*/ + movq mm1,mm2 + pand mm0,mm7 + pavgb mm2,mm3 + pxor mm1,mm3 + /*mm3 is free.*/ + psubb mm6,mm0 + /*mm0 is free, start loading the next row.*/ + movq mm0,[SRC1+SRC_YSTRIDE] + /*Start averaging mm5 and mm4 using mm3.*/ + movq mm3,mm4 + /*mm6 [row 0] is done; write it out.*/ + movq [DST],mm6 + pand mm1,mm7 + pavgb mm4,mm5 + psubb mm2,mm1 + /*mm1 is free, continue loading the next row.*/ + movq mm1,[SRC2+SRC_YSTRIDE] + pxor mm3,mm5 + lea SRC1,[SRC1+SRC_YSTRIDE*2] + /*mm2 [row 1] is done; write it out.*/ + movq [DST+DST_YSTRIDE],mm2 + pand mm3,mm7 + /*Start loading the next row.*/ + movq mm2,[SRC1] + lea DST,[DST+DST_YSTRIDE*2] + psubb mm4,mm3 + lea SRC2,[SRC2+SRC_YSTRIDE*2] + /*mm4 [row 2] is done; write it out.*/ + movq [DST],mm4 + /*Continue loading the next row.*/ + movq mm3,[SRC2] + /*Start averaging mm0 and mm1 into mm6.*/ + movq mm6,mm0 + pxor mm0,mm1 + /*Start loading the next row.*/ + movq mm4,[SRC1+SRC_YSTRIDE] + pavgb mm6,mm1 + /*mm1 is free; start averaging mm3 into mm2 using mm1.*/ + movq mm1,mm2 + pand mm0,mm7 + /*Continue loading the next row.*/ + movq mm5,[SRC2+SRC_YSTRIDE] + pavgb mm2,mm3 + lea SRC1,[SRC1+SRC_YSTRIDE*2] + pxor mm1,mm3 + /*mm3 is free.*/ + psubb mm6,mm0 + /*mm0 is free, start loading the next row.*/ + movq mm0,[SRC1] + /*Start averaging mm5 into mm4 using mm3.*/ + movq mm3,mm4 + /*mm6 [row 3] is done; write it out.*/ + movq [DST+DST_YSTRIDE],mm6 + pand mm1,mm7 + lea SRC2,[SRC2+SRC_YSTRIDE*2] + pavgb mm4,mm5 + lea DST,[DST+DST_YSTRIDE*2] + psubb mm2,mm1 + /*mm1 is free; continue loading the next row.*/ + movq mm1,[SRC2] + pxor mm3,mm5 + /*mm2 [row 4] is done; write it out.*/ + movq [DST],mm2 + pand mm3,mm7 + /*Start loading the next row.*/ + movq mm2,[SRC1+SRC_YSTRIDE] + psubb mm4,mm3 + /*Start averaging mm0 and mm1 into mm6.*/ + movq mm6,mm0 + /*Continue loading the next row.*/ + movq mm3,[SRC2+SRC_YSTRIDE] + /*mm4 [row 5] is done; write it out.*/ + movq [DST+DST_YSTRIDE],mm4 + pxor mm0,mm1 + pavgb mm6,mm1 + /*mm4 is free; start averaging mm3 into mm2 using mm4.*/ + movq mm4,mm2 + pand mm0,mm7 + pavgb mm2,mm3 + pxor mm4,mm3 + lea DST,[DST+DST_YSTRIDE*2] + psubb mm6,mm0 + pand mm4,mm7 + /*mm6 [row 6] is done, write it out.*/ + movq [DST],mm6 + psubb mm2,mm4 + /*mm2 [row 7] is done, write it out.*/ + movq [DST+DST_YSTRIDE],mm2 +#undef SRC1 +#undef SRC2 +#undef SRC_YSTRIDE +#undef DST_YSTRIDE +#undef DST + } +} + +unsigned oc_enc_frag_satd2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh){ + OC_ALIGN8(unsigned char ref[64]); + oc_int_frag_copy2_mmxext(ref,8,_ref1,_ref2,_ystride); + return oc_int_frag_satd_thresh_mmxext(_src,_ystride,ref,8,_thresh); +} + +unsigned oc_enc_frag_intra_satd_mmxext(const unsigned char *_src, + int _ystride){ + OC_ALIGN8(ogg_int16_t buf[64]); + ogg_int16_t *bufp; + unsigned ret1; + unsigned ret2; + bufp=buf; + __asm{ +#define SRC eax +#define SRC4 esi +#define BUF edi +#define RET eax +#define RET_WORD ax +#define RET2 ecx +#define YSTRIDE edx +#define YSTRIDE3 ecx + mov SRC,_src + mov BUF,bufp + mov YSTRIDE,_ystride + /* src4 = src+4*ystride */ + lea SRC4,[SRC+YSTRIDE*4] + /* ystride3 = 3*ystride */ + lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] + OC_LOAD_8x4(0x00) + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2(0x00) + /*Finish swapping out this 8x4 block to make room for the next one. + mm0...mm3 have been swapped out already.*/ + movq [0x00+BUF],mm4 + movq [0x10+BUF],mm5 + movq [0x20+BUF],mm6 + movq [0x30+BUF],mm7 + OC_LOAD_8x4(0x04) + OC_HADAMARD_8x4 + OC_TRANSPOSE_4x4x2(0x08) + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, so + we only have to do half the loads.*/ + movq mm1,[0x10+BUF] + movq mm2,[0x20+BUF] + movq mm3,[0x30+BUF] + movq mm0,[0x00+BUF] + /*We split out the stages here so we can save the DC coefficient in the + middle.*/ + OC_HADAMARD_AB_8x4 + OC_HADAMARD_C_ABS_ACCUM_A_8x4(0x28,0x38) + movd RET,mm1 + OC_HADAMARD_C_ABS_ACCUM_B_8x4(0x28,0x38) + /*Up to this point, everything fit in 16 bits (8 input + 1 for the + difference + 2*3 for the two 8-point 1-D Hadamards - 1 for the abs - 1 + for the factor of two we dropped + 3 for the vertical accumulation). + Now we finally have to promote things to dwords. + We break this part out of OC_HADAMARD_ABS_ACCUM_8x4 to hide the long + latency of pmaddwd by starting the next series of loads now.*/ + pmaddwd mm0,mm7 + movq mm1,[0x50+BUF] + movq mm5,[0x58+BUF] + movq mm2,[0x60+BUF] + movq mm4,mm0 + movq mm6,[0x68+BUF] + punpckhdq mm0,mm0 + movq mm3,[0x70+BUF] + paddd mm4,mm0 + movq mm7,[0x78+BUF] + movd RET2,mm4 + movq mm0,[0x40+BUF] + movq mm4,[0x48+BUF] + OC_HADAMARD_ABS_ACCUM_8x4(0x68,0x78) + pmaddwd mm0,mm7 + /*We assume that the DC coefficient is always positive (which is true, + because the input to the INTRA transform was not a difference).*/ + movzx RET,RET_WORD + add RET2,RET2 + sub RET2,RET + movq mm4,mm0 + punpckhdq mm0,mm0 + paddd mm4,mm0 + movd RET,mm4 + lea RET,[-64+RET2+RET*2] + mov [ret1],RET +#undef SRC +#undef SRC4 +#undef BUF +#undef RET +#undef RET_WORD +#undef RET2 +#undef YSTRIDE +#undef YSTRIDE3 + } + return ret1; +} + +void oc_enc_frag_sub_mmx(ogg_int16_t _residue[64], + const unsigned char *_src, const unsigned char *_ref,int _ystride){ + int i; + __asm pxor mm7,mm7 + for(i=4;i-->0;){ + __asm{ +#define SRC edx +#define YSTRIDE esi +#define RESIDUE eax +#define REF ecx + mov YSTRIDE,_ystride + mov RESIDUE,_residue + mov SRC,_src + mov REF,_ref + /*mm0=[src]*/ + movq mm0,[SRC] + /*mm1=[ref]*/ + movq mm1,[REF] + /*mm4=[src+ystride]*/ + movq mm4,[SRC+YSTRIDE] + /*mm5=[ref+ystride]*/ + movq mm5,[REF+YSTRIDE] + /*Compute [src]-[ref].*/ + movq mm2,mm0 + punpcklbw mm0,mm7 + movq mm3,mm1 + punpckhbw mm2,mm7 + punpcklbw mm1,mm7 + punpckhbw mm3,mm7 + psubw mm0,mm1 + psubw mm2,mm3 + /*Compute [src+ystride]-[ref+ystride].*/ + movq mm1,mm4 + punpcklbw mm4,mm7 + movq mm3,mm5 + punpckhbw mm1,mm7 + lea SRC,[SRC+YSTRIDE*2] + punpcklbw mm5,mm7 + lea REF,[REF+YSTRIDE*2] + punpckhbw mm3,mm7 + psubw mm4,mm5 + psubw mm1,mm3 + /*Write the answer out.*/ + movq [RESIDUE+0x00],mm0 + movq [RESIDUE+0x08],mm2 + movq [RESIDUE+0x10],mm4 + movq [RESIDUE+0x18],mm1 + lea RESIDUE,[RESIDUE+0x20] + mov _residue,RESIDUE + mov _src,SRC + mov _ref,REF +#undef SRC +#undef YSTRIDE +#undef RESIDUE +#undef REF + } + } +} + +void oc_enc_frag_sub_128_mmx(ogg_int16_t _residue[64], + const unsigned char *_src,int _ystride){ + __asm{ +#define YSTRIDE edx +#define YSTRIDE3 edi +#define RESIDUE ecx +#define SRC eax + mov YSTRIDE,_ystride + mov RESIDUE,_residue + mov SRC,_src + /*mm0=[src]*/ + movq mm0,[SRC] + /*mm1=[src+ystride]*/ + movq mm1,[SRC+YSTRIDE] + /*mm6={-1}x4*/ + pcmpeqw mm6,mm6 + /*mm2=[src+2*ystride]*/ + movq mm2,[SRC+YSTRIDE*2] + /*[ystride3]=3*[ystride]*/ + lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] + /*mm6={1}x4*/ + psllw mm6,15 + /*mm3=[src+3*ystride]*/ + movq mm3,[SRC+YSTRIDE3] + /*mm6={128}x4*/ + psrlw mm6,8 + /*mm7=0*/ + pxor mm7,mm7 + /*[src]=[src]+4*[ystride]*/ + lea SRC,[SRC+YSTRIDE*4] + /*Compute [src]-128 and [src+ystride]-128*/ + movq mm4,mm0 + punpcklbw mm0,mm7 + movq mm5,mm1 + punpckhbw mm4,mm7 + psubw mm0,mm6 + punpcklbw mm1,mm7 + psubw mm4,mm6 + punpckhbw mm5,mm7 + psubw mm1,mm6 + psubw mm5,mm6 + /*Write the answer out.*/ + movq [RESIDUE+0x00],mm0 + movq [RESIDUE+0x08],mm4 + movq [RESIDUE+0x10],mm1 + movq [RESIDUE+0x18],mm5 + /*mm0=[src+4*ystride]*/ + movq mm0,[SRC] + /*mm1=[src+5*ystride]*/ + movq mm1,[SRC+YSTRIDE] + /*Compute [src+2*ystride]-128 and [src+3*ystride]-128*/ + movq mm4,mm2 + punpcklbw mm2,mm7 + movq mm5,mm3 + punpckhbw mm4,mm7 + psubw mm2,mm6 + punpcklbw mm3,mm7 + psubw mm4,mm6 + punpckhbw mm5,mm7 + psubw mm3,mm6 + psubw mm5,mm6 + /*Write the answer out.*/ + movq [RESIDUE+0x20],mm2 + movq [RESIDUE+0x28],mm4 + movq [RESIDUE+0x30],mm3 + movq [RESIDUE+0x38],mm5 + /*Compute [src+6*ystride]-128 and [src+7*ystride]-128*/ + movq mm2,[SRC+YSTRIDE*2] + movq mm3,[SRC+YSTRIDE3] + movq mm4,mm0 + punpcklbw mm0,mm7 + movq mm5,mm1 + punpckhbw mm4,mm7 + psubw mm0,mm6 + punpcklbw mm1,mm7 + psubw mm4,mm6 + punpckhbw mm5,mm7 + psubw mm1,mm6 + psubw mm5,mm6 + /*Write the answer out.*/ + movq [RESIDUE+0x40],mm0 + movq [RESIDUE+0x48],mm4 + movq [RESIDUE+0x50],mm1 + movq [RESIDUE+0x58],mm5 + /*Compute [src+6*ystride]-128 and [src+7*ystride]-128*/ + movq mm4,mm2 + punpcklbw mm2,mm7 + movq mm5,mm3 + punpckhbw mm4,mm7 + psubw mm2,mm6 + punpcklbw mm3,mm7 + psubw mm4,mm6 + punpckhbw mm5,mm7 + psubw mm3,mm6 + psubw mm5,mm6 + /*Write the answer out.*/ + movq [RESIDUE+0x60],mm2 + movq [RESIDUE+0x68],mm4 + movq [RESIDUE+0x70],mm3 + movq [RESIDUE+0x78],mm5 +#undef YSTRIDE +#undef YSTRIDE3 +#undef RESIDUE +#undef SRC + } +} + +void oc_enc_frag_copy2_mmxext(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride){ + oc_int_frag_copy2_mmxext(_dst,_ystride,_src1,_src2,_ystride); +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxfdct.c b/libs/libtheora-1.1/lib/x86_vc/mmxfdct.c new file mode 100644 index 00000000..dcf17c9f --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxfdct.c @@ -0,0 +1,670 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 1999-2006 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ********************************************************************/ + /*MMX fDCT implementation for x86_32*/ +/*$Id: fdct_ses2.c 14579 2008-03-12 06:42:40Z xiphmont $*/ +#include "x86enc.h" + +#if defined(OC_X86_ASM) + +#define OC_FDCT_STAGE1_8x4 __asm{ \ + /*Stage 1:*/ \ + /*mm0=t7'=t0-t7*/ \ + __asm psubw mm0,mm7 \ + __asm paddw mm7,mm7 \ + /*mm1=t6'=t1-t6*/ \ + __asm psubw mm1, mm6 \ + __asm paddw mm6,mm6 \ + /*mm2=t5'=t2-t5*/ \ + __asm psubw mm2,mm5 \ + __asm paddw mm5,mm5 \ + /*mm3=t4'=t3-t4*/ \ + __asm psubw mm3,mm4 \ + __asm paddw mm4,mm4 \ + /*mm7=t0'=t0+t7*/ \ + __asm paddw mm7,mm0 \ + /*mm6=t1'=t1+t6*/ \ + __asm paddw mm6,mm1 \ + /*mm5=t2'=t2+t5*/ \ + __asm paddw mm5,mm2 \ + /*mm4=t3'=t3+t4*/ \ + __asm paddw mm4,mm3\ +} + +#define OC_FDCT8x4(_r0,_r1,_r2,_r3,_r4,_r5,_r6,_r7) __asm{ \ + /*Stage 2:*/ \ + /*mm7=t3''=t0'-t3'*/ \ + __asm psubw mm7,mm4 \ + __asm paddw mm4,mm4 \ + /*mm6=t2''=t1'-t2'*/ \ + __asm psubw mm6,mm5 \ + __asm movq [Y+_r6],mm7 \ + __asm paddw mm5,mm5 \ + /*mm1=t5''=t6'-t5'*/ \ + __asm psubw mm1,mm2 \ + __asm movq [Y+_r2],mm6 \ + /*mm4=t0''=t0'+t3'*/ \ + __asm paddw mm4,mm7 \ + __asm paddw mm2,mm2 \ + /*mm5=t1''=t1'+t2'*/ \ + __asm movq [Y+_r0],mm4 \ + __asm paddw mm5,mm6 \ + /*mm2=t6''=t6'+t5'*/ \ + __asm paddw mm2,mm1 \ + __asm movq [Y+_r4],mm5 \ + /*mm0=t7', mm1=t5'', mm2=t6'', mm3=t4'.*/ \ + /*mm4, mm5, mm6, mm7 are free.*/ \ + /*Stage 3:*/ \ + /*mm6={2}x4, mm7={27146,0xB500>>1}x2*/ \ + __asm mov A,0x5A806A0A \ + __asm pcmpeqb mm6,mm6 \ + __asm movd mm7,A \ + __asm psrlw mm6,15 \ + __asm punpckldq mm7,mm7 \ + __asm paddw mm6,mm6 \ + /*mm0=0, m2={-1}x4 \ + mm5:mm4=t5''*27146+0xB500*/ \ + __asm movq mm4,mm1 \ + __asm movq mm5,mm1 \ + __asm punpcklwd mm4,mm6 \ + __asm movq [Y+_r3],mm2 \ + __asm pmaddwd mm4,mm7 \ + __asm movq [Y+_r7],mm0 \ + __asm punpckhwd mm5,mm6 \ + __asm pxor mm0,mm0 \ + __asm pmaddwd mm5,mm7 \ + __asm pcmpeqb mm2,mm2 \ + /*mm2=t6'', mm1=t5''+(t5''!=0) \ + mm4=(t5''*27146+0xB500>>16)*/ \ + __asm pcmpeqw mm0,mm1 \ + __asm psrad mm4,16 \ + __asm psubw mm0,mm2 \ + __asm movq mm2, [Y+_r3] \ + __asm psrad mm5,16 \ + __asm paddw mm1,mm0 \ + __asm packssdw mm4,mm5 \ + /*mm4=s=(t5''*27146+0xB500>>16)+t5''+(t5''!=0)>>1*/ \ + __asm paddw mm4,mm1 \ + __asm movq mm0, [Y+_r7] \ + __asm psraw mm4,1 \ + __asm movq mm1,mm3 \ + /*mm3=t4''=t4'+s*/ \ + __asm paddw mm3,mm4 \ + /*mm1=t5'''=t4'-s*/ \ + __asm psubw mm1,mm4 \ + /*mm1=0, mm3={-1}x4 \ + mm5:mm4=t6''*27146+0xB500*/ \ + __asm movq mm4,mm2 \ + __asm movq mm5,mm2 \ + __asm punpcklwd mm4,mm6 \ + __asm movq [Y+_r5],mm1 \ + __asm pmaddwd mm4,mm7 \ + __asm movq [Y+_r1],mm3 \ + __asm punpckhwd mm5,mm6 \ + __asm pxor mm1,mm1 \ + __asm pmaddwd mm5,mm7 \ + __asm pcmpeqb mm3,mm3 \ + /*mm2=t6''+(t6''!=0), mm4=(t6''*27146+0xB500>>16)*/ \ + __asm psrad mm4,16 \ + __asm pcmpeqw mm1,mm2 \ + __asm psrad mm5,16 \ + __asm psubw mm1,mm3 \ + __asm packssdw mm4,mm5 \ + __asm paddw mm2,mm1 \ + /*mm1=t1'' \ + mm4=s=(t6''*27146+0xB500>>16)+t6''+(t6''!=0)>>1*/ \ + __asm paddw mm4,mm2 \ + __asm movq mm1,[Y+_r4] \ + __asm psraw mm4,1 \ + __asm movq mm2,mm0 \ + /*mm7={54491-0x7FFF,0x7FFF}x2 \ + mm0=t7''=t7'+s*/ \ + __asm paddw mm0,mm4 \ + /*mm2=t6'''=t7'-s*/ \ + __asm psubw mm2,mm4 \ + /*Stage 4:*/ \ + /*mm0=0, mm2=t0'' \ + mm5:mm4=t1''*27146+0xB500*/ \ + __asm movq mm4,mm1 \ + __asm movq mm5,mm1 \ + __asm punpcklwd mm4,mm6 \ + __asm movq [Y+_r3],mm2 \ + __asm pmaddwd mm4,mm7 \ + __asm movq mm2,[Y+_r0] \ + __asm punpckhwd mm5,mm6 \ + __asm movq [Y+_r7],mm0 \ + __asm pmaddwd mm5,mm7 \ + __asm pxor mm0,mm0 \ + /*mm7={27146,0x4000>>1}x2 \ + mm0=s=(t1''*27146+0xB500>>16)+t1''+(t1''!=0)*/ \ + __asm psrad mm4,16 \ + __asm mov A,0x20006A0A \ + __asm pcmpeqw mm0,mm1 \ + __asm movd mm7,A \ + __asm psrad mm5,16 \ + __asm psubw mm0,mm3 \ + __asm packssdw mm4,mm5 \ + __asm paddw mm0,mm1 \ + __asm punpckldq mm7,mm7 \ + __asm paddw mm0,mm4 \ + /*mm6={0x00000E3D}x2 \ + mm1=-(t0''==0), mm5:mm4=t0''*27146+0x4000*/ \ + __asm movq mm4,mm2 \ + __asm movq mm5,mm2 \ + __asm punpcklwd mm4,mm6 \ + __asm mov A,0x0E3D \ + __asm pmaddwd mm4,mm7 \ + __asm punpckhwd mm5,mm6 \ + __asm movd mm6,A \ + __asm pmaddwd mm5,mm7 \ + __asm pxor mm1,mm1 \ + __asm punpckldq mm6,mm6 \ + __asm pcmpeqw mm1,mm2 \ + /*mm4=r=(t0''*27146+0x4000>>16)+t0''+(t0''!=0)*/ \ + __asm psrad mm4,16 \ + __asm psubw mm1,mm3 \ + __asm psrad mm5,16 \ + __asm paddw mm2,mm1 \ + __asm packssdw mm4,mm5 \ + __asm movq mm1,[Y+_r5] \ + __asm paddw mm4,mm2 \ + /*mm2=t6'', mm0=_y[0]=u=r+s>>1 \ + The naive implementation could cause overflow, so we use \ + u=(r&s)+((r^s)>>1).*/ \ + __asm movq mm2,[Y+_r3] \ + __asm movq mm7,mm0 \ + __asm pxor mm0,mm4 \ + __asm pand mm7,mm4 \ + __asm psraw mm0,1 \ + __asm mov A,0x7FFF54DC \ + __asm paddw mm0,mm7 \ + __asm movd mm7,A \ + /*mm7={54491-0x7FFF,0x7FFF}x2 \ + mm4=_y[4]=v=r-u*/ \ + __asm psubw mm4,mm0 \ + __asm punpckldq mm7,mm7 \ + __asm movq [Y+_r4],mm4 \ + /*mm0=0, mm7={36410}x4 \ + mm1=(t5'''!=0), mm5:mm4=54491*t5'''+0x0E3D*/ \ + __asm movq mm4,mm1 \ + __asm movq mm5,mm1 \ + __asm punpcklwd mm4,mm1 \ + __asm mov A,0x8E3A8E3A \ + __asm pmaddwd mm4,mm7 \ + __asm movq [Y+_r0],mm0 \ + __asm punpckhwd mm5,mm1 \ + __asm pxor mm0,mm0 \ + __asm pmaddwd mm5,mm7 \ + __asm pcmpeqw mm1,mm0 \ + __asm movd mm7,A \ + __asm psubw mm1,mm3 \ + __asm punpckldq mm7,mm7 \ + __asm paddd mm4,mm6 \ + __asm paddd mm5,mm6 \ + /*mm0=0 \ + mm3:mm1=36410*t6'''+((t5'''!=0)<<16)*/ \ + __asm movq mm6,mm2 \ + __asm movq mm3,mm2 \ + __asm pmulhw mm6,mm7 \ + __asm paddw mm1,mm2 \ + __asm pmullw mm3,mm7 \ + __asm pxor mm0,mm0 \ + __asm paddw mm6,mm1 \ + __asm movq mm1,mm3 \ + __asm punpckhwd mm3,mm6 \ + __asm punpcklwd mm1,mm6 \ + /*mm3={-1}x4, mm6={1}x4 \ + mm4=_y[5]=u=(54491*t5'''+36410*t6'''+0x0E3D>>16)+(t5'''!=0)*/ \ + __asm paddd mm5,mm3 \ + __asm paddd mm4,mm1 \ + __asm psrad mm5,16 \ + __asm pxor mm6,mm6 \ + __asm psrad mm4,16 \ + __asm pcmpeqb mm3,mm3 \ + __asm packssdw mm4,mm5 \ + __asm psubw mm6,mm3 \ + /*mm1=t7'', mm7={26568,0x3400}x2 \ + mm2=s=t6'''-(36410*u>>16)*/ \ + __asm movq mm1,mm4 \ + __asm mov A,0x340067C8 \ + __asm pmulhw mm4,mm7 \ + __asm movd mm7,A \ + __asm movq [Y+_r5],mm1 \ + __asm punpckldq mm7,mm7 \ + __asm paddw mm4,mm1 \ + __asm movq mm1,[Y+_r7] \ + __asm psubw mm2,mm4 \ + /*mm6={0x00007B1B}x2 \ + mm0=(s!=0), mm5:mm4=s*26568+0x3400*/ \ + __asm movq mm4,mm2 \ + __asm movq mm5,mm2 \ + __asm punpcklwd mm4,mm6 \ + __asm pcmpeqw mm0,mm2 \ + __asm pmaddwd mm4,mm7 \ + __asm mov A,0x7B1B \ + __asm punpckhwd mm5,mm6 \ + __asm movd mm6,A \ + __asm pmaddwd mm5,mm7 \ + __asm psubw mm0,mm3 \ + __asm punpckldq mm6,mm6 \ + /*mm7={64277-0x7FFF,0x7FFF}x2 \ + mm2=_y[3]=v=(s*26568+0x3400>>17)+s+(s!=0)*/ \ + __asm psrad mm4,17 \ + __asm paddw mm2,mm0 \ + __asm psrad mm5,17 \ + __asm mov A,0x7FFF7B16 \ + __asm packssdw mm4,mm5 \ + __asm movd mm7,A \ + __asm paddw mm2,mm4 \ + __asm punpckldq mm7,mm7 \ + /*mm0=0, mm7={12785}x4 \ + mm1=(t7''!=0), mm2=t4'', mm5:mm4=64277*t7''+0x7B1B*/ \ + __asm movq mm4,mm1 \ + __asm movq mm5,mm1 \ + __asm movq [Y+_r3],mm2 \ + __asm punpcklwd mm4,mm1 \ + __asm movq mm2,[Y+_r1] \ + __asm pmaddwd mm4,mm7 \ + __asm mov A,0x31F131F1 \ + __asm punpckhwd mm5,mm1 \ + __asm pxor mm0,mm0 \ + __asm pmaddwd mm5,mm7 \ + __asm pcmpeqw mm1,mm0 \ + __asm movd mm7,A \ + __asm psubw mm1,mm3 \ + __asm punpckldq mm7,mm7 \ + __asm paddd mm4,mm6 \ + __asm paddd mm5,mm6 \ + /*mm3:mm1=12785*t4'''+((t7''!=0)<<16)*/ \ + __asm movq mm6,mm2 \ + __asm movq mm3,mm2 \ + __asm pmulhw mm6,mm7 \ + __asm pmullw mm3,mm7 \ + __asm paddw mm6,mm1 \ + __asm movq mm1,mm3 \ + __asm punpckhwd mm3,mm6 \ + __asm punpcklwd mm1,mm6 \ + /*mm3={-1}x4, mm6={1}x4 \ + mm4=_y[1]=u=(12785*t4'''+64277*t7''+0x7B1B>>16)+(t7''!=0)*/ \ + __asm paddd mm5,mm3 \ + __asm paddd mm4,mm1 \ + __asm psrad mm5,16 \ + __asm pxor mm6,mm6 \ + __asm psrad mm4,16 \ + __asm pcmpeqb mm3,mm3 \ + __asm packssdw mm4,mm5 \ + __asm psubw mm6,mm3 \ + /*mm1=t3'', mm7={20539,0x3000}x2 \ + mm4=s=(12785*u>>16)-t4''*/ \ + __asm movq [Y+_r1],mm4 \ + __asm pmulhw mm4,mm7 \ + __asm mov A,0x3000503B \ + __asm movq mm1,[Y+_r6] \ + __asm movd mm7,A \ + __asm psubw mm4,mm2 \ + __asm punpckldq mm7,mm7 \ + /*mm6={0x00006CB7}x2 \ + mm0=(s!=0), mm5:mm4=s*20539+0x3000*/ \ + __asm movq mm5,mm4 \ + __asm movq mm2,mm4 \ + __asm punpcklwd mm4,mm6 \ + __asm pcmpeqw mm0,mm2 \ + __asm pmaddwd mm4,mm7 \ + __asm mov A,0x6CB7 \ + __asm punpckhwd mm5,mm6 \ + __asm movd mm6,A \ + __asm pmaddwd mm5,mm7 \ + __asm psubw mm0,mm3 \ + __asm punpckldq mm6,mm6 \ + /*mm7={60547-0x7FFF,0x7FFF}x2 \ + mm2=_y[7]=v=(s*20539+0x3000>>20)+s+(s!=0)*/ \ + __asm psrad mm4,20 \ + __asm paddw mm2,mm0 \ + __asm psrad mm5,20 \ + __asm mov A,0x7FFF6C84 \ + __asm packssdw mm4,mm5 \ + __asm movd mm7,A \ + __asm paddw mm2,mm4 \ + __asm punpckldq mm7,mm7 \ + /*mm0=0, mm7={25080}x4 \ + mm2=t2'', mm5:mm4=60547*t3''+0x6CB7*/ \ + __asm movq mm4,mm1 \ + __asm movq mm5,mm1 \ + __asm movq [Y+_r7],mm2 \ + __asm punpcklwd mm4,mm1 \ + __asm movq mm2,[Y+_r2] \ + __asm pmaddwd mm4,mm7 \ + __asm mov A,0x61F861F8 \ + __asm punpckhwd mm5,mm1 \ + __asm pxor mm0,mm0 \ + __asm pmaddwd mm5,mm7 \ + __asm movd mm7,A \ + __asm pcmpeqw mm1,mm0 \ + __asm psubw mm1,mm3 \ + __asm punpckldq mm7,mm7 \ + __asm paddd mm4,mm6 \ + __asm paddd mm5,mm6 \ + /*mm3:mm1=25080*t2''+((t3''!=0)<<16)*/ \ + __asm movq mm6,mm2 \ + __asm movq mm3,mm2 \ + __asm pmulhw mm6,mm7 \ + __asm pmullw mm3,mm7 \ + __asm paddw mm6,mm1 \ + __asm movq mm1,mm3 \ + __asm punpckhwd mm3,mm6 \ + __asm punpcklwd mm1,mm6 \ + /*mm1={-1}x4 \ + mm4=u=(25080*t2''+60547*t3''+0x6CB7>>16)+(t3''!=0)*/ \ + __asm paddd mm5,mm3 \ + __asm paddd mm4,mm1 \ + __asm psrad mm5,16 \ + __asm mov A,0x28005460 \ + __asm psrad mm4,16 \ + __asm pcmpeqb mm1,mm1 \ + __asm packssdw mm4,mm5 \ + /*mm5={1}x4, mm6=_y[2]=u, mm7={21600,0x2800}x2 \ + mm4=s=(25080*u>>16)-t2''*/ \ + __asm movq mm6,mm4 \ + __asm pmulhw mm4,mm7 \ + __asm pxor mm5,mm5 \ + __asm movd mm7,A \ + __asm psubw mm5,mm1 \ + __asm punpckldq mm7,mm7 \ + __asm psubw mm4,mm2 \ + /*mm2=s+(s!=0) \ + mm4:mm3=s*21600+0x2800*/ \ + __asm movq mm3,mm4 \ + __asm movq mm2,mm4 \ + __asm punpckhwd mm4,mm5 \ + __asm pcmpeqw mm0,mm2 \ + __asm pmaddwd mm4,mm7 \ + __asm psubw mm0,mm1 \ + __asm punpcklwd mm3,mm5 \ + __asm paddw mm2,mm0 \ + __asm pmaddwd mm3,mm7 \ + /*mm0=_y[4], mm1=_y[7], mm4=_y[0], mm5=_y[5] \ + mm3=_y[6]=v=(s*21600+0x2800>>18)+s+(s!=0)*/ \ + __asm movq mm0,[Y+_r4] \ + __asm psrad mm4,18 \ + __asm movq mm5,[Y+_r5] \ + __asm psrad mm3,18 \ + __asm movq mm1,[Y+_r7] \ + __asm packssdw mm3,mm4 \ + __asm movq mm4,[Y+_r0] \ + __asm paddw mm3,mm2 \ +} + +/*On input, mm4=_y[0], mm6=_y[2], mm0=_y[4], mm5=_y[5], mm3=_y[6], mm1=_y[7]. + On output, {_y[4],mm1,mm2,mm3} contains the transpose of _y[4...7] and + {mm4,mm5,mm6,mm7} contains the transpose of _y[0...3].*/ +#define OC_TRANSPOSE8x4(_r0,_r1,_r2,_r3,_r4,_r5,_r6,_r7) __asm{ \ + /*First 4x4 transpose:*/ \ + /*mm0 = e3 e2 e1 e0 \ + mm5 = f3 f2 f1 f0 \ + mm3 = g3 g2 g1 g0 \ + mm1 = h3 h2 h1 h0*/ \ + __asm movq mm2,mm0 \ + __asm punpcklwd mm0,mm5 \ + __asm punpckhwd mm2,mm5 \ + __asm movq mm5,mm3 \ + __asm punpcklwd mm3,mm1 \ + __asm punpckhwd mm5,mm1 \ + /*mm0 = f1 e1 f0 e0 \ + mm2 = f3 e3 f2 e2 \ + mm3 = h1 g1 h0 g0 \ + mm5 = h3 g3 h2 g2*/ \ + __asm movq mm1,mm0 \ + __asm punpckldq mm0,mm3 \ + __asm movq [Y+_r4],mm0 \ + __asm punpckhdq mm1,mm3 \ + __asm movq mm0,[Y+_r1] \ + __asm movq mm3,mm2 \ + __asm punpckldq mm2,mm5 \ + __asm punpckhdq mm3,mm5 \ + __asm movq mm5,[Y+_r3] \ + /*_y[4] = h0 g0 f0 e0 \ + mm1 = h1 g1 f1 e1 \ + mm2 = h2 g2 f2 e2 \ + mm3 = h3 g3 f3 e3*/ \ + /*Second 4x4 transpose:*/ \ + /*mm4 = a3 a2 a1 a0 \ + mm0 = b3 b2 b1 b0 \ + mm6 = c3 c2 c1 c0 \ + mm5 = d3 d2 d1 d0*/ \ + __asm movq mm7,mm4 \ + __asm punpcklwd mm4,mm0 \ + __asm punpckhwd mm7,mm0 \ + __asm movq mm0,mm6 \ + __asm punpcklwd mm6,mm5 \ + __asm punpckhwd mm0,mm5 \ + /*mm4 = b1 a1 b0 a0 \ + mm7 = b3 a3 b2 a2 \ + mm6 = d1 c1 d0 c0 \ + mm0 = d3 c3 d2 c2*/ \ + __asm movq mm5,mm4 \ + __asm punpckldq mm4,mm6 \ + __asm punpckhdq mm5,mm6 \ + __asm movq mm6,mm7 \ + __asm punpckhdq mm7,mm0 \ + __asm punpckldq mm6,mm0 \ + /*mm4 = d0 c0 b0 a0 \ + mm5 = d1 c1 b1 a1 \ + mm6 = d2 c2 b2 a2 \ + mm7 = d3 c3 b3 a3*/ \ +} + +/*MMX implementation of the fDCT.*/ +void oc_enc_fdct8x8_mmx(ogg_int16_t _y[64],const ogg_int16_t _x[64]){ + ptrdiff_t a; + __asm{ +#define Y eax +#define A ecx +#define X edx + /*Add two extra bits of working precision to improve accuracy; any more and + we could overflow.*/ + /*We also add biases to correct for some systematic error that remains in + the full fDCT->iDCT round trip.*/ + mov X, _x + mov Y, _y + movq mm0,[0x00+X] + movq mm1,[0x10+X] + movq mm2,[0x20+X] + movq mm3,[0x30+X] + pcmpeqb mm4,mm4 + pxor mm7,mm7 + movq mm5,mm0 + psllw mm0,2 + pcmpeqw mm5,mm7 + movq mm7,[0x70+X] + psllw mm1,2 + psubw mm5,mm4 + psllw mm2,2 + mov A,1 + pslld mm5,16 + movd mm6,A + psllq mm5,16 + mov A,0x10001 + psllw mm3,2 + movd mm4,A + punpckhwd mm5,mm6 + psubw mm1,mm6 + movq mm6,[0x60+X] + paddw mm0,mm5 + movq mm5,[0x50+X] + paddw mm0,mm4 + movq mm4,[0x40+X] + /*We inline stage1 of the transform here so we can get better instruction + scheduling with the shifts.*/ + /*mm0=t7'=t0-t7*/ + psllw mm7,2 + psubw mm0,mm7 + psllw mm6,2 + paddw mm7,mm7 + /*mm1=t6'=t1-t6*/ + psllw mm5,2 + psubw mm1,mm6 + psllw mm4,2 + paddw mm6,mm6 + /*mm2=t5'=t2-t5*/ + psubw mm2,mm5 + paddw mm5,mm5 + /*mm3=t4'=t3-t4*/ + psubw mm3,mm4 + paddw mm4,mm4 + /*mm7=t0'=t0+t7*/ + paddw mm7,mm0 + /*mm6=t1'=t1+t6*/ + paddw mm6,mm1 + /*mm5=t2'=t2+t5*/ + paddw mm5,mm2 + /*mm4=t3'=t3+t4*/ + paddw mm4,mm3 + OC_FDCT8x4(0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70) + OC_TRANSPOSE8x4(0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70) + /*Swap out this 8x4 block for the next one.*/ + movq mm0,[0x08+X] + movq [0x30+Y],mm7 + movq mm7,[0x78+X] + movq [0x50+Y],mm1 + movq mm1,[0x18+X] + movq [0x20+Y],mm6 + movq mm6,[0x68+X] + movq [0x60+Y],mm2 + movq mm2,[0x28+X] + movq [0x10+Y],mm5 + movq mm5,[0x58+X] + movq [0x70+Y],mm3 + movq mm3,[0x38+X] + /*And increase its working precision, too.*/ + psllw mm0,2 + movq [0x00+Y],mm4 + psllw mm7,2 + movq mm4,[0x48+X] + /*We inline stage1 of the transform here so we can get better instruction + scheduling with the shifts.*/ + /*mm0=t7'=t0-t7*/ + psubw mm0,mm7 + psllw mm1,2 + paddw mm7,mm7 + psllw mm6,2 + /*mm1=t6'=t1-t6*/ + psubw mm1,mm6 + psllw mm2,2 + paddw mm6,mm6 + psllw mm5,2 + /*mm2=t5'=t2-t5*/ + psubw mm2,mm5 + psllw mm3,2 + paddw mm5,mm5 + psllw mm4,2 + /*mm3=t4'=t3-t4*/ + psubw mm3,mm4 + paddw mm4,mm4 + /*mm7=t0'=t0+t7*/ + paddw mm7,mm0 + /*mm6=t1'=t1+t6*/ + paddw mm6,mm1 + /*mm5=t2'=t2+t5*/ + paddw mm5,mm2 + /*mm4=t3'=t3+t4*/ + paddw mm4,mm3 + OC_FDCT8x4(0x08,0x18,0x28,0x38,0x48,0x58,0x68,0x78) + OC_TRANSPOSE8x4(0x08,0x18,0x28,0x38,0x48,0x58,0x68,0x78) + /*Here the first 4x4 block of output from the last transpose is the second + 4x4 block of input for the next transform. + We have cleverly arranged that it already be in the appropriate place, + so we only have to do half the stores and loads.*/ + movq mm0,[0x00+Y] + movq [0x58+Y],mm1 + movq mm1,[0x10+Y] + movq [0x68+Y],mm2 + movq mm2,[0x20+Y] + movq [0x78+Y],mm3 + movq mm3,[0x30+Y] + OC_FDCT_STAGE1_8x4 + OC_FDCT8x4(0x00,0x10,0x20,0x30,0x08,0x18,0x28,0x38) + OC_TRANSPOSE8x4(0x00,0x10,0x20,0x30,0x08,0x18,0x28,0x38) + /*mm0={-2}x4*/ + pcmpeqw mm0,mm0 + paddw mm0,mm0 + /*Round the results.*/ + psubw mm1,mm0 + psubw mm2,mm0 + psraw mm1,2 + psubw mm3,mm0 + movq [0x18+Y],mm1 + psraw mm2,2 + psubw mm4,mm0 + movq mm1,[0x08+Y] + psraw mm3,2 + psubw mm5,mm0 + psraw mm4,2 + psubw mm6,mm0 + psraw mm5,2 + psubw mm7,mm0 + psraw mm6,2 + psubw mm1,mm0 + psraw mm7,2 + movq mm0,[0x40+Y] + psraw mm1,2 + movq [0x30+Y],mm7 + movq mm7,[0x78+Y] + movq [0x08+Y],mm1 + movq mm1,[0x50+Y] + movq [0x20+Y],mm6 + movq mm6,[0x68+Y] + movq [0x28+Y],mm2 + movq mm2,[0x60+Y] + movq [0x10+Y],mm5 + movq mm5,[0x58+Y] + movq [0x38+Y],mm3 + movq mm3,[0x70+Y] + movq [0x00+Y],mm4 + movq mm4,[0x48+Y] + OC_FDCT_STAGE1_8x4 + OC_FDCT8x4(0x40,0x50,0x60,0x70,0x48,0x58,0x68,0x78) + OC_TRANSPOSE8x4(0x40,0x50,0x60,0x70,0x48,0x58,0x68,0x78) + /*mm0={-2}x4*/ + pcmpeqw mm0,mm0 + paddw mm0,mm0 + /*Round the results.*/ + psubw mm1,mm0 + psubw mm2,mm0 + psraw mm1,2 + psubw mm3,mm0 + movq [0x58+Y],mm1 + psraw mm2,2 + psubw mm4,mm0 + movq mm1,[0x48+Y] + psraw mm3,2 + psubw mm5,mm0 + movq [0x68+Y],mm2 + psraw mm4,2 + psubw mm6,mm0 + movq [0x78+Y],mm3 + psraw mm5,2 + psubw mm7,mm0 + movq [0x40+Y],mm4 + psraw mm6,2 + psubw mm1,mm0 + movq [0x50+Y],mm5 + psraw mm7,2 + movq [0x60+Y],mm6 + psraw mm1,2 + movq [0x70+Y],mm7 + movq [0x48+Y],mm1 +#undef Y +#undef A +#undef X + } +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxfrag.c b/libs/libtheora-1.1/lib/x86_vc/mmxfrag.c new file mode 100644 index 00000000..9b45820d --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxfrag.c @@ -0,0 +1,337 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxfrag.c 16578 2009-09-25 19:50:48Z cristianadam $ + + ********************************************************************/ + +/*MMX acceleration of fragment reconstruction for motion compensation. + Originally written by Rudolf Marek. + Additional optimization by Nils Pipenbrinck. + Note: Loops are unrolled for best performance. + The iteration each instruction belongs to is marked in the comments as #i.*/ +#include +#include "x86int.h" +#include "mmxfrag.h" + +#if defined(OC_X86_ASM) + +/*Copies an 8x8 block of pixels from _src to _dst, assuming _ystride bytes + between rows.*/ +void oc_frag_copy_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride){ +#define SRC edx +#define DST eax +#define YSTRIDE ecx +#define YSTRIDE3 esi + OC_FRAG_COPY_MMX(_dst,_src,_ystride); +#undef SRC +#undef DST +#undef YSTRIDE +#undef YSTRIDE3 +} + +void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride, + const ogg_int16_t *_residue){ + __asm{ +#define DST edx +#define DST4 esi +#define YSTRIDE eax +#define YSTRIDE3 edi +#define RESIDUE ecx + mov DST,_dst + mov YSTRIDE,_ystride + mov RESIDUE,_residue + lea DST4,[DST+YSTRIDE*4] + lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] + /*Set mm0 to 0xFFFFFFFFFFFFFFFF.*/ + pcmpeqw mm0,mm0 + /*#0 Load low residue.*/ + movq mm1,[0*8+RESIDUE] + /*#0 Load high residue.*/ + movq mm2,[1*8+RESIDUE] + /*Set mm0 to 0x8000800080008000.*/ + psllw mm0,15 + /*#1 Load low residue.*/ + movq mm3,[2*8+RESIDUE] + /*#1 Load high residue.*/ + movq mm4,[3*8+RESIDUE] + /*Set mm0 to 0x0080008000800080.*/ + psrlw mm0,8 + /*#2 Load low residue.*/ + movq mm5,[4*8+RESIDUE] + /*#2 Load high residue.*/ + movq mm6,[5*8+RESIDUE] + /*#0 Bias low residue.*/ + paddsw mm1,mm0 + /*#0 Bias high residue.*/ + paddsw mm2,mm0 + /*#0 Pack to byte.*/ + packuswb mm1,mm2 + /*#1 Bias low residue.*/ + paddsw mm3,mm0 + /*#1 Bias high residue.*/ + paddsw mm4,mm0 + /*#1 Pack to byte.*/ + packuswb mm3,mm4 + /*#2 Bias low residue.*/ + paddsw mm5,mm0 + /*#2 Bias high residue.*/ + paddsw mm6,mm0 + /*#2 Pack to byte.*/ + packuswb mm5,mm6 + /*#0 Write row.*/ + movq [DST],mm1 + /*#1 Write row.*/ + movq [DST+YSTRIDE],mm3 + /*#2 Write row.*/ + movq [DST+YSTRIDE*2],mm5 + /*#3 Load low residue.*/ + movq mm1,[6*8+RESIDUE] + /*#3 Load high residue.*/ + movq mm2,[7*8+RESIDUE] + /*#4 Load high residue.*/ + movq mm3,[8*8+RESIDUE] + /*#4 Load high residue.*/ + movq mm4,[9*8+RESIDUE] + /*#5 Load high residue.*/ + movq mm5,[10*8+RESIDUE] + /*#5 Load high residue.*/ + movq mm6,[11*8+RESIDUE] + /*#3 Bias low residue.*/ + paddsw mm1,mm0 + /*#3 Bias high residue.*/ + paddsw mm2,mm0 + /*#3 Pack to byte.*/ + packuswb mm1,mm2 + /*#4 Bias low residue.*/ + paddsw mm3,mm0 + /*#4 Bias high residue.*/ + paddsw mm4,mm0 + /*#4 Pack to byte.*/ + packuswb mm3,mm4 + /*#5 Bias low residue.*/ + paddsw mm5,mm0 + /*#5 Bias high residue.*/ + paddsw mm6,mm0 + /*#5 Pack to byte.*/ + packuswb mm5,mm6 + /*#3 Write row.*/ + movq [DST+YSTRIDE3],mm1 + /*#4 Write row.*/ + movq [DST4],mm3 + /*#5 Write row.*/ + movq [DST4+YSTRIDE],mm5 + /*#6 Load low residue.*/ + movq mm1,[12*8+RESIDUE] + /*#6 Load high residue.*/ + movq mm2,[13*8+RESIDUE] + /*#7 Load low residue.*/ + movq mm3,[14*8+RESIDUE] + /*#7 Load high residue.*/ + movq mm4,[15*8+RESIDUE] + /*#6 Bias low residue.*/ + paddsw mm1,mm0 + /*#6 Bias high residue.*/ + paddsw mm2,mm0 + /*#6 Pack to byte.*/ + packuswb mm1,mm2 + /*#7 Bias low residue.*/ + paddsw mm3,mm0 + /*#7 Bias high residue.*/ + paddsw mm4,mm0 + /*#7 Pack to byte.*/ + packuswb mm3,mm4 + /*#6 Write row.*/ + movq [DST4+YSTRIDE*2],mm1 + /*#7 Write row.*/ + movq [DST4+YSTRIDE3],mm3 +#undef DST +#undef DST4 +#undef YSTRIDE +#undef YSTRIDE3 +#undef RESIDUE + } +} + +void oc_frag_recon_inter_mmx(unsigned char *_dst,const unsigned char *_src, + int _ystride,const ogg_int16_t *_residue){ + int i; + /*Zero mm0.*/ + __asm pxor mm0,mm0; + for(i=4;i-->0;){ + __asm{ +#define DST edx +#define SRC ecx +#define YSTRIDE edi +#define RESIDUE eax + mov DST,_dst + mov SRC,_src + mov YSTRIDE,_ystride + mov RESIDUE,_residue + /*#0 Load source.*/ + movq mm3,[SRC] + /*#1 Load source.*/ + movq mm7,[SRC+YSTRIDE] + /*#0 Get copy of src.*/ + movq mm4,mm3 + /*#0 Expand high source.*/ + punpckhbw mm4,mm0 + /*#0 Expand low source.*/ + punpcklbw mm3,mm0 + /*#0 Add residue high.*/ + paddsw mm4,[8+RESIDUE] + /*#1 Get copy of src.*/ + movq mm2,mm7 + /*#0 Add residue low.*/ + paddsw mm3,[RESIDUE] + /*#1 Expand high source.*/ + punpckhbw mm2,mm0 + /*#0 Pack final row pixels.*/ + packuswb mm3,mm4 + /*#1 Expand low source.*/ + punpcklbw mm7,mm0 + /*#1 Add residue low.*/ + paddsw mm7,[16+RESIDUE] + /*#1 Add residue high.*/ + paddsw mm2,[24+RESIDUE] + /*Advance residue.*/ + lea RESIDUE,[32+RESIDUE] + /*#1 Pack final row pixels.*/ + packuswb mm7,mm2 + /*Advance src.*/ + lea SRC,[SRC+YSTRIDE*2] + /*#0 Write row.*/ + movq [DST],mm3 + /*#1 Write row.*/ + movq [DST+YSTRIDE],mm7 + /*Advance dst.*/ + lea DST,[DST+YSTRIDE*2] + mov _residue,RESIDUE + mov _dst,DST + mov _src,SRC +#undef DST +#undef SRC +#undef YSTRIDE +#undef RESIDUE + } + } +} + +void oc_frag_recon_inter2_mmx(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t *_residue){ + int i; + /*Zero mm7.*/ + __asm pxor mm7,mm7; + for(i=4;i-->0;){ + __asm{ +#define SRC1 ecx +#define SRC2 edi +#define YSTRIDE esi +#define RESIDUE edx +#define DST eax + mov YSTRIDE,_ystride + mov DST,_dst + mov RESIDUE,_residue + mov SRC1,_src1 + mov SRC2,_src2 + /*#0 Load src1.*/ + movq mm0,[SRC1] + /*#0 Load src2.*/ + movq mm2,[SRC2] + /*#0 Copy src1.*/ + movq mm1,mm0 + /*#0 Copy src2.*/ + movq mm3,mm2 + /*#1 Load src1.*/ + movq mm4,[SRC1+YSTRIDE] + /*#0 Unpack lower src1.*/ + punpcklbw mm0,mm7 + /*#1 Load src2.*/ + movq mm5,[SRC2+YSTRIDE] + /*#0 Unpack higher src1.*/ + punpckhbw mm1,mm7 + /*#0 Unpack lower src2.*/ + punpcklbw mm2,mm7 + /*#0 Unpack higher src2.*/ + punpckhbw mm3,mm7 + /*Advance src1 ptr.*/ + lea SRC1,[SRC1+YSTRIDE*2] + /*Advance src2 ptr.*/ + lea SRC2,[SRC2+YSTRIDE*2] + /*#0 Lower src1+src2.*/ + paddsw mm0,mm2 + /*#0 Higher src1+src2.*/ + paddsw mm1,mm3 + /*#1 Copy src1.*/ + movq mm2,mm4 + /*#0 Build lo average.*/ + psraw mm0,1 + /*#1 Copy src2.*/ + movq mm3,mm5 + /*#1 Unpack lower src1.*/ + punpcklbw mm4,mm7 + /*#0 Build hi average.*/ + psraw mm1,1 + /*#1 Unpack higher src1.*/ + punpckhbw mm2,mm7 + /*#0 low+=residue.*/ + paddsw mm0,[RESIDUE] + /*#1 Unpack lower src2.*/ + punpcklbw mm5,mm7 + /*#0 high+=residue.*/ + paddsw mm1,[8+RESIDUE] + /*#1 Unpack higher src2.*/ + punpckhbw mm3,mm7 + /*#1 Lower src1+src2.*/ + paddsw mm5,mm4 + /*#0 Pack and saturate.*/ + packuswb mm0,mm1 + /*#1 Higher src1+src2.*/ + paddsw mm3,mm2 + /*#0 Write row.*/ + movq [DST],mm0 + /*#1 Build lo average.*/ + psraw mm5,1 + /*#1 Build hi average.*/ + psraw mm3,1 + /*#1 low+=residue.*/ + paddsw mm5,[16+RESIDUE] + /*#1 high+=residue.*/ + paddsw mm3,[24+RESIDUE] + /*#1 Pack and saturate.*/ + packuswb mm5,mm3 + /*#1 Write row ptr.*/ + movq [DST+YSTRIDE],mm5 + /*Advance residue ptr.*/ + add RESIDUE,32 + /*Advance dest ptr.*/ + lea DST,[DST+YSTRIDE*2] + mov _dst,DST + mov _residue,RESIDUE + mov _src1,SRC1 + mov _src2,SRC2 +#undef SRC1 +#undef SRC2 +#undef YSTRIDE +#undef RESIDUE +#undef DST + } + } +} + +void oc_restore_fpu_mmx(void){ + __asm emms; +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxfrag.h b/libs/libtheora-1.1/lib/x86_vc/mmxfrag.h new file mode 100644 index 00000000..45ee93e7 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxfrag.h @@ -0,0 +1,61 @@ +#if !defined(_x86_vc_mmxfrag_H) +# define _x86_vc_mmxfrag_H (1) +# include +# include "x86int.h" + +#if defined(OC_X86_ASM) + +/*Copies an 8x8 block of pixels from _src to _dst, assuming _ystride bytes + between rows.*/ +#define OC_FRAG_COPY_MMX(_dst,_src,_ystride) \ + do{ \ + const unsigned char *src; \ + unsigned char *dst; \ + src=(_src); \ + dst=(_dst); \ + __asm mov SRC,src \ + __asm mov DST,dst \ + __asm mov YSTRIDE,_ystride \ + /*src+0*ystride*/ \ + __asm movq mm0,[SRC] \ + /*src+1*ystride*/ \ + __asm movq mm1,[SRC+YSTRIDE] \ + /*ystride3=ystride*3*/ \ + __asm lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] \ + /*src+2*ystride*/ \ + __asm movq mm2,[SRC+YSTRIDE*2] \ + /*src+3*ystride*/ \ + __asm movq mm3,[SRC+YSTRIDE3] \ + /*dst+0*ystride*/ \ + __asm movq [DST],mm0 \ + /*dst+1*ystride*/ \ + __asm movq [DST+YSTRIDE],mm1 \ + /*Pointer to next 4.*/ \ + __asm lea SRC,[SRC+YSTRIDE*4] \ + /*dst+2*ystride*/ \ + __asm movq [DST+YSTRIDE*2],mm2 \ + /*dst+3*ystride*/ \ + __asm movq [DST+YSTRIDE3],mm3 \ + /*Pointer to next 4.*/ \ + __asm lea DST,[DST+YSTRIDE*4] \ + /*src+0*ystride*/ \ + __asm movq mm0,[SRC] \ + /*src+1*ystride*/ \ + __asm movq mm1,[SRC+YSTRIDE] \ + /*src+2*ystride*/ \ + __asm movq mm2,[SRC+YSTRIDE*2] \ + /*src+3*ystride*/ \ + __asm movq mm3,[SRC+YSTRIDE3] \ + /*dst+0*ystride*/ \ + __asm movq [DST],mm0 \ + /*dst+1*ystride*/ \ + __asm movq [DST+YSTRIDE],mm1 \ + /*dst+2*ystride*/ \ + __asm movq [DST+YSTRIDE*2],mm2 \ + /*dst+3*ystride*/ \ + __asm movq [DST+YSTRIDE3],mm3 \ + } \ + while(0) + +# endif +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxidct.c b/libs/libtheora-1.1/lib/x86_vc/mmxidct.c new file mode 100644 index 00000000..970508f1 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxidct.c @@ -0,0 +1,562 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxidct.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +/*MMX acceleration of Theora's iDCT. + Originally written by Rudolf Marek, based on code from On2's VP3.*/ +#include "x86int.h" +#include "../dct.h" + +#if defined(OC_X86_ASM) + +/*These are offsets into the table of constants below.*/ +/*7 rows of cosines, in order: pi/16 * (1 ... 7).*/ +#define OC_COSINE_OFFSET (0) +/*A row of 8's.*/ +#define OC_EIGHT_OFFSET (56) + + + +/*A table of constants used by the MMX routines.*/ +static const __declspec(align(16))ogg_uint16_t + OC_IDCT_CONSTS[(7+1)*4]={ + (ogg_uint16_t)OC_C1S7,(ogg_uint16_t)OC_C1S7, + (ogg_uint16_t)OC_C1S7,(ogg_uint16_t)OC_C1S7, + (ogg_uint16_t)OC_C2S6,(ogg_uint16_t)OC_C2S6, + (ogg_uint16_t)OC_C2S6,(ogg_uint16_t)OC_C2S6, + (ogg_uint16_t)OC_C3S5,(ogg_uint16_t)OC_C3S5, + (ogg_uint16_t)OC_C3S5,(ogg_uint16_t)OC_C3S5, + (ogg_uint16_t)OC_C4S4,(ogg_uint16_t)OC_C4S4, + (ogg_uint16_t)OC_C4S4,(ogg_uint16_t)OC_C4S4, + (ogg_uint16_t)OC_C5S3,(ogg_uint16_t)OC_C5S3, + (ogg_uint16_t)OC_C5S3,(ogg_uint16_t)OC_C5S3, + (ogg_uint16_t)OC_C6S2,(ogg_uint16_t)OC_C6S2, + (ogg_uint16_t)OC_C6S2,(ogg_uint16_t)OC_C6S2, + (ogg_uint16_t)OC_C7S1,(ogg_uint16_t)OC_C7S1, + (ogg_uint16_t)OC_C7S1,(ogg_uint16_t)OC_C7S1, + 8, 8, 8, 8 +}; + +/*38 cycles*/ +#define OC_IDCT_BEGIN __asm{ \ + __asm movq mm2,OC_I(3) \ + __asm movq mm6,OC_C(3) \ + __asm movq mm4,mm2 \ + __asm movq mm7,OC_J(5) \ + __asm pmulhw mm4,mm6 \ + __asm movq mm1,OC_C(5) \ + __asm pmulhw mm6,mm7 \ + __asm movq mm5,mm1 \ + __asm pmulhw mm1,mm2 \ + __asm movq mm3,OC_I(1) \ + __asm pmulhw mm5,mm7 \ + __asm movq mm0,OC_C(1) \ + __asm paddw mm4,mm2 \ + __asm paddw mm6,mm7 \ + __asm paddw mm2,mm1 \ + __asm movq mm1,OC_J(7) \ + __asm paddw mm7,mm5 \ + __asm movq mm5,mm0 \ + __asm pmulhw mm0,mm3 \ + __asm paddw mm4,mm7 \ + __asm pmulhw mm5,mm1 \ + __asm movq mm7,OC_C(7) \ + __asm psubw mm6,mm2 \ + __asm paddw mm0,mm3 \ + __asm pmulhw mm3,mm7 \ + __asm movq mm2,OC_I(2) \ + __asm pmulhw mm7,mm1 \ + __asm paddw mm5,mm1 \ + __asm movq mm1,mm2 \ + __asm pmulhw mm2,OC_C(2) \ + __asm psubw mm3,mm5 \ + __asm movq mm5,OC_J(6) \ + __asm paddw mm0,mm7 \ + __asm movq mm7,mm5 \ + __asm psubw mm0,mm4 \ + __asm pmulhw mm5,OC_C(2) \ + __asm paddw mm2,mm1 \ + __asm pmulhw mm1,OC_C(6) \ + __asm paddw mm4,mm4 \ + __asm paddw mm4,mm0 \ + __asm psubw mm3,mm6 \ + __asm paddw mm5,mm7 \ + __asm paddw mm6,mm6 \ + __asm pmulhw mm7,OC_C(6) \ + __asm paddw mm6,mm3 \ + __asm movq OC_I(1),mm4 \ + __asm psubw mm1,mm5 \ + __asm movq mm4,OC_C(4) \ + __asm movq mm5,mm3 \ + __asm pmulhw mm3,mm4 \ + __asm paddw mm7,mm2 \ + __asm movq OC_I(2),mm6 \ + __asm movq mm2,mm0 \ + __asm movq mm6,OC_I(0) \ + __asm pmulhw mm0,mm4 \ + __asm paddw mm5,mm3 \ + __asm movq mm3,OC_J(4) \ + __asm psubw mm5,mm1 \ + __asm paddw mm2,mm0 \ + __asm psubw mm6,mm3 \ + __asm movq mm0,mm6 \ + __asm pmulhw mm6,mm4 \ + __asm paddw mm3,mm3 \ + __asm paddw mm1,mm1 \ + __asm paddw mm3,mm0 \ + __asm paddw mm1,mm5 \ + __asm pmulhw mm4,mm3 \ + __asm paddw mm6,mm0 \ + __asm psubw mm6,mm2 \ + __asm paddw mm2,mm2 \ + __asm movq mm0,OC_I(1) \ + __asm paddw mm2,mm6 \ + __asm paddw mm4,mm3 \ + __asm psubw mm2,mm1 \ +} + +/*38+8=46 cycles.*/ +#define OC_ROW_IDCT __asm{ \ + OC_IDCT_BEGIN \ + /*r3=D'*/ \ + __asm movq mm3,OC_I(2) \ + /*r4=E'=E-G*/ \ + __asm psubw mm4,mm7 \ + /*r1=H'+H'*/ \ + __asm paddw mm1,mm1 \ + /*r7=G+G*/ \ + __asm paddw mm7,mm7 \ + /*r1=R1=A''+H'*/ \ + __asm paddw mm1,mm2 \ + /*r7=G'=E+G*/ \ + __asm paddw mm7,mm4 \ + /*r4=R4=E'-D'*/ \ + __asm psubw mm4,mm3 \ + __asm paddw mm3,mm3 \ + /*r6=R6=F'-B''*/ \ + __asm psubw mm6,mm5 \ + __asm paddw mm5,mm5 \ + /*r3=R3=E'+D'*/ \ + __asm paddw mm3,mm4 \ + /*r5=R5=F'+B''*/ \ + __asm paddw mm5,mm6 \ + /*r7=R7=G'-C'*/ \ + __asm psubw mm7,mm0 \ + __asm paddw mm0,mm0 \ + /*Save R1.*/ \ + __asm movq OC_I(1),mm1 \ + /*r0=R0=G.+C.*/ \ + __asm paddw mm0,mm7 \ +} + +/*The following macro does two 4x4 transposes in place. + At entry, we assume: + r0 = a3 a2 a1 a0 + I(1) = b3 b2 b1 b0 + r2 = c3 c2 c1 c0 + r3 = d3 d2 d1 d0 + + r4 = e3 e2 e1 e0 + r5 = f3 f2 f1 f0 + r6 = g3 g2 g1 g0 + r7 = h3 h2 h1 h0 + + At exit, we have: + I(0) = d0 c0 b0 a0 + I(1) = d1 c1 b1 a1 + I(2) = d2 c2 b2 a2 + I(3) = d3 c3 b3 a3 + + J(4) = h0 g0 f0 e0 + J(5) = h1 g1 f1 e1 + J(6) = h2 g2 f2 e2 + J(7) = h3 g3 f3 e3 + + I(0) I(1) I(2) I(3) is the transpose of r0 I(1) r2 r3. + J(4) J(5) J(6) J(7) is the transpose of r4 r5 r6 r7. + + Since r1 is free at entry, we calculate the Js first.*/ +/*19 cycles.*/ +#define OC_TRANSPOSE __asm{ \ + __asm movq mm1,mm4 \ + __asm punpcklwd mm4,mm5 \ + __asm movq OC_I(0),mm0 \ + __asm punpckhwd mm1,mm5 \ + __asm movq mm0,mm6 \ + __asm punpcklwd mm6,mm7 \ + __asm movq mm5,mm4 \ + __asm punpckldq mm4,mm6 \ + __asm punpckhdq mm5,mm6 \ + __asm movq mm6,mm1 \ + __asm movq OC_J(4),mm4 \ + __asm punpckhwd mm0,mm7 \ + __asm movq OC_J(5),mm5 \ + __asm punpckhdq mm6,mm0 \ + __asm movq mm4,OC_I(0) \ + __asm punpckldq mm1,mm0 \ + __asm movq mm5,OC_I(1) \ + __asm movq mm0,mm4 \ + __asm movq OC_J(7),mm6 \ + __asm punpcklwd mm0,mm5 \ + __asm movq OC_J(6),mm1 \ + __asm punpckhwd mm4,mm5 \ + __asm movq mm5,mm2 \ + __asm punpcklwd mm2,mm3 \ + __asm movq mm1,mm0 \ + __asm punpckldq mm0,mm2 \ + __asm punpckhdq mm1,mm2 \ + __asm movq mm2,mm4 \ + __asm movq OC_I(0),mm0 \ + __asm punpckhwd mm5,mm3 \ + __asm movq OC_I(1),mm1 \ + __asm punpckhdq mm4,mm5 \ + __asm punpckldq mm2,mm5 \ + __asm movq OC_I(3),mm4 \ + __asm movq OC_I(2),mm2 \ +} + +/*38+19=57 cycles.*/ +#define OC_COLUMN_IDCT __asm{ \ + OC_IDCT_BEGIN \ + __asm paddw mm2,OC_8 \ + /*r1=H'+H'*/ \ + __asm paddw mm1,mm1 \ + /*r1=R1=A''+H'*/ \ + __asm paddw mm1,mm2 \ + /*r2=NR2*/ \ + __asm psraw mm2,4 \ + /*r4=E'=E-G*/ \ + __asm psubw mm4,mm7 \ + /*r1=NR1*/ \ + __asm psraw mm1,4 \ + /*r3=D'*/ \ + __asm movq mm3,OC_I(2) \ + /*r7=G+G*/ \ + __asm paddw mm7,mm7 \ + /*Store NR2 at I(2).*/ \ + __asm movq OC_I(2),mm2 \ + /*r7=G'=E+G*/ \ + __asm paddw mm7,mm4 \ + /*Store NR1 at I(1).*/ \ + __asm movq OC_I(1),mm1 \ + /*r4=R4=E'-D'*/ \ + __asm psubw mm4,mm3 \ + __asm paddw mm4,OC_8 \ + /*r3=D'+D'*/ \ + __asm paddw mm3,mm3 \ + /*r3=R3=E'+D'*/ \ + __asm paddw mm3,mm4 \ + /*r4=NR4*/ \ + __asm psraw mm4,4 \ + /*r6=R6=F'-B''*/ \ + __asm psubw mm6,mm5 \ + /*r3=NR3*/ \ + __asm psraw mm3,4 \ + __asm paddw mm6,OC_8 \ + /*r5=B''+B''*/ \ + __asm paddw mm5,mm5 \ + /*r5=R5=F'+B''*/ \ + __asm paddw mm5,mm6 \ + /*r6=NR6*/ \ + __asm psraw mm6,4 \ + /*Store NR4 at J(4).*/ \ + __asm movq OC_J(4),mm4 \ + /*r5=NR5*/ \ + __asm psraw mm5,4 \ + /*Store NR3 at I(3).*/ \ + __asm movq OC_I(3),mm3 \ + /*r7=R7=G'-C'*/ \ + __asm psubw mm7,mm0 \ + __asm paddw mm7,OC_8 \ + /*r0=C'+C'*/ \ + __asm paddw mm0,mm0 \ + /*r0=R0=G'+C'*/ \ + __asm paddw mm0,mm7 \ + /*r7=NR7*/ \ + __asm psraw mm7,4 \ + /*Store NR6 at J(6).*/ \ + __asm movq OC_J(6),mm6 \ + /*r0=NR0*/ \ + __asm psraw mm0,4 \ + /*Store NR5 at J(5).*/ \ + __asm movq OC_J(5),mm5 \ + /*Store NR7 at J(7).*/ \ + __asm movq OC_J(7),mm7 \ + /*Store NR0 at I(0).*/ \ + __asm movq OC_I(0),mm0 \ +} + +#define OC_MID(_m,_i) [CONSTS+_m+(_i)*8] +#define OC_C(_i) OC_MID(OC_COSINE_OFFSET,_i-1) +#define OC_8 OC_MID(OC_EIGHT_OFFSET,0) + +static void oc_idct8x8_slow(ogg_int16_t _y[64]){ + /*This routine accepts an 8x8 matrix, but in partially transposed form. + Every 4x4 block is transposed.*/ + __asm{ +#define CONSTS eax +#define Y edx + mov CONSTS,offset OC_IDCT_CONSTS + mov Y,_y +#define OC_I(_k) [Y+_k*16] +#define OC_J(_k) [Y+(_k-4)*16+8] + OC_ROW_IDCT + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) [Y+(_k*16)+64] +#define OC_J(_k) [Y+(_k-4)*16+72] + OC_ROW_IDCT + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) [Y+_k*16] +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT +#undef OC_I +#undef OC_J +#define OC_I(_k) [Y+_k*16+8] +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT +#undef OC_I +#undef OC_J +#undef CONSTS +#undef Y + } +} + +/*25 cycles.*/ +#define OC_IDCT_BEGIN_10 __asm{ \ + __asm movq mm2,OC_I(3) \ + __asm nop \ + __asm movq mm6,OC_C(3) \ + __asm movq mm4,mm2 \ + __asm movq mm1,OC_C(5) \ + __asm pmulhw mm4,mm6 \ + __asm movq mm3,OC_I(1) \ + __asm pmulhw mm1,mm2 \ + __asm movq mm0,OC_C(1) \ + __asm paddw mm4,mm2 \ + __asm pxor mm6,mm6 \ + __asm paddw mm2,mm1 \ + __asm movq mm5,OC_I(2) \ + __asm pmulhw mm0,mm3 \ + __asm movq mm1,mm5 \ + __asm paddw mm0,mm3 \ + __asm pmulhw mm3,OC_C(7) \ + __asm psubw mm6,mm2 \ + __asm pmulhw mm5,OC_C(2) \ + __asm psubw mm0,mm4 \ + __asm movq mm7,OC_I(2) \ + __asm paddw mm4,mm4 \ + __asm paddw mm7,mm5 \ + __asm paddw mm4,mm0 \ + __asm pmulhw mm1,OC_C(6) \ + __asm psubw mm3,mm6 \ + __asm movq OC_I(1),mm4 \ + __asm paddw mm6,mm6 \ + __asm movq mm4,OC_C(4) \ + __asm paddw mm6,mm3 \ + __asm movq mm5,mm3 \ + __asm pmulhw mm3,mm4 \ + __asm movq OC_I(2),mm6 \ + __asm movq mm2,mm0 \ + __asm movq mm6,OC_I(0) \ + __asm pmulhw mm0,mm4 \ + __asm paddw mm5,mm3 \ + __asm paddw mm2,mm0 \ + __asm psubw mm5,mm1 \ + __asm pmulhw mm6,mm4 \ + __asm paddw mm6,OC_I(0) \ + __asm paddw mm1,mm1 \ + __asm movq mm4,mm6 \ + __asm paddw mm1,mm5 \ + __asm psubw mm6,mm2 \ + __asm paddw mm2,mm2 \ + __asm movq mm0,OC_I(1) \ + __asm paddw mm2,mm6 \ + __asm psubw mm2,mm1 \ + __asm nop \ +} + +/*25+8=33 cycles.*/ +#define OC_ROW_IDCT_10 __asm{ \ + OC_IDCT_BEGIN_10 \ + /*r3=D'*/ \ + __asm movq mm3,OC_I(2) \ + /*r4=E'=E-G*/ \ + __asm psubw mm4,mm7 \ + /*r1=H'+H'*/ \ + __asm paddw mm1,mm1 \ + /*r7=G+G*/ \ + __asm paddw mm7,mm7 \ + /*r1=R1=A''+H'*/ \ + __asm paddw mm1,mm2 \ + /*r7=G'=E+G*/ \ + __asm paddw mm7,mm4 \ + /*r4=R4=E'-D'*/ \ + __asm psubw mm4,mm3 \ + __asm paddw mm3,mm3 \ + /*r6=R6=F'-B''*/ \ + __asm psubw mm6,mm5 \ + __asm paddw mm5,mm5 \ + /*r3=R3=E'+D'*/ \ + __asm paddw mm3,mm4 \ + /*r5=R5=F'+B''*/ \ + __asm paddw mm5,mm6 \ + /*r7=R7=G'-C'*/ \ + __asm psubw mm7,mm0 \ + __asm paddw mm0,mm0 \ + /*Save R1.*/ \ + __asm movq OC_I(1),mm1 \ + /*r0=R0=G'+C'*/ \ + __asm paddw mm0,mm7 \ +} + +/*25+19=44 cycles'*/ +#define OC_COLUMN_IDCT_10 __asm{ \ + OC_IDCT_BEGIN_10 \ + __asm paddw mm2,OC_8 \ + /*r1=H'+H'*/ \ + __asm paddw mm1,mm1 \ + /*r1=R1=A''+H'*/ \ + __asm paddw mm1,mm2 \ + /*r2=NR2*/ \ + __asm psraw mm2,4 \ + /*r4=E'=E-G*/ \ + __asm psubw mm4,mm7 \ + /*r1=NR1*/ \ + __asm psraw mm1,4 \ + /*r3=D'*/ \ + __asm movq mm3,OC_I(2) \ + /*r7=G+G*/ \ + __asm paddw mm7,mm7 \ + /*Store NR2 at I(2).*/ \ + __asm movq OC_I(2),mm2 \ + /*r7=G'=E+G*/ \ + __asm paddw mm7,mm4 \ + /*Store NR1 at I(1).*/ \ + __asm movq OC_I(1),mm1 \ + /*r4=R4=E'-D'*/ \ + __asm psubw mm4,mm3 \ + __asm paddw mm4,OC_8 \ + /*r3=D'+D'*/ \ + __asm paddw mm3,mm3 \ + /*r3=R3=E'+D'*/ \ + __asm paddw mm3,mm4 \ + /*r4=NR4*/ \ + __asm psraw mm4,4 \ + /*r6=R6=F'-B''*/ \ + __asm psubw mm6,mm5 \ + /*r3=NR3*/ \ + __asm psraw mm3,4 \ + __asm paddw mm6,OC_8 \ + /*r5=B''+B''*/ \ + __asm paddw mm5,mm5 \ + /*r5=R5=F'+B''*/ \ + __asm paddw mm5,mm6 \ + /*r6=NR6*/ \ + __asm psraw mm6,4 \ + /*Store NR4 at J(4).*/ \ + __asm movq OC_J(4),mm4 \ + /*r5=NR5*/ \ + __asm psraw mm5,4 \ + /*Store NR3 at I(3).*/ \ + __asm movq OC_I(3),mm3 \ + /*r7=R7=G'-C'*/ \ + __asm psubw mm7,mm0 \ + __asm paddw mm7,OC_8 \ + /*r0=C'+C'*/ \ + __asm paddw mm0,mm0 \ + /*r0=R0=G'+C'*/ \ + __asm paddw mm0,mm7 \ + /*r7=NR7*/ \ + __asm psraw mm7,4 \ + /*Store NR6 at J(6).*/ \ + __asm movq OC_J(6),mm6 \ + /*r0=NR0*/ \ + __asm psraw mm0,4 \ + /*Store NR5 at J(5).*/ \ + __asm movq OC_J(5),mm5 \ + /*Store NR7 at J(7).*/ \ + __asm movq OC_J(7),mm7 \ + /*Store NR0 at I(0).*/ \ + __asm movq OC_I(0),mm0 \ +} + +static void oc_idct8x8_10(ogg_int16_t _y[64]){ + __asm{ +#define CONSTS eax +#define Y edx + mov CONSTS,offset OC_IDCT_CONSTS + mov Y,_y +#define OC_I(_k) [Y+_k*16] +#define OC_J(_k) [Y+(_k-4)*16+8] + /*Done with dequant, descramble, and partial transpose. + Now do the iDCT itself.*/ + OC_ROW_IDCT_10 + OC_TRANSPOSE +#undef OC_I +#undef OC_J +#define OC_I(_k) [Y+_k*16] +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT_10 +#undef OC_I +#undef OC_J +#define OC_I(_k) [Y+_k*16+8] +#define OC_J(_k) OC_I(_k) + OC_COLUMN_IDCT_10 +#undef OC_I +#undef OC_J +#undef CONSTS +#undef Y + } +} + +/*Performs an inverse 8x8 Type-II DCT transform. + The input is assumed to be scaled by a factor of 4 relative to orthonormal + version of the transform.*/ +void oc_idct8x8_mmx(ogg_int16_t _y[64],int _last_zzi){ + /*_last_zzi is subtly different from an actual count of the number of + coefficients we decoded for this block. + It contains the value of zzi BEFORE the final token in the block was + decoded. + In most cases this is an EOB token (the continuation of an EOB run from a + previous block counts), and so this is the same as the coefficient count. + However, in the case that the last token was NOT an EOB token, but filled + the block up with exactly 64 coefficients, _last_zzi will be less than 64. + Provided the last token was not a pure zero run, the minimum value it can + be is 46, and so that doesn't affect any of the cases in this routine. + However, if the last token WAS a pure zero run of length 63, then _last_zzi + will be 1 while the number of coefficients decoded is 64. + Thus, we will trigger the following special case, where the real + coefficient count would not. + Note also that a zero run of length 64 will give _last_zzi a value of 0, + but we still process the DC coefficient, which might have a non-zero value + due to DC prediction. + Although convoluted, this is arguably the correct behavior: it allows us to + use a smaller transform when the block ends with a long zero run instead + of a normal EOB token. + It could be smarter... multiple separate zero runs at the end of a block + will fool it, but an encoder that generates these really deserves what it + gets. + Needless to say we inherited this approach from VP3.*/ + /*Perform the iDCT.*/ + if(_last_zzi<10)oc_idct8x8_10(_y); + else oc_idct8x8_slow(_y); +} + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxloop.h b/libs/libtheora-1.1/lib/x86_vc/mmxloop.h new file mode 100644 index 00000000..2561fca2 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxloop.h @@ -0,0 +1,219 @@ +#if !defined(_x86_vc_mmxloop_H) +# define _x86_vc_mmxloop_H (1) +# include +# include "x86int.h" + +#if defined(OC_X86_ASM) + +/*On entry, mm0={a0,...,a7}, mm1={b0,...,b7}, mm2={c0,...,c7}, mm3={d0,...d7}. + On exit, mm1={b0+lflim(R_0,L),...,b7+lflim(R_7,L)} and + mm2={c0-lflim(R_0,L),...,c7-lflim(R_7,L)}; mm0 and mm3 are clobbered.*/ +#define OC_LOOP_FILTER8_MMX __asm{ \ + /*mm7=0*/ \ + __asm pxor mm7,mm7 \ + /*mm6:mm0={a0,...,a7}*/ \ + __asm movq mm6,mm0 \ + __asm punpcklbw mm0,mm7 \ + __asm punpckhbw mm6,mm7 \ + /*mm3:mm5={d0,...,d7}*/ \ + __asm movq mm5,mm3 \ + __asm punpcklbw mm3,mm7 \ + __asm punpckhbw mm5,mm7 \ + /*mm6:mm0={a0-d0,...,a7-d7}*/ \ + __asm psubw mm0,mm3 \ + __asm psubw mm6,mm5 \ + /*mm3:mm1={b0,...,b7}*/ \ + __asm movq mm3,mm1 \ + __asm punpcklbw mm1,mm7 \ + __asm movq mm4,mm2 \ + __asm punpckhbw mm3,mm7 \ + /*mm5:mm4={c0,...,c7}*/ \ + __asm movq mm5,mm2 \ + __asm punpcklbw mm4,mm7 \ + __asm punpckhbw mm5,mm7 \ + /*mm7={3}x4 \ + mm5:mm4={c0-b0,...,c7-b7}*/ \ + __asm pcmpeqw mm7,mm7 \ + __asm psubw mm4,mm1 \ + __asm psrlw mm7,14 \ + __asm psubw mm5,mm3 \ + /*Scale by 3.*/ \ + __asm pmullw mm4,mm7 \ + __asm pmullw mm5,mm7 \ + /*mm7={4}x4 \ + mm5:mm4=f={a0-d0+3*(c0-b0),...,a7-d7+3*(c7-b7)}*/ \ + __asm psrlw mm7,1 \ + __asm paddw mm4,mm0 \ + __asm psllw mm7,2 \ + __asm movq mm0,[LL] \ + __asm paddw mm5,mm6 \ + /*R_i has the range [-127,128], so we compute -R_i instead. \ + mm4=-R_i=-(f+4>>3)=0xFF^(f-4>>3)*/ \ + __asm psubw mm4,mm7 \ + __asm psubw mm5,mm7 \ + __asm psraw mm4,3 \ + __asm psraw mm5,3 \ + __asm pcmpeqb mm7,mm7 \ + __asm packsswb mm4,mm5 \ + __asm pxor mm6,mm6 \ + __asm pxor mm4,mm7 \ + __asm packuswb mm1,mm3 \ + /*Now compute lflim of -mm4 cf. Section 7.10 of the sepc.*/ \ + /*There's no unsigned byte+signed byte with unsigned saturation op code, so \ + we have to split things by sign (the other option is to work in 16 bits, \ + but working in 8 bits gives much better parallelism). \ + We compute abs(R_i), but save a mask of which terms were negative in mm6. \ + Then we compute mm4=abs(lflim(R_i,L))=min(abs(R_i),max(2*L-abs(R_i),0)). \ + Finally, we split mm4 into positive and negative pieces using the mask in \ + mm6, and add and subtract them as appropriate.*/ \ + /*mm4=abs(-R_i)*/ \ + /*mm7=255-2*L*/ \ + __asm pcmpgtb mm6,mm4 \ + __asm psubb mm7,mm0 \ + __asm pxor mm4,mm6 \ + __asm psubb mm7,mm0 \ + __asm psubb mm4,mm6 \ + /*mm7=255-max(2*L-abs(R_i),0)*/ \ + __asm paddusb mm7,mm4 \ + /*mm4=min(abs(R_i),max(2*L-abs(R_i),0))*/ \ + __asm paddusb mm4,mm7 \ + __asm psubusb mm4,mm7 \ + /*Now split mm4 by the original sign of -R_i.*/ \ + __asm movq mm5,mm4 \ + __asm pand mm4,mm6 \ + __asm pandn mm6,mm5 \ + /*mm1={b0+lflim(R_0,L),...,b7+lflim(R_7,L)}*/ \ + /*mm2={c0-lflim(R_0,L),...,c7-lflim(R_7,L)}*/ \ + __asm paddusb mm1,mm4 \ + __asm psubusb mm2,mm4 \ + __asm psubusb mm1,mm6 \ + __asm paddusb mm2,mm6 \ +} + +#define OC_LOOP_FILTER_V_MMX(_pix,_ystride,_ll) \ + do{ \ + /*Used local variable pix__ in order to fix compilation errors like: \ + "error C2425: 'SHL' : non-constant expression in 'second operand'".*/ \ + unsigned char *pix__; \ + unsigned char *ll__; \ + ll__=(_ll); \ + pix__=(_pix); \ + __asm mov YSTRIDE,_ystride \ + __asm mov LL,ll__ \ + __asm mov PIX,pix__ \ + __asm sub PIX,YSTRIDE \ + __asm sub PIX,YSTRIDE \ + /*mm0={a0,...,a7}*/ \ + __asm movq mm0,[PIX] \ + /*ystride3=_ystride*3*/ \ + __asm lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] \ + /*mm3={d0,...,d7}*/ \ + __asm movq mm3,[PIX+YSTRIDE3] \ + /*mm1={b0,...,b7}*/ \ + __asm movq mm1,[PIX+YSTRIDE] \ + /*mm2={c0,...,c7}*/ \ + __asm movq mm2,[PIX+YSTRIDE*2] \ + OC_LOOP_FILTER8_MMX \ + /*Write it back out.*/ \ + __asm movq [PIX+YSTRIDE],mm1 \ + __asm movq [PIX+YSTRIDE*2],mm2 \ + } \ + while(0) + +#define OC_LOOP_FILTER_H_MMX(_pix,_ystride,_ll) \ + do{ \ + /*Used local variable ll__ in order to fix compilation errors like: \ + "error C2443: operand size conflict".*/ \ + unsigned char *ll__; \ + unsigned char *pix__; \ + ll__=(_ll); \ + pix__=(_pix)-2; \ + __asm mov PIX,pix__ \ + __asm mov YSTRIDE,_ystride \ + __asm mov LL,ll__ \ + /*x x x x d0 c0 b0 a0*/ \ + __asm movd mm0,[PIX] \ + /*x x x x d1 c1 b1 a1*/ \ + __asm movd mm1,[PIX+YSTRIDE] \ + /*ystride3=_ystride*3*/ \ + __asm lea YSTRIDE3,[YSTRIDE+YSTRIDE*2] \ + /*x x x x d2 c2 b2 a2*/ \ + __asm movd mm2,[PIX+YSTRIDE*2] \ + /*x x x x d3 c3 b3 a3*/ \ + __asm lea D,[PIX+YSTRIDE*4] \ + __asm movd mm3,[PIX+YSTRIDE3] \ + /*x x x x d4 c4 b4 a4*/ \ + __asm movd mm4,[D] \ + /*x x x x d5 c5 b5 a5*/ \ + __asm movd mm5,[D+YSTRIDE] \ + /*x x x x d6 c6 b6 a6*/ \ + __asm movd mm6,[D+YSTRIDE*2] \ + /*x x x x d7 c7 b7 a7*/ \ + __asm movd mm7,[D+YSTRIDE3] \ + /*mm0=d1 d0 c1 c0 b1 b0 a1 a0*/ \ + __asm punpcklbw mm0,mm1 \ + /*mm2=d3 d2 c3 c2 b3 b2 a3 a2*/ \ + __asm punpcklbw mm2,mm3 \ + /*mm3=d1 d0 c1 c0 b1 b0 a1 a0*/ \ + __asm movq mm3,mm0 \ + /*mm0=b3 b2 b1 b0 a3 a2 a1 a0*/ \ + __asm punpcklwd mm0,mm2 \ + /*mm3=d3 d2 d1 d0 c3 c2 c1 c0*/ \ + __asm punpckhwd mm3,mm2 \ + /*mm1=b3 b2 b1 b0 a3 a2 a1 a0*/ \ + __asm movq mm1,mm0 \ + /*mm4=d5 d4 c5 c4 b5 b4 a5 a4*/ \ + __asm punpcklbw mm4,mm5 \ + /*mm6=d7 d6 c7 c6 b7 b6 a7 a6*/ \ + __asm punpcklbw mm6,mm7 \ + /*mm5=d5 d4 c5 c4 b5 b4 a5 a4*/ \ + __asm movq mm5,mm4 \ + /*mm4=b7 b6 b5 b4 a7 a6 a5 a4*/ \ + __asm punpcklwd mm4,mm6 \ + /*mm5=d7 d6 d5 d4 c7 c6 c5 c4*/ \ + __asm punpckhwd mm5,mm6 \ + /*mm2=d3 d2 d1 d0 c3 c2 c1 c0*/ \ + __asm movq mm2,mm3 \ + /*mm0=a7 a6 a5 a4 a3 a2 a1 a0*/ \ + __asm punpckldq mm0,mm4 \ + /*mm1=b7 b6 b5 b4 b3 b2 b1 b0*/ \ + __asm punpckhdq mm1,mm4 \ + /*mm2=c7 c6 c5 c4 c3 c2 c1 c0*/ \ + __asm punpckldq mm2,mm5 \ + /*mm3=d7 d6 d5 d4 d3 d2 d1 d0*/ \ + __asm punpckhdq mm3,mm5 \ + OC_LOOP_FILTER8_MMX \ + /*mm2={b0+R_0'',...,b7+R_7''}*/ \ + __asm movq mm0,mm1 \ + /*mm1={b0+R_0'',c0-R_0'',...,b3+R_3'',c3-R_3''}*/ \ + __asm punpcklbw mm1,mm2 \ + /*mm2={b4+R_4'',c4-R_4'',...,b7+R_7'',c7-R_7''}*/ \ + __asm punpckhbw mm0,mm2 \ + /*[d]=c1 b1 c0 b0*/ \ + __asm movd D,mm1 \ + __asm mov [PIX+1],D_WORD \ + __asm psrlq mm1,32 \ + __asm shr D,16 \ + __asm mov [PIX+YSTRIDE+1],D_WORD \ + /*[d]=c3 b3 c2 b2*/ \ + __asm movd D,mm1 \ + __asm mov [PIX+YSTRIDE*2+1],D_WORD \ + __asm shr D,16 \ + __asm mov [PIX+YSTRIDE3+1],D_WORD \ + __asm lea PIX,[PIX+YSTRIDE*4] \ + /*[d]=c5 b5 c4 b4*/ \ + __asm movd D,mm0 \ + __asm mov [PIX+1],D_WORD \ + __asm psrlq mm0,32 \ + __asm shr D,16 \ + __asm mov [PIX+YSTRIDE+1],D_WORD \ + /*[d]=c7 b7 c6 b6*/ \ + __asm movd D,mm0 \ + __asm mov [PIX+YSTRIDE*2+1],D_WORD \ + __asm shr D,16 \ + __asm mov [PIX+YSTRIDE3+1],D_WORD \ + } \ + while(0) + +# endif +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/mmxstate.c b/libs/libtheora-1.1/lib/x86_vc/mmxstate.c new file mode 100644 index 00000000..fb1eba0f --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/mmxstate.c @@ -0,0 +1,211 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: mmxstate.c 16584 2009-09-26 19:35:55Z tterribe $ + + ********************************************************************/ + +/*MMX acceleration of complete fragment reconstruction algorithm. + Originally written by Rudolf Marek.*/ +#include +#include "x86int.h" +#include "mmxfrag.h" +#include "mmxloop.h" + +#if defined(OC_X86_ASM) + +void oc_state_frag_recon_mmx(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant){ + unsigned char *dst; + ptrdiff_t frag_buf_off; + int ystride; + int mb_mode; + /*Apply the inverse transform.*/ + /*Special case only having a DC component.*/ + if(_last_zzi<2){ + /*Note that this value must be unsigned, to keep the __asm__ block from + sign-extending it when it puts it in a register.*/ + ogg_uint16_t p; + /*We round this dequant product (and not any of the others) because there's + no iDCT rounding.*/ + p=(ogg_int16_t)(_dct_coeffs[0]*(ogg_int32_t)_dc_quant+15>>5); + /*Fill _dct_coeffs with p.*/ + __asm{ +#define Y eax +#define P ecx + mov Y,_dct_coeffs + movzx P,p + /*mm0=0000 0000 0000 AAAA*/ + movd mm0,P + /*mm0=0000 0000 AAAA AAAA*/ + punpcklwd mm0,mm0 + /*mm0=AAAA AAAA AAAA AAAA*/ + punpckldq mm0,mm0 + movq [Y],mm0 + movq [8+Y],mm0 + movq [16+Y],mm0 + movq [24+Y],mm0 + movq [32+Y],mm0 + movq [40+Y],mm0 + movq [48+Y],mm0 + movq [56+Y],mm0 + movq [64+Y],mm0 + movq [72+Y],mm0 + movq [80+Y],mm0 + movq [88+Y],mm0 + movq [96+Y],mm0 + movq [104+Y],mm0 + movq [112+Y],mm0 + movq [120+Y],mm0 +#undef Y +#undef P + } + } + else{ + /*Dequantize the DC coefficient.*/ + _dct_coeffs[0]=(ogg_int16_t)(_dct_coeffs[0]*(int)_dc_quant); + oc_idct8x8_mmx(_dct_coeffs,_last_zzi); + } + /*Fill in the target buffer.*/ + frag_buf_off=_state->frag_buf_offs[_fragi]; + mb_mode=_state->frags[_fragi].mb_mode; + ystride=_state->ref_ystride[_pli]; + dst=_state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_SELF]]+frag_buf_off; + if(mb_mode==OC_MODE_INTRA)oc_frag_recon_intra_mmx(dst,ystride,_dct_coeffs); + else{ + const unsigned char *ref; + int mvoffsets[2]; + ref= + _state->ref_frame_data[_state->ref_frame_idx[OC_FRAME_FOR_MODE(mb_mode)]] + +frag_buf_off; + if(oc_state_get_mv_offsets(_state,mvoffsets,_pli, + _state->frag_mvs[_fragi][0],_state->frag_mvs[_fragi][1])>1){ + oc_frag_recon_inter2_mmx(dst,ref+mvoffsets[0],ref+mvoffsets[1],ystride, + _dct_coeffs); + } + else oc_frag_recon_inter_mmx(dst,ref+mvoffsets[0],ystride,_dct_coeffs); + } +} + +/*We copy these entire function to inline the actual MMX routines so that we + use only a single indirect call.*/ + +/*Copies the fragments specified by the lists of fragment indices from one + frame to another. + _fragis: A pointer to a list of fragment indices. + _nfragis: The number of fragment indices to copy. + _dst_frame: The reference frame to copy to. + _src_frame: The reference frame to copy from. + _pli: The color plane the fragments lie in.*/ +void oc_state_frag_copy_list_mmx(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli){ + const ptrdiff_t *frag_buf_offs; + const unsigned char *src_frame_data; + unsigned char *dst_frame_data; + ptrdiff_t fragii; + int ystride; + dst_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_dst_frame]]; + src_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_src_frame]]; + ystride=_state->ref_ystride[_pli]; + frag_buf_offs=_state->frag_buf_offs; + for(fragii=0;fragii<_nfragis;fragii++){ + ptrdiff_t frag_buf_off; + frag_buf_off=frag_buf_offs[_fragis[fragii]]; +#define SRC edx +#define DST eax +#define YSTRIDE ecx +#define YSTRIDE3 edi + OC_FRAG_COPY_MMX(dst_frame_data+frag_buf_off, + src_frame_data+frag_buf_off,ystride); +#undef SRC +#undef DST +#undef YSTRIDE +#undef YSTRIDE3 + } +} + +/*Apply the loop filter to a given set of fragment rows in the given plane. + The filter may be run on the bottom edge, affecting pixels in the next row of + fragments, so this row also needs to be available. + _bv: The bounding values array. + _refi: The index of the frame buffer to filter. + _pli: The color plane to filter. + _fragy0: The Y coordinate of the first fragment row to filter. + _fragy_end: The Y coordinate of the fragment row to stop filtering at.*/ +void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end){ + OC_ALIGN8(unsigned char ll[8]); + const oc_fragment_plane *fplane; + const oc_fragment *frags; + const ptrdiff_t *frag_buf_offs; + unsigned char *ref_frame_data; + ptrdiff_t fragi_top; + ptrdiff_t fragi_bot; + ptrdiff_t fragi0; + ptrdiff_t fragi0_end; + int ystride; + int nhfrags; + memset(ll,_state->loop_filter_limits[_state->qis[0]],sizeof(ll)); + fplane=_state->fplanes+_pli; + nhfrags=fplane->nhfrags; + fragi_top=fplane->froffset; + fragi_bot=fragi_top+fplane->nfrags; + fragi0=fragi_top+_fragy0*(ptrdiff_t)nhfrags; + fragi0_end=fragi0+(_fragy_end-_fragy0)*(ptrdiff_t)nhfrags; + ystride=_state->ref_ystride[_pli]; + frags=_state->frags; + frag_buf_offs=_state->frag_buf_offs; + ref_frame_data=_state->ref_frame_data[_refi]; + /*The following loops are constructed somewhat non-intuitively on purpose. + The main idea is: if a block boundary has at least one coded fragment on + it, the filter is applied to it. + However, the order that the filters are applied in matters, and VP3 chose + the somewhat strange ordering used below.*/ + while(fragi0fragi0)OC_LOOP_FILTER_H_MMX(ref,ystride,ll); + if(fragi0>fragi_top)OC_LOOP_FILTER_V_MMX(ref,ystride,ll); + if(fragi+1opt_vtable.frag_sub=oc_enc_frag_sub_mmx; + _enc->opt_vtable.frag_sub_128=oc_enc_frag_sub_128_mmx; + _enc->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx; + _enc->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx; + _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_mmx; + } + if(cpu_flags&OC_CPU_X86_MMXEXT){ + _enc->opt_vtable.frag_sad=oc_enc_frag_sad_mmxext; + _enc->opt_vtable.frag_sad_thresh=oc_enc_frag_sad_thresh_mmxext; + _enc->opt_vtable.frag_sad2_thresh=oc_enc_frag_sad2_thresh_mmxext; + _enc->opt_vtable.frag_satd_thresh=oc_enc_frag_satd_thresh_mmxext; + _enc->opt_vtable.frag_satd2_thresh=oc_enc_frag_satd2_thresh_mmxext; + _enc->opt_vtable.frag_intra_satd=oc_enc_frag_intra_satd_mmxext; + _enc->opt_vtable.frag_copy2=oc_enc_frag_copy2_mmxext; + } + if(cpu_flags&OC_CPU_X86_SSE2){ +# if defined(OC_X86_64_ASM) + _enc->opt_vtable.fdct8x8=oc_enc_fdct8x8_x86_64sse2; +# endif + } +} +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/x86enc.h b/libs/libtheora-1.1/lib/x86_vc/x86enc.h new file mode 100644 index 00000000..58148464 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/x86enc.h @@ -0,0 +1,47 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86int.h 15675 2009-02-06 09:43:27Z tterribe $ + + ********************************************************************/ + +#if !defined(_x86_vc_x86enc_H) +# define _x86_vc_x86enc_H (1) +# include "../encint.h" +# include "x86int.h" + +void oc_enc_vtable_init_x86(oc_enc_ctx *_enc); + +unsigned oc_enc_frag_sad_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride); +unsigned oc_enc_frag_sad_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_sad2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_satd_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref,int _ystride,unsigned _thresh); +unsigned oc_enc_frag_satd2_thresh_mmxext(const unsigned char *_src, + const unsigned char *_ref1,const unsigned char *_ref2,int _ystride, + unsigned _thresh); +unsigned oc_enc_frag_intra_satd_mmxext(const unsigned char *_src,int _ystride); +void oc_enc_frag_sub_mmx(ogg_int16_t _diff[64], + const unsigned char *_x,const unsigned char *_y,int _stride); +void oc_enc_frag_sub_128_mmx(ogg_int16_t _diff[64], + const unsigned char *_x,int _stride); +void oc_enc_frag_copy2_mmxext(unsigned char *_dst, + const unsigned char *_src1,const unsigned char *_src2,int _ystride); +void oc_enc_fdct8x8_mmx(ogg_int16_t _y[64],const ogg_int16_t _x[64]); +void oc_enc_fdct8x8_x86_64sse2(ogg_int16_t _y[64],const ogg_int16_t _x[64]); + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/x86int.h b/libs/libtheora-1.1/lib/x86_vc/x86int.h new file mode 100644 index 00000000..5acabbc0 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/x86int.h @@ -0,0 +1,42 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86int.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#if !defined(_x86_vc_x86int_H) +# define _x86_vc_x86int_H (1) +# include "../internal.h" + +void oc_state_vtable_init_x86(oc_theora_state *_state); + +void oc_frag_copy_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride); +void oc_frag_recon_intra_mmx(unsigned char *_dst,int _ystride, + const ogg_int16_t *_residue); +void oc_frag_recon_inter_mmx(unsigned char *_dst, + const unsigned char *_src,int _ystride,const ogg_int16_t *_residue); +void oc_frag_recon_inter2_mmx(unsigned char *_dst,const unsigned char *_src1, + const unsigned char *_src2,int _ystride,const ogg_int16_t *_residue); +void oc_idct8x8_mmx(ogg_int16_t _y[64],int _last_zzi); +void oc_state_frag_recon_mmx(const oc_theora_state *_state,ptrdiff_t _fragi, + int _pli,ogg_int16_t _dct_coeffs[64],int _last_zzi,ogg_uint16_t _dc_quant); +void oc_state_frag_copy_list_mmx(const oc_theora_state *_state, + const ptrdiff_t *_fragis,ptrdiff_t _nfragis, + int _dst_frame,int _src_frame,int _pli); +void oc_state_loop_filter_frag_rows_mmx(const oc_theora_state *_state, + int _bv[256],int _refi,int _pli,int _fragy0,int _fragy_end); +void oc_restore_fpu_mmx(void); + +#endif diff --git a/libs/libtheora-1.1/lib/x86_vc/x86state.c b/libs/libtheora-1.1/lib/x86_vc/x86state.c new file mode 100644 index 00000000..8450b644 --- /dev/null +++ b/libs/libtheora-1.1/lib/x86_vc/x86state.c @@ -0,0 +1,62 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * + * * + ******************************************************************** + + function: + last mod: $Id: x86state.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include "x86int.h" + +#if defined(OC_X86_ASM) + +#include "../cpu.c" + +/*This table has been modified from OC_FZIG_ZAG by baking a 4x4 transpose into + each quadrant of the destination.*/ +static const unsigned char OC_FZIG_ZAG_MMX[128]={ + 0, 8, 1, 2, 9,16,24,17, + 10, 3,32,11,18,25, 4,12, + 5,26,19,40,33,34,41,48, + 27, 6,13,20,28,21,14, 7, + 56,49,42,35,43,50,57,36, + 15,22,29,30,23,44,37,58, + 51,59,38,45,52,31,60,53, + 46,39,47,54,61,62,55,63, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, + 64,64,64,64,64,64,64,64, +}; + +void oc_state_vtable_init_x86(oc_theora_state *_state){ + _state->cpu_flags=oc_cpu_flags_get(); + if(_state->cpu_flags&OC_CPU_X86_MMX){ + _state->opt_vtable.frag_copy=oc_frag_copy_mmx; + _state->opt_vtable.frag_recon_intra=oc_frag_recon_intra_mmx; + _state->opt_vtable.frag_recon_inter=oc_frag_recon_inter_mmx; + _state->opt_vtable.frag_recon_inter2=oc_frag_recon_inter2_mmx; + _state->opt_vtable.idct8x8=oc_idct8x8_mmx; + _state->opt_vtable.state_frag_recon=oc_state_frag_recon_mmx; + _state->opt_vtable.state_frag_copy_list=oc_state_frag_copy_list_mmx; + _state->opt_vtable.state_loop_filter_frag_rows= + oc_state_loop_filter_frag_rows_mmx; + _state->opt_vtable.restore_fpu=oc_restore_fpu_mmx; + _state->opt_data.dct_fzig_zag=OC_FZIG_ZAG_MMX; + } + else oc_state_vtable_init_c(_state); +} +#endif diff --git a/libs/libtheora-1.1/libtheora.spec.in b/libs/libtheora-1.1/libtheora.spec.in new file mode 100644 index 00000000..798ff98b --- /dev/null +++ b/libs/libtheora-1.1/libtheora.spec.in @@ -0,0 +1,82 @@ +Name: libtheora +Version: @VERSION@ +Release: 0.xiph.0.4.alpha5 +Summary: The Theora Video Compression Codec. + +Group: System Environment/Libraries +License: BSD +URL: http://www.theora.org/ +Vendor: Xiph.org Foundation +Source: http://downloads.xiph.org/releases/theora/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +BuildRequires: libogg-devel >= 2:1.1 +BuildRequires: libvorbis-devel >= 1:1.0.1 +BuildRequires: SDL-devel + +# this needs to be explicit since vorbis's .so versioning didn't get bumped +# when going from 1.0 to 1.0.1 +Requires: libvorbis >= 1:1.0.1 + +%description +Theora is Xiph.Org's first publicly released video codec, intended +for use within the Ogg's project's Ogg multimedia streaming system. +Theora is derived directly from On2's VP3 codec; Currently the two are +nearly identical, varying only in encapsulating decoder tables in the +bitstream headers, but Theora will make use of this extra freedom +in the future to improve over what is possible with VP3. + +%package devel +Summary: Development tools for Theora applications. +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: libogg-devel >= 2:1.1 + +%description devel +The libtheora-devel package contains the header files and documentation +needed to develop applications with Ogg Theora. + +%prep +%setup -q -n %{name}-%{version} + +%build +%configure --enable-shared +make + +%install +rm -rf $RPM_BUILD_ROOT +# make sure our temp doc build dir is removed +rm -rf $(pwd)/__docs + +%makeinstall docdir=$(pwd)/__docs + +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc COPYING README +%{_libdir}/libtheora.so.* + +%files devel +%defattr(-,root,root,-) +%doc __docs/* +%{_libdir}/libtheora.a +%{_libdir}/libtheora.so +%dir %{_includedir}/theora +%{_includedir}/theora/codec.h +%{_includedir}/theora/theora.h +%{_includedir}/theora/theoradec.h +%{_libdir}/pkgconfig/theora.pc + +%changelog +* Sat Aug 20 2005 Ralph Giles +- updated version for 1.0alpha5 release +* Thu Jun 10 2004 Thomas Vander Stichele +- transported fedora.us spec file diff --git a/libs/libtheora-1.1/m4/Makefile.am b/libs/libtheora-1.1/m4/Makefile.am new file mode 100644 index 00000000..51d571f7 --- /dev/null +++ b/libs/libtheora-1.1/m4/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = \ + as-ac-expand.m4 \ + ogg.m4 \ + pkg.m4 \ + sdl.m4 \ + vorbis.m4 diff --git a/libs/libtheora-1.1/m4/as-ac-expand.m4 b/libs/libtheora-1.1/m4/as-ac-expand.m4 new file mode 100644 index 00000000..d6c9e330 --- /dev/null +++ b/libs/libtheora-1.1/m4/as-ac-expand.m4 @@ -0,0 +1,43 @@ +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/libs/libtheora-1.1/m4/ogg.m4 b/libs/libtheora-1.1/m4/ogg.m4 new file mode 100644 index 00000000..db91a6d8 --- /dev/null +++ b/libs/libtheora-1.1/m4/ogg.m4 @@ -0,0 +1,116 @@ +# Configure paths for libogg +# Jack Moffitt 10-21-2000 +# Shamelessly stolen from Owen Taylor and Manish Singh + +dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS +dnl +AC_DEFUN([XIPH_PATH_OGG], +[dnl +dnl Get the cflags and libraries +dnl +AC_ARG_WITH(ogg,AC_HELP_STRING([--with-ogg=PFX],[Prefix where libogg is installed (optional)]), ogg_prefix="$withval", ogg_prefix="") +AC_ARG_WITH(ogg-libraries,AC_HELP_STRING([--with-ogg-libraries=DIR],[Directory where libogg library is installed (optional)]), ogg_libraries="$withval", ogg_libraries="") +AC_ARG_WITH(ogg-includes,AC_HELP_STRING([--with-ogg-includes=DIR],[Directory where libogg header files are installed (optional)]), ogg_includes="$withval", ogg_includes="") +AC_ARG_ENABLE(oggtest,AC_HELP_STRING([--disable-oggtest],[Do not try to compile and run a test Ogg program]),, enable_oggtest=yes) + + if test "x$ogg_libraries" != "x" ; then + OGG_LIBS="-L$ogg_libraries" + elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then + OGG_LIBS="" + elif test "x$ogg_prefix" != "x" ; then + OGG_LIBS="-L$ogg_prefix/lib" + elif test "x$prefix" != "xNONE" ; then + OGG_LIBS="-L$libdir" + fi + + if test "x$ogg_prefix" != "xno" ; then + OGG_LIBS="$OGG_LIBS -logg" + fi + + if test "x$ogg_includes" != "x" ; then + OGG_CFLAGS="-I$ogg_includes" + elif test "x$ogg_prefix" = "xno" || test "x$ogg_prefix" = "xyes" ; then + OGG_CFLAGS="" + elif test "x$ogg_prefix" != "x" ; then + OGG_CFLAGS="-I$ogg_prefix/include" + elif test "x$prefix" != "xNONE"; then + OGG_CFLAGS="" + fi + + AC_MSG_CHECKING(for Ogg) + if test "x$ogg_prefix" = "xno" ; then + no_ogg="disabled" + enable_oggtest="no" + else + no_ogg="" + fi + + + if test "x$enable_oggtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" +dnl +dnl Now check if the installed Ogg is sufficiently new. +dnl + rm -f conf.oggtest + AC_TRY_RUN([ +#include +#include +#include +#include + +int main () +{ + system("touch conf.oggtest"); + return 0; +} + +],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_ogg" = "xdisabled" ; then + AC_MSG_RESULT(no) + ifelse([$2], , :, [$2]) + elif test "x$no_ogg" = "x" ; then + AC_MSG_RESULT(yes) + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT(no) + if test -f conf.oggtest ; then + : + else + echo "*** Could not run Ogg test program, checking why..." + CFLAGS="$CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $OGG_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Ogg or finding the wrong" + echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Ogg was incorrectly installed" + echo "*** or that you have moved Ogg since it was installed." ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + OGG_CFLAGS="" + OGG_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(OGG_CFLAGS) + AC_SUBST(OGG_LIBS) + rm -f conf.oggtest +]) diff --git a/libs/libtheora-1.1/m4/pkg.m4 b/libs/libtheora-1.1/m4/pkg.m4 new file mode 100644 index 00000000..996e2945 --- /dev/null +++ b/libs/libtheora-1.1/m4/pkg.m4 @@ -0,0 +1,157 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# 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 .])], + [$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/libs/libtheora-1.1/m4/sdl.m4 b/libs/libtheora-1.1/m4/sdl.m4 new file mode 100644 index 00000000..f5fb1f4d --- /dev/null +++ b/libs/libtheora-1.1/m4/sdl.m4 @@ -0,0 +1,180 @@ +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN([AM_PATH_SDL], +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) diff --git a/libs/libtheora-1.1/m4/vorbis.m4 b/libs/libtheora-1.1/m4/vorbis.m4 new file mode 100644 index 00000000..69715a7d --- /dev/null +++ b/libs/libtheora-1.1/m4/vorbis.m4 @@ -0,0 +1,122 @@ +# Configure paths for libvorbis +# Jack Moffitt 10-21-2000 +# Shamelessly stolen from Owen Taylor and Manish Singh +# thomasvs added check for vorbis_bitrate_addblock which is new in rc3 + +dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS +dnl +AC_DEFUN([XIPH_PATH_VORBIS], +[dnl +dnl Get the cflags and libraries +dnl +AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="") +AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="") +AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="") +AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes) + + if test "x$vorbis_libraries" != "x" ; then + VORBIS_LIBS="-L$vorbis_libraries" + elif test "x$vorbis_prefix" != "x" ; then + VORBIS_LIBS="-L$vorbis_prefix/lib" + elif test "x$prefix" != "xNONE"; then + VORBIS_LIBS="-L$libdir" + fi + + VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm" + VORBISFILE_LIBS="-lvorbisfile" + VORBISENC_LIBS="-lvorbisenc" + + if test "x$vorbis_includes" != "x" ; then + VORBIS_CFLAGS="-I$vorbis_includes" + elif test "x$vorbis_prefix" != "x" ; then + VORBIS_CFLAGS="-I$vorbis_prefix/include" + elif test "x$prefix" != "xNONE"; then + VORBIS_CFLAGS="" + fi + + + AC_MSG_CHECKING(for Vorbis) + no_vorbis="" + + + if test "x$enable_vorbistest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS" +dnl +dnl Now check if the installed Vorbis is sufficiently new. +dnl + rm -f conf.vorbistest + AC_TRY_RUN([ +#include +#include +#include +#include +#include + +int main () +{ + vorbis_block vb; + vorbis_dsp_state vd; + vorbis_info vi; + + vorbis_info_init (&vi); + vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1); + vorbis_analysis_init (&vd, &vi); + vorbis_block_init (&vd, &vb); + /* this function was added in 1.0rc3, so this is what we're testing for */ + vorbis_bitrate_addblock (&vb); + + system("touch conf.vorbistest"); + return 0; +} + +],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + + if test "x$no_vorbis" = "x" ; then + AC_MSG_RESULT(yes) + ifelse([$1], , :, [$1]) + else + AC_MSG_RESULT(no) + if test -f conf.vorbistest ; then + : + else + echo "*** Could not run Vorbis test program, checking why..." + CFLAGS="$CFLAGS $VORBIS_CFLAGS" + LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding Vorbis or finding the wrong" + echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means Vorbis was incorrectly installed" + echo "*** or that you have moved Vorbis since it was installed." ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + VORBIS_CFLAGS="" + VORBIS_LIBS="" + VORBISFILE_LIBS="" + VORBISENC_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(VORBIS_CFLAGS) + AC_SUBST(VORBIS_LIBS) + AC_SUBST(VORBISFILE_LIBS) + AC_SUBST(VORBISENC_LIBS) + rm -f conf.vorbistest +]) diff --git a/libs/libtheora-1.1/macosx/English.lproj/InfoPlist.strings b/libs/libtheora-1.1/macosx/English.lproj/InfoPlist.strings new file mode 100644 index 0000000000000000000000000000000000000000..e5964ff905b6b962803a0b21997fa55fb0135b09 GIT binary patch literal 142 zcmW-a%?g5G5Jk`0r}%K`A|D{!6a+%J@&&{nipnptf_ixMAj8a^dpXR^3pp8qGm(~t zJ6HbnbY@@m#bgp0)u0Z}Qa8Bocy9c}+w>;=+o;T&iFM?}fsb@2*Hd}_p#};&rRJiG J{%CZ2k` + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + Theora + CFBundleGetInfoString + Theora framework 1.1alpha1svn, Copyright © 2002-2009Xiph.Org Foundation + CFBundleIconFile + + CFBundleIdentifier + org.xiph.theora + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + FMWK + CFBundleSignature + ???? + CFBundleVersion + 1.0d6 + CFBundleShortVersionString + 1.1alpha1svn + NSHumanReadableCopyright + Theora framework 1.1alpha1svn, Copyright © 2002-2009Xiph.Org Foundation + CSResourcesFileMapped + + + diff --git a/libs/libtheora-1.1/macosx/Theora.xcodeproj/project.pbxproj b/libs/libtheora-1.1/macosx/Theora.xcodeproj/project.pbxproj new file mode 100644 index 00000000..380245f4 --- /dev/null +++ b/libs/libtheora-1.1/macosx/Theora.xcodeproj/project.pbxproj @@ -0,0 +1,864 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 084C31FE0FE4E5BD00117FC9 /* apiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31D90FE4E5BD00117FC9 /* apiwrapper.c */; }; + 084C31FF0FE4E5BD00117FC9 /* apiwrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DA0FE4E5BD00117FC9 /* apiwrapper.h */; }; + 084C32000FE4E5BD00117FC9 /* bitpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DB0FE4E5BD00117FC9 /* bitpack.c */; }; + 084C32010FE4E5BD00117FC9 /* bitpack.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DC0FE4E5BD00117FC9 /* bitpack.h */; }; + 084C32020FE4E5BD00117FC9 /* dct.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DD0FE4E5BD00117FC9 /* dct.h */; }; + 084C32030FE4E5BD00117FC9 /* decapiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DE0FE4E5BD00117FC9 /* decapiwrapper.c */; }; + 084C32040FE4E5BD00117FC9 /* decinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DF0FE4E5BD00117FC9 /* decinfo.c */; }; + 084C32050FE4E5BD00117FC9 /* decint.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E00FE4E5BD00117FC9 /* decint.h */; }; + 084C32060FE4E5BD00117FC9 /* decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E10FE4E5BD00117FC9 /* decode.c */; }; + 084C32070FE4E5BD00117FC9 /* dequant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E20FE4E5BD00117FC9 /* dequant.c */; }; + 084C32080FE4E5BD00117FC9 /* dequant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E30FE4E5BD00117FC9 /* dequant.h */; }; + 084C32090FE4E5BD00117FC9 /* fragment.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E40FE4E5BD00117FC9 /* fragment.c */; }; + 084C320A0FE4E5BD00117FC9 /* huffdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E50FE4E5BD00117FC9 /* huffdec.c */; }; + 084C320B0FE4E5BD00117FC9 /* huffdec.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E60FE4E5BD00117FC9 /* huffdec.h */; }; + 084C320C0FE4E5BD00117FC9 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E70FE4E5BD00117FC9 /* huffman.h */; }; + 084C320D0FE4E5BD00117FC9 /* idct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E80FE4E5BD00117FC9 /* idct.c */; }; + 084C320E0FE4E5BD00117FC9 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E90FE4E5BD00117FC9 /* info.c */; }; + 084C320F0FE4E5BD00117FC9 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EA0FE4E5BD00117FC9 /* internal.c */; }; + 084C32100FE4E5BD00117FC9 /* ocintrin.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31EB0FE4E5BD00117FC9 /* ocintrin.h */; }; + 084C32110FE4E5BD00117FC9 /* quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EC0FE4E5BD00117FC9 /* quant.c */; }; + 084C32120FE4E5BD00117FC9 /* quant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31ED0FE4E5BD00117FC9 /* quant.h */; }; + 084C32130FE4E5BD00117FC9 /* state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EE0FE4E5BD00117FC9 /* state.c */; }; + 084C32140FE4E5BD00117FC9 /* mmxfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F00FE4E5BD00117FC9 /* mmxfrag.c */; }; + 084C32150FE4E5BD00117FC9 /* mmxfrag.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F10FE4E5BD00117FC9 /* mmxfrag.h */; }; + 084C32160FE4E5BD00117FC9 /* mmxidct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F20FE4E5BD00117FC9 /* mmxidct.c */; }; + 084C32170FE4E5BD00117FC9 /* mmxloop.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F30FE4E5BD00117FC9 /* mmxloop.h */; }; + 084C32180FE4E5BD00117FC9 /* mmxstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F40FE4E5BD00117FC9 /* mmxstate.c */; }; + 084C32190FE4E5BD00117FC9 /* x86int.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F50FE4E5BD00117FC9 /* x86int.h */; }; + 084C321A0FE4E5BD00117FC9 /* x86state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F60FE4E5BD00117FC9 /* x86state.c */; }; + 084C32210FE4E5BD00117FC9 /* apiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31D90FE4E5BD00117FC9 /* apiwrapper.c */; }; + 084C32220FE4E5BD00117FC9 /* apiwrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DA0FE4E5BD00117FC9 /* apiwrapper.h */; }; + 084C32230FE4E5BD00117FC9 /* bitpack.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DB0FE4E5BD00117FC9 /* bitpack.c */; }; + 084C32240FE4E5BD00117FC9 /* bitpack.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DC0FE4E5BD00117FC9 /* bitpack.h */; }; + 084C32250FE4E5BD00117FC9 /* dct.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DD0FE4E5BD00117FC9 /* dct.h */; }; + 084C32260FE4E5BD00117FC9 /* decapiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DE0FE4E5BD00117FC9 /* decapiwrapper.c */; }; + 084C32270FE4E5BD00117FC9 /* decinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31DF0FE4E5BD00117FC9 /* decinfo.c */; }; + 084C32280FE4E5BD00117FC9 /* decint.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E00FE4E5BD00117FC9 /* decint.h */; }; + 084C32290FE4E5BD00117FC9 /* decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E10FE4E5BD00117FC9 /* decode.c */; }; + 084C322A0FE4E5BD00117FC9 /* dequant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E20FE4E5BD00117FC9 /* dequant.c */; }; + 084C322B0FE4E5BD00117FC9 /* dequant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E30FE4E5BD00117FC9 /* dequant.h */; }; + 084C322C0FE4E5BD00117FC9 /* fragment.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E40FE4E5BD00117FC9 /* fragment.c */; }; + 084C322D0FE4E5BD00117FC9 /* huffdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E50FE4E5BD00117FC9 /* huffdec.c */; }; + 084C322E0FE4E5BD00117FC9 /* huffdec.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E60FE4E5BD00117FC9 /* huffdec.h */; }; + 084C322F0FE4E5BD00117FC9 /* huffman.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31E70FE4E5BD00117FC9 /* huffman.h */; }; + 084C32300FE4E5BD00117FC9 /* idct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E80FE4E5BD00117FC9 /* idct.c */; }; + 084C32310FE4E5BD00117FC9 /* info.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E90FE4E5BD00117FC9 /* info.c */; }; + 084C32320FE4E5BD00117FC9 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EA0FE4E5BD00117FC9 /* internal.c */; }; + 084C32330FE4E5BD00117FC9 /* ocintrin.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31EB0FE4E5BD00117FC9 /* ocintrin.h */; }; + 084C32340FE4E5BD00117FC9 /* quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EC0FE4E5BD00117FC9 /* quant.c */; }; + 084C32350FE4E5BD00117FC9 /* quant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31ED0FE4E5BD00117FC9 /* quant.h */; }; + 084C32360FE4E5BD00117FC9 /* state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EE0FE4E5BD00117FC9 /* state.c */; }; + 084C32370FE4E5BD00117FC9 /* mmxfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F00FE4E5BD00117FC9 /* mmxfrag.c */; }; + 084C32380FE4E5BD00117FC9 /* mmxfrag.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F10FE4E5BD00117FC9 /* mmxfrag.h */; }; + 084C32390FE4E5BD00117FC9 /* mmxidct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F20FE4E5BD00117FC9 /* mmxidct.c */; }; + 084C323A0FE4E5BD00117FC9 /* mmxloop.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F30FE4E5BD00117FC9 /* mmxloop.h */; }; + 084C323B0FE4E5BD00117FC9 /* mmxstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F40FE4E5BD00117FC9 /* mmxstate.c */; }; + 084C323C0FE4E5BD00117FC9 /* x86int.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F50FE4E5BD00117FC9 /* x86int.h */; }; + 084C323D0FE4E5BD00117FC9 /* x86state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F60FE4E5BD00117FC9 /* x86state.c */; }; + 084C32620FE4E5D500117FC9 /* analyze.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32450FE4E5D500117FC9 /* analyze.c */; }; + 084C32630FE4E5D500117FC9 /* encapiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32460FE4E5D500117FC9 /* encapiwrapper.c */; }; + 084C32640FE4E5D500117FC9 /* encfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32470FE4E5D500117FC9 /* encfrag.c */; }; + 084C32650FE4E5D500117FC9 /* encinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32480FE4E5D500117FC9 /* encinfo.c */; }; + 084C32660FE4E5D500117FC9 /* encint.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32490FE4E5D500117FC9 /* encint.h */; }; + 084C32670FE4E5D500117FC9 /* encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324A0FE4E5D500117FC9 /* encode.c */; }; + 084C32690FE4E5D500117FC9 /* enquant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324C0FE4E5D500117FC9 /* enquant.c */; }; + 084C326A0FE4E5D500117FC9 /* enquant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C324D0FE4E5D500117FC9 /* enquant.h */; }; + 084C326B0FE4E5D500117FC9 /* fdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324E0FE4E5D500117FC9 /* fdct.c */; }; + 084C326C0FE4E5D500117FC9 /* huffenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324F0FE4E5D500117FC9 /* huffenc.c */; }; + 084C326D0FE4E5D500117FC9 /* huffenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32500FE4E5D500117FC9 /* huffenc.h */; }; + 084C326E0FE4E5D500117FC9 /* mathops.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32510FE4E5D500117FC9 /* mathops.c */; }; + 084C326F0FE4E5D500117FC9 /* mathops.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32520FE4E5D500117FC9 /* mathops.h */; }; + 084C32700FE4E5D500117FC9 /* mcenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32530FE4E5D500117FC9 /* mcenc.c */; }; + 084C32710FE4E5D500117FC9 /* modedec.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32540FE4E5D500117FC9 /* modedec.h */; }; + 084C32720FE4E5D500117FC9 /* rate.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32550FE4E5D500117FC9 /* rate.c */; }; + 084C32730FE4E5D500117FC9 /* tokenize.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32560FE4E5D500117FC9 /* tokenize.c */; }; + 084C32750FE4E5D500117FC9 /* mmxencfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32590FE4E5D500117FC9 /* mmxencfrag.c */; }; + 084C32760FE4E5D500117FC9 /* mmxfdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325A0FE4E5D500117FC9 /* mmxfdct.c */; }; + 084C32770FE4E5D500117FC9 /* sse2fdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325B0FE4E5D500117FC9 /* sse2fdct.c */; }; + 084C32780FE4E5D500117FC9 /* x86enc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325C0FE4E5D500117FC9 /* x86enc.c */; }; + 084C32790FE4E5D500117FC9 /* x86enc.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C325D0FE4E5D500117FC9 /* x86enc.h */; }; + 084C327D0FE4E5D500117FC9 /* analyze.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32450FE4E5D500117FC9 /* analyze.c */; }; + 084C327E0FE4E5D500117FC9 /* encapiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32460FE4E5D500117FC9 /* encapiwrapper.c */; }; + 084C327F0FE4E5D500117FC9 /* encfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32470FE4E5D500117FC9 /* encfrag.c */; }; + 084C32800FE4E5D500117FC9 /* encinfo.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32480FE4E5D500117FC9 /* encinfo.c */; }; + 084C32810FE4E5D500117FC9 /* encint.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32490FE4E5D500117FC9 /* encint.h */; }; + 084C32820FE4E5D500117FC9 /* encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324A0FE4E5D500117FC9 /* encode.c */; }; + 084C32840FE4E5D500117FC9 /* enquant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324C0FE4E5D500117FC9 /* enquant.c */; }; + 084C32850FE4E5D500117FC9 /* enquant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C324D0FE4E5D500117FC9 /* enquant.h */; }; + 084C32860FE4E5D500117FC9 /* fdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324E0FE4E5D500117FC9 /* fdct.c */; }; + 084C32870FE4E5D500117FC9 /* huffenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C324F0FE4E5D500117FC9 /* huffenc.c */; }; + 084C32880FE4E5D500117FC9 /* huffenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32500FE4E5D500117FC9 /* huffenc.h */; }; + 084C32890FE4E5D500117FC9 /* mathops.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32510FE4E5D500117FC9 /* mathops.c */; }; + 084C328A0FE4E5D500117FC9 /* mathops.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32520FE4E5D500117FC9 /* mathops.h */; }; + 084C328B0FE4E5D500117FC9 /* mcenc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32530FE4E5D500117FC9 /* mcenc.c */; }; + 084C328C0FE4E5D500117FC9 /* modedec.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C32540FE4E5D500117FC9 /* modedec.h */; }; + 084C328D0FE4E5D500117FC9 /* rate.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32550FE4E5D500117FC9 /* rate.c */; }; + 084C328E0FE4E5D500117FC9 /* tokenize.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32560FE4E5D500117FC9 /* tokenize.c */; }; + 084C32900FE4E5D500117FC9 /* mmxencfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C32590FE4E5D500117FC9 /* mmxencfrag.c */; }; + 084C32910FE4E5D500117FC9 /* mmxfdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325A0FE4E5D500117FC9 /* mmxfdct.c */; }; + 084C32920FE4E5D500117FC9 /* sse2fdct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325B0FE4E5D500117FC9 /* sse2fdct.c */; }; + 084C32930FE4E5D500117FC9 /* x86enc.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C325C0FE4E5D500117FC9 /* x86enc.c */; }; + 084C32940FE4E5D500117FC9 /* x86enc.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C325D0FE4E5D500117FC9 /* x86enc.h */; }; + 084C32A70FE4E7FE00117FC9 /* apiwrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31D90FE4E5BD00117FC9 /* apiwrapper.c */; }; + 084C32A80FE4E7FF00117FC9 /* apiwrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DA0FE4E5BD00117FC9 /* apiwrapper.h */; }; + 084C32A90FE4E82500117FC9 /* dct.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31DD0FE4E5BD00117FC9 /* dct.h */; }; + 084C32AA0FE4E83100117FC9 /* idct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E80FE4E5BD00117FC9 /* idct.c */; }; + 084C32AB0FE4E83300117FC9 /* internal.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EA0FE4E5BD00117FC9 /* internal.c */; }; + 084C32AC0FE4E83600117FC9 /* fragment.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31E40FE4E5BD00117FC9 /* fragment.c */; }; + 084C32AD0FE4E84800117FC9 /* quant.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31ED0FE4E5BD00117FC9 /* quant.h */; }; + 084C32AE0FE4E84A00117FC9 /* quant.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EC0FE4E5BD00117FC9 /* quant.c */; }; + 084C32AF0FE4E84C00117FC9 /* ocintrin.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31EB0FE4E5BD00117FC9 /* ocintrin.h */; }; + 084C32B00FE4E84F00117FC9 /* state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31EE0FE4E5BD00117FC9 /* state.c */; }; + 084C32B10FE4E85300117FC9 /* x86int.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F50FE4E5BD00117FC9 /* x86int.h */; }; + 084C32B20FE4E85300117FC9 /* x86state.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F60FE4E5BD00117FC9 /* x86state.c */; }; + 084C32B30FE4E85D00117FC9 /* mmxstate.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F40FE4E5BD00117FC9 /* mmxstate.c */; }; + 084C32B40FE4E86A00117FC9 /* mmxfrag.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F00FE4E5BD00117FC9 /* mmxfrag.c */; }; + 084C32B50FE4E86B00117FC9 /* mmxfrag.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F10FE4E5BD00117FC9 /* mmxfrag.h */; }; + 084C32B60FE4E87200117FC9 /* mmxidct.c in Sources */ = {isa = PBXBuildFile; fileRef = 084C31F20FE4E5BD00117FC9 /* mmxidct.c */; }; + 084C32B70FE4E88300117FC9 /* mmxloop.h in Headers */ = {isa = PBXBuildFile; fileRef = 084C31F30FE4E5BD00117FC9 /* mmxloop.h */; }; + 097729950BCAC60000303091 /* codec.h in Headers */ = {isa = PBXBuildFile; fileRef = 097729930BCAC60000303091 /* codec.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 097729960BCAC60000303091 /* theoradec.h in Headers */ = {isa = PBXBuildFile; fileRef = 097729940BCAC60000303091 /* theoradec.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37C9B0140EBB831F0046849C /* theoraenc.h in Headers */ = {isa = PBXBuildFile; fileRef = 37C9B0130EBB831F0046849C /* theoraenc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37CA8E390DD747F1005C8CB6 /* internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 37CA8E380DD747F1005C8CB6 /* internal.h */; }; + 734A751909D76ADD002D8FAE /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 734A751809D76ADD002D8FAE /* Ogg.framework */; }; + 734A75BF09D76BB9002D8FAE /* theora.h in Headers */ = {isa = PBXBuildFile; fileRef = 734A75BE09D76BB9002D8FAE /* theora.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 73514EC90B0C7E5700CEC060 /* cpu.h in Headers */ = {isa = PBXBuildFile; fileRef = 73514EC70B0C7E5700CEC060 /* cpu.h */; }; + 8D07F2BE0486CC7A007CD1D0 /* Theora_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32BAE0B70371A74B00C91783 /* Theora_Prefix.pch */; }; + 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0844FE7E0FCCC99A004A99B0 /* cpu.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = cpu.c; path = ../lib/cpu.c; sourceTree = SOURCE_ROOT; }; + 084C31D90FE4E5BD00117FC9 /* apiwrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = apiwrapper.c; sourceTree = ""; }; + 084C31DA0FE4E5BD00117FC9 /* apiwrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apiwrapper.h; sourceTree = ""; }; + 084C31DB0FE4E5BD00117FC9 /* bitpack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitpack.c; sourceTree = ""; }; + 084C31DC0FE4E5BD00117FC9 /* bitpack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bitpack.h; sourceTree = ""; }; + 084C31DD0FE4E5BD00117FC9 /* dct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dct.h; sourceTree = ""; }; + 084C31DE0FE4E5BD00117FC9 /* decapiwrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decapiwrapper.c; sourceTree = ""; }; + 084C31DF0FE4E5BD00117FC9 /* decinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decinfo.c; sourceTree = ""; }; + 084C31E00FE4E5BD00117FC9 /* decint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = decint.h; sourceTree = ""; }; + 084C31E10FE4E5BD00117FC9 /* decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = decode.c; sourceTree = ""; }; + 084C31E20FE4E5BD00117FC9 /* dequant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dequant.c; sourceTree = ""; }; + 084C31E30FE4E5BD00117FC9 /* dequant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dequant.h; sourceTree = ""; }; + 084C31E40FE4E5BD00117FC9 /* fragment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fragment.c; sourceTree = ""; }; + 084C31E50FE4E5BD00117FC9 /* huffdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = huffdec.c; sourceTree = ""; }; + 084C31E60FE4E5BD00117FC9 /* huffdec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffdec.h; sourceTree = ""; }; + 084C31E70FE4E5BD00117FC9 /* huffman.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffman.h; sourceTree = ""; }; + 084C31E80FE4E5BD00117FC9 /* idct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = idct.c; sourceTree = ""; }; + 084C31E90FE4E5BD00117FC9 /* info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = info.c; sourceTree = ""; }; + 084C31EA0FE4E5BD00117FC9 /* internal.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = internal.c; sourceTree = ""; }; + 084C31EB0FE4E5BD00117FC9 /* ocintrin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocintrin.h; sourceTree = ""; }; + 084C31EC0FE4E5BD00117FC9 /* quant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quant.c; sourceTree = ""; }; + 084C31ED0FE4E5BD00117FC9 /* quant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quant.h; sourceTree = ""; }; + 084C31EE0FE4E5BD00117FC9 /* state.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = state.c; sourceTree = ""; }; + 084C31F00FE4E5BD00117FC9 /* mmxfrag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mmxfrag.c; sourceTree = ""; }; + 084C31F10FE4E5BD00117FC9 /* mmxfrag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmxfrag.h; sourceTree = ""; }; + 084C31F20FE4E5BD00117FC9 /* mmxidct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mmxidct.c; sourceTree = ""; }; + 084C31F30FE4E5BD00117FC9 /* mmxloop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mmxloop.h; sourceTree = ""; }; + 084C31F40FE4E5BD00117FC9 /* mmxstate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mmxstate.c; sourceTree = ""; }; + 084C31F50FE4E5BD00117FC9 /* x86int.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x86int.h; sourceTree = ""; }; + 084C31F60FE4E5BD00117FC9 /* x86state.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = x86state.c; sourceTree = ""; }; + 084C32450FE4E5D500117FC9 /* analyze.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = analyze.c; sourceTree = ""; }; + 084C32460FE4E5D500117FC9 /* encapiwrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encapiwrapper.c; sourceTree = ""; }; + 084C32470FE4E5D500117FC9 /* encfrag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encfrag.c; sourceTree = ""; }; + 084C32480FE4E5D500117FC9 /* encinfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encinfo.c; sourceTree = ""; }; + 084C32490FE4E5D500117FC9 /* encint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = encint.h; sourceTree = ""; }; + 084C324A0FE4E5D500117FC9 /* encode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encode.c; sourceTree = ""; }; + 084C324B0FE4E5D500117FC9 /* encoder_disabled.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = encoder_disabled.c; sourceTree = ""; }; + 084C324C0FE4E5D500117FC9 /* enquant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = enquant.c; sourceTree = ""; }; + 084C324D0FE4E5D500117FC9 /* enquant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = enquant.h; sourceTree = ""; }; + 084C324E0FE4E5D500117FC9 /* fdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fdct.c; sourceTree = ""; }; + 084C324F0FE4E5D500117FC9 /* huffenc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = huffenc.c; sourceTree = ""; }; + 084C32500FE4E5D500117FC9 /* huffenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = huffenc.h; sourceTree = ""; }; + 084C32510FE4E5D500117FC9 /* mathops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mathops.c; sourceTree = ""; }; + 084C32520FE4E5D500117FC9 /* mathops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mathops.h; sourceTree = ""; }; + 084C32530FE4E5D500117FC9 /* mcenc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mcenc.c; sourceTree = ""; }; + 084C32540FE4E5D500117FC9 /* modedec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modedec.h; sourceTree = ""; }; + 084C32550FE4E5D500117FC9 /* rate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rate.c; sourceTree = ""; }; + 084C32560FE4E5D500117FC9 /* tokenize.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tokenize.c; sourceTree = ""; }; + 084C32590FE4E5D500117FC9 /* mmxencfrag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mmxencfrag.c; sourceTree = ""; }; + 084C325A0FE4E5D500117FC9 /* mmxfdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mmxfdct.c; sourceTree = ""; }; + 084C325B0FE4E5D500117FC9 /* sse2fdct.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sse2fdct.c; sourceTree = ""; }; + 084C325C0FE4E5D500117FC9 /* x86enc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = x86enc.c; sourceTree = ""; }; + 084C325D0FE4E5D500117FC9 /* x86enc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x86enc.h; sourceTree = ""; }; + 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; + 097729930BCAC60000303091 /* codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = codec.h; path = ../include/theora/codec.h; sourceTree = SOURCE_ROOT; }; + 097729940BCAC60000303091 /* theoradec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = theoradec.h; path = ../include/theora/theoradec.h; sourceTree = SOURCE_ROOT; }; + 09C8F6430C82FBE500F72188 /* libtheoradec.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtheoradec.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 32BAE0B70371A74B00C91783 /* Theora_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Theora_Prefix.pch; sourceTree = ""; }; + 37C9B0130EBB831F0046849C /* theoraenc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = theoraenc.h; path = ../include/theora/theoraenc.h; sourceTree = SOURCE_ROOT; }; + 37CA8E380DD747F1005C8CB6 /* internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = internal.h; path = ../lib/internal.h; sourceTree = SOURCE_ROOT; }; + 734A751809D76ADD002D8FAE /* Ogg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Ogg.framework; path = /Library/Frameworks/Ogg.framework; sourceTree = ""; }; + 734A75BE09D76BB9002D8FAE /* theora.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = theora.h; path = ../include/theora/theora.h; sourceTree = SOURCE_ROOT; }; + 73514EC70B0C7E5700CEC060 /* cpu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = cpu.h; path = "../lib//cpu.h"; sourceTree = SOURCE_ROOT; }; + 738837100B192732005C7A69 /* libtheoraenc.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libtheoraenc.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 8D07F2C80486CC7A007CD1D0 /* Theora.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Theora.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 09C8F6410C82FBE500F72188 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7388370E0B192732005C7A69 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8D07F2C30486CC7A007CD1D0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 734A751909D76ADD002D8FAE /* Ogg.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DDFF38A45A11DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + 8D07F2C80486CC7A007CD1D0 /* Theora.framework */, + 738837100B192732005C7A69 /* libtheoraenc.a */, + 09C8F6430C82FBE500F72188 /* libtheoradec.a */, + ); + name = Products; + sourceTree = ""; + }; + 084C31D80FE4E5BD00117FC9 /* lib */ = { + isa = PBXGroup; + children = ( + 084C32450FE4E5D500117FC9 /* analyze.c */, + 084C32460FE4E5D500117FC9 /* encapiwrapper.c */, + 084C32470FE4E5D500117FC9 /* encfrag.c */, + 084C32480FE4E5D500117FC9 /* encinfo.c */, + 084C32490FE4E5D500117FC9 /* encint.h */, + 084C324A0FE4E5D500117FC9 /* encode.c */, + 084C324B0FE4E5D500117FC9 /* encoder_disabled.c */, + 084C324C0FE4E5D500117FC9 /* enquant.c */, + 084C324D0FE4E5D500117FC9 /* enquant.h */, + 084C324E0FE4E5D500117FC9 /* fdct.c */, + 084C324F0FE4E5D500117FC9 /* huffenc.c */, + 084C32500FE4E5D500117FC9 /* huffenc.h */, + 084C32510FE4E5D500117FC9 /* mathops.c */, + 084C32520FE4E5D500117FC9 /* mathops.h */, + 084C32530FE4E5D500117FC9 /* mcenc.c */, + 084C32540FE4E5D500117FC9 /* modedec.h */, + 084C32550FE4E5D500117FC9 /* rate.c */, + 084C32560FE4E5D500117FC9 /* tokenize.c */, + 084C31D90FE4E5BD00117FC9 /* apiwrapper.c */, + 084C31DA0FE4E5BD00117FC9 /* apiwrapper.h */, + 084C31DB0FE4E5BD00117FC9 /* bitpack.c */, + 084C31DC0FE4E5BD00117FC9 /* bitpack.h */, + 084C31DD0FE4E5BD00117FC9 /* dct.h */, + 084C31DE0FE4E5BD00117FC9 /* decapiwrapper.c */, + 084C31DF0FE4E5BD00117FC9 /* decinfo.c */, + 084C31E00FE4E5BD00117FC9 /* decint.h */, + 084C31E10FE4E5BD00117FC9 /* decode.c */, + 084C31E20FE4E5BD00117FC9 /* dequant.c */, + 084C31E30FE4E5BD00117FC9 /* dequant.h */, + 084C31E40FE4E5BD00117FC9 /* fragment.c */, + 084C31E50FE4E5BD00117FC9 /* huffdec.c */, + 084C31E60FE4E5BD00117FC9 /* huffdec.h */, + 084C31E70FE4E5BD00117FC9 /* huffman.h */, + 084C31E80FE4E5BD00117FC9 /* idct.c */, + 084C31E90FE4E5BD00117FC9 /* info.c */, + 084C31EA0FE4E5BD00117FC9 /* internal.c */, + 084C31EB0FE4E5BD00117FC9 /* ocintrin.h */, + 084C31EC0FE4E5BD00117FC9 /* quant.c */, + 084C31ED0FE4E5BD00117FC9 /* quant.h */, + 084C31EE0FE4E5BD00117FC9 /* state.c */, + 084C32570FE4E5D500117FC9 /* x86 */, + ); + name = lib; + path = ../lib; + sourceTree = SOURCE_ROOT; + }; + 084C32570FE4E5D500117FC9 /* x86 */ = { + isa = PBXGroup; + children = ( + 084C31F00FE4E5BD00117FC9 /* mmxfrag.c */, + 084C31F10FE4E5BD00117FC9 /* mmxfrag.h */, + 084C31F20FE4E5BD00117FC9 /* mmxidct.c */, + 084C31F30FE4E5BD00117FC9 /* mmxloop.h */, + 084C31F40FE4E5BD00117FC9 /* mmxstate.c */, + 084C31F50FE4E5BD00117FC9 /* x86int.h */, + 084C31F60FE4E5BD00117FC9 /* x86state.c */, + 084C32590FE4E5D500117FC9 /* mmxencfrag.c */, + 084C325A0FE4E5D500117FC9 /* mmxfdct.c */, + 084C325B0FE4E5D500117FC9 /* sse2fdct.c */, + 084C325C0FE4E5D500117FC9 /* x86enc.c */, + 084C325D0FE4E5D500117FC9 /* x86enc.h */, + ); + path = x86; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* Theora */ = { + isa = PBXGroup; + children = ( + 734A75BD09D76B96002D8FAE /* Headers */, + 08FB77ACFE841707C02AAC07 /* Source */, + 089C1665FE841158C02AAC07 /* Resources */, + 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, + 034768DDFF38A45A11DB9C8B /* Products */, + ); + name = Theora; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 734A751809D76ADD002D8FAE /* Ogg.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C1665FE841158C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + 8D07F2C70486CC7A007CD1D0 /* Info.plist */, + 089C1666FE841158C02AAC07 /* InfoPlist.strings */, + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ACFE841707C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 084C31D80FE4E5BD00117FC9 /* lib */, + 0844FE7E0FCCC99A004A99B0 /* cpu.c */, + 73514EC70B0C7E5700CEC060 /* cpu.h */, + 37CA8E380DD747F1005C8CB6 /* internal.h */, + 32BAE0B70371A74B00C91783 /* Theora_Prefix.pch */, + ); + name = Source; + sourceTree = ""; + }; + 734A75BD09D76B96002D8FAE /* Headers */ = { + isa = PBXGroup; + children = ( + 37C9B0130EBB831F0046849C /* theoraenc.h */, + 097729940BCAC60000303091 /* theoradec.h */, + 097729930BCAC60000303091 /* codec.h */, + 734A75BE09D76BB9002D8FAE /* theora.h */, + ); + name = Headers; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 09C8F63F0C82FBE500F72188 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 084C32220FE4E5BD00117FC9 /* apiwrapper.h in Headers */, + 084C32240FE4E5BD00117FC9 /* bitpack.h in Headers */, + 084C32250FE4E5BD00117FC9 /* dct.h in Headers */, + 084C32280FE4E5BD00117FC9 /* decint.h in Headers */, + 084C322B0FE4E5BD00117FC9 /* dequant.h in Headers */, + 084C322E0FE4E5BD00117FC9 /* huffdec.h in Headers */, + 084C322F0FE4E5BD00117FC9 /* huffman.h in Headers */, + 084C32330FE4E5BD00117FC9 /* ocintrin.h in Headers */, + 084C32350FE4E5BD00117FC9 /* quant.h in Headers */, + 084C32380FE4E5BD00117FC9 /* mmxfrag.h in Headers */, + 084C323A0FE4E5BD00117FC9 /* mmxloop.h in Headers */, + 084C323C0FE4E5BD00117FC9 /* x86int.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7388370C0B192732005C7A69 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 084C32810FE4E5D500117FC9 /* encint.h in Headers */, + 084C32850FE4E5D500117FC9 /* enquant.h in Headers */, + 084C32880FE4E5D500117FC9 /* huffenc.h in Headers */, + 084C328A0FE4E5D500117FC9 /* mathops.h in Headers */, + 084C328C0FE4E5D500117FC9 /* modedec.h in Headers */, + 084C32940FE4E5D500117FC9 /* x86enc.h in Headers */, + 084C32A80FE4E7FF00117FC9 /* apiwrapper.h in Headers */, + 084C32A90FE4E82500117FC9 /* dct.h in Headers */, + 084C32AD0FE4E84800117FC9 /* quant.h in Headers */, + 084C32AF0FE4E84C00117FC9 /* ocintrin.h in Headers */, + 084C32B10FE4E85300117FC9 /* x86int.h in Headers */, + 084C32B50FE4E86B00117FC9 /* mmxfrag.h in Headers */, + 084C32B70FE4E88300117FC9 /* mmxloop.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8D07F2BD0486CC7A007CD1D0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D07F2BE0486CC7A007CD1D0 /* Theora_Prefix.pch in Headers */, + 734A75BF09D76BB9002D8FAE /* theora.h in Headers */, + 73514EC90B0C7E5700CEC060 /* cpu.h in Headers */, + 097729950BCAC60000303091 /* codec.h in Headers */, + 097729960BCAC60000303091 /* theoradec.h in Headers */, + 37CA8E390DD747F1005C8CB6 /* internal.h in Headers */, + 37C9B0140EBB831F0046849C /* theoraenc.h in Headers */, + 084C31FF0FE4E5BD00117FC9 /* apiwrapper.h in Headers */, + 084C32010FE4E5BD00117FC9 /* bitpack.h in Headers */, + 084C32020FE4E5BD00117FC9 /* dct.h in Headers */, + 084C32050FE4E5BD00117FC9 /* decint.h in Headers */, + 084C32080FE4E5BD00117FC9 /* dequant.h in Headers */, + 084C320B0FE4E5BD00117FC9 /* huffdec.h in Headers */, + 084C320C0FE4E5BD00117FC9 /* huffman.h in Headers */, + 084C32100FE4E5BD00117FC9 /* ocintrin.h in Headers */, + 084C32120FE4E5BD00117FC9 /* quant.h in Headers */, + 084C32150FE4E5BD00117FC9 /* mmxfrag.h in Headers */, + 084C32170FE4E5BD00117FC9 /* mmxloop.h in Headers */, + 084C32190FE4E5BD00117FC9 /* x86int.h in Headers */, + 084C32660FE4E5D500117FC9 /* encint.h in Headers */, + 084C326A0FE4E5D500117FC9 /* enquant.h in Headers */, + 084C326D0FE4E5D500117FC9 /* huffenc.h in Headers */, + 084C326F0FE4E5D500117FC9 /* mathops.h in Headers */, + 084C32710FE4E5D500117FC9 /* modedec.h in Headers */, + 084C32790FE4E5D500117FC9 /* x86enc.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 09C8F6420C82FBE500F72188 /* libtheoradec (static) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 09C8F6610C82FC3E00F72188 /* Build configuration list for PBXNativeTarget "libtheoradec (static)" */; + buildPhases = ( + 09C8F63F0C82FBE500F72188 /* Headers */, + 09C8F6400C82FBE500F72188 /* Sources */, + 09C8F6410C82FBE500F72188 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libtheoradec (static)"; + productName = libtheoradec; + productReference = 09C8F6430C82FBE500F72188 /* libtheoradec.a */; + productType = "com.apple.product-type.library.static"; + }; + 7388370F0B192732005C7A69 /* libtheoraenc (static) */ = { + isa = PBXNativeTarget; + buildConfigurationList = 738837110B19277F005C7A69 /* Build configuration list for PBXNativeTarget "libtheoraenc (static)" */; + buildPhases = ( + 7388370C0B192732005C7A69 /* Headers */, + 7388370D0B192732005C7A69 /* Sources */, + 7388370E0B192732005C7A69 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "libtheoraenc (static)"; + productName = theora; + productReference = 738837100B192732005C7A69 /* libtheoraenc.a */; + productType = "com.apple.product-type.library.static"; + }; + 8D07F2BC0486CC7A007CD1D0 /* Theora */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "Theora" */; + buildPhases = ( + 8D07F2BD0486CC7A007CD1D0 /* Headers */, + 8D07F2BF0486CC7A007CD1D0 /* Resources */, + 8D07F2C10486CC7A007CD1D0 /* Sources */, + 8D07F2C30486CC7A007CD1D0 /* Frameworks */, + 8D07F2C50486CC7A007CD1D0 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Theora; + productInstallPath = "$(HOME)/Library/Frameworks"; + productName = Theora; + productReference = 8D07F2C80486CC7A007CD1D0 /* Theora.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "Theora" */; + compatibilityVersion = "Xcode 2.4"; + hasScannedForEncodings = 1; + mainGroup = 0867D691FE84028FC02AAC07 /* Theora */; + productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ..; + targets = ( + 8D07F2BC0486CC7A007CD1D0 /* Theora */, + 7388370F0B192732005C7A69 /* libtheoraenc (static) */, + 09C8F6420C82FBE500F72188 /* libtheoradec (static) */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D07F2BF0486CC7A007CD1D0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D07F2C50486CC7A007CD1D0 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 09C8F6400C82FBE500F72188 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 084C32210FE4E5BD00117FC9 /* apiwrapper.c in Sources */, + 084C32230FE4E5BD00117FC9 /* bitpack.c in Sources */, + 084C32260FE4E5BD00117FC9 /* decapiwrapper.c in Sources */, + 084C32270FE4E5BD00117FC9 /* decinfo.c in Sources */, + 084C32290FE4E5BD00117FC9 /* decode.c in Sources */, + 084C322A0FE4E5BD00117FC9 /* dequant.c in Sources */, + 084C322C0FE4E5BD00117FC9 /* fragment.c in Sources */, + 084C322D0FE4E5BD00117FC9 /* huffdec.c in Sources */, + 084C32300FE4E5BD00117FC9 /* idct.c in Sources */, + 084C32310FE4E5BD00117FC9 /* info.c in Sources */, + 084C32320FE4E5BD00117FC9 /* internal.c in Sources */, + 084C32340FE4E5BD00117FC9 /* quant.c in Sources */, + 084C32360FE4E5BD00117FC9 /* state.c in Sources */, + 084C32370FE4E5BD00117FC9 /* mmxfrag.c in Sources */, + 084C32390FE4E5BD00117FC9 /* mmxidct.c in Sources */, + 084C323B0FE4E5BD00117FC9 /* mmxstate.c in Sources */, + 084C323D0FE4E5BD00117FC9 /* x86state.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7388370D0B192732005C7A69 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 084C327D0FE4E5D500117FC9 /* analyze.c in Sources */, + 084C327E0FE4E5D500117FC9 /* encapiwrapper.c in Sources */, + 084C327F0FE4E5D500117FC9 /* encfrag.c in Sources */, + 084C32800FE4E5D500117FC9 /* encinfo.c in Sources */, + 084C32820FE4E5D500117FC9 /* encode.c in Sources */, + 084C32840FE4E5D500117FC9 /* enquant.c in Sources */, + 084C32860FE4E5D500117FC9 /* fdct.c in Sources */, + 084C32870FE4E5D500117FC9 /* huffenc.c in Sources */, + 084C32890FE4E5D500117FC9 /* mathops.c in Sources */, + 084C328B0FE4E5D500117FC9 /* mcenc.c in Sources */, + 084C328D0FE4E5D500117FC9 /* rate.c in Sources */, + 084C328E0FE4E5D500117FC9 /* tokenize.c in Sources */, + 084C32900FE4E5D500117FC9 /* mmxencfrag.c in Sources */, + 084C32910FE4E5D500117FC9 /* mmxfdct.c in Sources */, + 084C32920FE4E5D500117FC9 /* sse2fdct.c in Sources */, + 084C32930FE4E5D500117FC9 /* x86enc.c in Sources */, + 084C32A70FE4E7FE00117FC9 /* apiwrapper.c in Sources */, + 084C32AA0FE4E83100117FC9 /* idct.c in Sources */, + 084C32AB0FE4E83300117FC9 /* internal.c in Sources */, + 084C32AC0FE4E83600117FC9 /* fragment.c in Sources */, + 084C32AE0FE4E84A00117FC9 /* quant.c in Sources */, + 084C32B00FE4E84F00117FC9 /* state.c in Sources */, + 084C32B20FE4E85300117FC9 /* x86state.c in Sources */, + 084C32B30FE4E85D00117FC9 /* mmxstate.c in Sources */, + 084C32B40FE4E86A00117FC9 /* mmxfrag.c in Sources */, + 084C32B60FE4E87200117FC9 /* mmxidct.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8D07F2C10486CC7A007CD1D0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 084C31FE0FE4E5BD00117FC9 /* apiwrapper.c in Sources */, + 084C32000FE4E5BD00117FC9 /* bitpack.c in Sources */, + 084C32030FE4E5BD00117FC9 /* decapiwrapper.c in Sources */, + 084C32040FE4E5BD00117FC9 /* decinfo.c in Sources */, + 084C32060FE4E5BD00117FC9 /* decode.c in Sources */, + 084C32070FE4E5BD00117FC9 /* dequant.c in Sources */, + 084C32090FE4E5BD00117FC9 /* fragment.c in Sources */, + 084C320A0FE4E5BD00117FC9 /* huffdec.c in Sources */, + 084C320D0FE4E5BD00117FC9 /* idct.c in Sources */, + 084C320E0FE4E5BD00117FC9 /* info.c in Sources */, + 084C320F0FE4E5BD00117FC9 /* internal.c in Sources */, + 084C32110FE4E5BD00117FC9 /* quant.c in Sources */, + 084C32130FE4E5BD00117FC9 /* state.c in Sources */, + 084C32140FE4E5BD00117FC9 /* mmxfrag.c in Sources */, + 084C32160FE4E5BD00117FC9 /* mmxidct.c in Sources */, + 084C32180FE4E5BD00117FC9 /* mmxstate.c in Sources */, + 084C321A0FE4E5BD00117FC9 /* x86state.c in Sources */, + 084C32620FE4E5D500117FC9 /* analyze.c in Sources */, + 084C32630FE4E5D500117FC9 /* encapiwrapper.c in Sources */, + 084C32640FE4E5D500117FC9 /* encfrag.c in Sources */, + 084C32650FE4E5D500117FC9 /* encinfo.c in Sources */, + 084C32670FE4E5D500117FC9 /* encode.c in Sources */, + 084C32690FE4E5D500117FC9 /* enquant.c in Sources */, + 084C326B0FE4E5D500117FC9 /* fdct.c in Sources */, + 084C326C0FE4E5D500117FC9 /* huffenc.c in Sources */, + 084C326E0FE4E5D500117FC9 /* mathops.c in Sources */, + 084C32700FE4E5D500117FC9 /* mcenc.c in Sources */, + 084C32720FE4E5D500117FC9 /* rate.c in Sources */, + 084C32730FE4E5D500117FC9 /* tokenize.c in Sources */, + 084C32750FE4E5D500117FC9 /* mmxencfrag.c in Sources */, + 084C32760FE4E5D500117FC9 /* mmxfdct.c in Sources */, + 084C32770FE4E5D500117FC9 /* sse2fdct.c in Sources */, + 084C32780FE4E5D500117FC9 /* x86enc.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C1667FE841158C02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 09C8F6620C82FC3E00F72188 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../../ogg/include, + ); + INSTALL_PATH = /usr/local/lib; + PREBINDING = NO; + PRODUCT_NAME = theoradec; + ZERO_LINK = YES; + }; + name = Debug; + }; + 09C8F6630C82FC3E00F72188 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../../ogg/include, + ); + INSTALL_PATH = /usr/local/lib; + PREBINDING = NO; + PRODUCT_NAME = theoradec; + ZERO_LINK = NO; + }; + name = Release; + }; + 4FADC24308B4156D00ABE55E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Library/Frameworks, + ); + FRAMEWORK_VERSION = A; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Theora_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = /Library/Frameworks; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_LDFLAGS_i386 = "-Wl,-read_only_relocs,suppress"; + PRODUCT_NAME = Theora; + WRAPPER_EXTENSION = framework; + ZERO_LINK = YES; + }; + name = Debug; + }; + 4FADC24408B4156D00ABE55E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Library/Frameworks, + ); + FRAMEWORK_VERSION = A; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Theora_Prefix.pch; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = /Library/Frameworks; + LIBRARY_STYLE = DYNAMIC; + MACH_O_TYPE = mh_dylib; + OTHER_LDFLAGS_i386 = "-Wl,-read_only_relocs,suppress"; + PREBINDING = YES; + PRODUCT_NAME = Theora; + WRAPPER_EXTENSION = framework; + }; + name = Release; + }; + 4FADC24708B4156D00ABE55E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(GCC_PREPROCESSOR_DEFINITIONS)", + __MACOSX__, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../include, + "../lib/**", + ); + OTHER_CFLAGS = ""; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Debug; + }; + 4FADC24808B4156D00ABE55E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(GCC_PREPROCESSOR_DEFINITIONS)", + __MACOSX__, + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../include, + "../lib/**", + ); + OTHER_CFLAGS = ( + "$(OTHER_CFLAGS)", + "-falign-loops=16", + "-fforce-addr", + "-fomit-frame-pointer", + "-finline-functions", + "-funroll-loops", + ); + PER_ARCH_CFLAGS_i386 = "-DOC_X86_ASM"; + PREBINDING = NO; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Release; + }; + 738837120B19277F005C7A69 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../../ogg/include, + ); + INSTALL_PATH = /usr/local/lib; + PREBINDING = NO; + PRODUCT_NAME = theoraenc; + ZERO_LINK = YES; + }; + name = Debug; + }; + 738837130B19277F005C7A69 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + ../../ogg/include, + ); + INSTALL_PATH = /usr/local/lib; + PREBINDING = NO; + PRODUCT_NAME = theoraenc; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 09C8F6610C82FC3E00F72188 /* Build configuration list for PBXNativeTarget "libtheoradec (static)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 09C8F6620C82FC3E00F72188 /* Debug */, + 09C8F6630C82FC3E00F72188 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "Theora" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4FADC24308B4156D00ABE55E /* Debug */, + 4FADC24408B4156D00ABE55E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "Theora" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4FADC24708B4156D00ABE55E /* Debug */, + 4FADC24808B4156D00ABE55E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 738837110B19277F005C7A69 /* Build configuration list for PBXNativeTarget "libtheoraenc (static)" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 738837120B19277F005C7A69 /* Debug */, + 738837130B19277F005C7A69 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/libs/libtheora-1.1/macosx/Theora_Prefix.pch b/libs/libtheora-1.1/macosx/Theora_Prefix.pch new file mode 100644 index 00000000..ddae8072 --- /dev/null +++ b/libs/libtheora-1.1/macosx/Theora_Prefix.pch @@ -0,0 +1,5 @@ +// +// Prefix header for all source files of the 'Theora' target in the 'Theora' project. +// + +#include diff --git a/libs/libtheora-1.1/symbian/bld.inf b/libs/libtheora-1.1/symbian/bld.inf new file mode 100644 index 00000000..99d97167 --- /dev/null +++ b/libs/libtheora-1.1/symbian/bld.inf @@ -0,0 +1,35 @@ +/* + Copyright (C) 2003 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) Australia + + 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 CSIRO Australia 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 ORGANISATION 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. +*/ + +PRJ_MMPFILES + +theora.mmp diff --git a/libs/libtheora-1.1/symbian/config.h b/libs/libtheora-1.1/symbian/config.h new file mode 100644 index 00000000..df430d4e --- /dev/null +++ b/libs/libtheora-1.1/symbian/config.h @@ -0,0 +1,57 @@ +/* + Copyright (C) 2003 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) Australia + + 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 CSIRO Australia 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 ORGANISATION 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. +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +/* Do not build encoding support */ + +#define THEORA_SUPPORT_ENCODE 0 + +/* Do not build floating point code */ + +#define THEORA_DISABLE_FLOAT 1 + +#ifdef __WINS__ + +/* Disable some warnings */ + +#pragma warning(disable: 4100) /* unreferenced formal parameter */ +//#pragma warning(disable: 4121) /* alignment of a member was sensitive to packing */ +#pragma warning(disable: 4244) /* conversion from '...' to '...', possible loss of data */ +#pragma warning(disable: 4505) /* unreferenced local function has been removed */ +#pragma warning(disable: 4701) /* local variable may be be used without having been initialized */ +#pragma warning(disable: 4761) /* integral size mismatch in argument: conversion supplied */ + +#endif + +#endif /* ! CONFIG_H */ diff --git a/libs/libtheora-1.1/symbian/theora.mmp b/libs/libtheora-1.1/symbian/theora.mmp new file mode 100644 index 00000000..771f25ff --- /dev/null +++ b/libs/libtheora-1.1/symbian/theora.mmp @@ -0,0 +1,41 @@ +/* + Copyright (C) 2003 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) Australia + + 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 CSIRO Australia 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 ORGANISATION 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. +*/ + +TARGET theora.lib +TARGETTYPE lib +UID 0 +MACRO HAVE_CONFIG_H +SOURCEPATH ..\lib +SOURCE blockmap.c comment.c dct.c dct_decode.c decode.c frarray.c frinit.c huffman.c +SOURCE idct.c mcomp.c misc_common.c pb.c pp.c quant.c reconstruct.c scan.c toplevel.c encoder_disabled.c +USERINCLUDE . +SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\include ..\..\ogg\include ..\..\ogg\symbian diff --git a/libs/libtheora-1.1/tests/Makefile.am b/libs/libtheora-1.1/tests/Makefile.am new file mode 100644 index 00000000..7c11232a --- /dev/null +++ b/libs/libtheora-1.1/tests/Makefile.am @@ -0,0 +1,69 @@ +INCLUDES = -I$(top_srcdir)/include + +noinst_HEADERS = tests.h + +AM_CFLAGS = $(OGG_CFLAGS) + +THEORADIR = ../lib +THEORA_LIBS = $(THEORADIR)/libtheora.la $(OGG_LIBS) +THEORADEC_LIBS = $(THEORADIR)/libtheoradec.la $(OGG_LIBS) +THEORAENC_LIBS = $(THEORADIR)/libtheoraenc.la \ + $(THEORADIR)/libtheoradec.la $(OGG_LIBS) +test: check + +TESTS_ENVIRONMENT = $(VALGRIND_ENVIRONMENT) + +TESTS_DEC = noop_theora \ + comment comment_theoradec comment_theora + +TESTS_ENC = noop noop_theoraenc \ + granulepos granulepos_theoraenc granulepos_theora + +if THEORA_DISABLE_ENCODE +TESTS = $(TESTS_DEC) +else +TESTS = $(TESTS_DEC) $(TESTS_ENC) +endif + +check_PROGRAMS = $(TESTS) +# dummy call tests for the current api +noop_SOURCES = noop.c +noop_LDADD = $(THEORAENC_LIBS) +noop_CFLAGS = $(OGG_CFLAGS) + +# dummy call tests for the pre-1.0 legacy api with current link line +noop_theoraenc_SOURCES = noop_theora.c +noop_theoraenc_LDADD = $(THEORAENC_LIBS) +noop_theoraenc_CFLAGS = $(OGG_CFLAGS) + +# dummy call tests for the pre-1.0 legacy api with legacy link line +noop_theora_SOURCES = noop_theora.c +noop_theora_LDADD = $(THEORA_LIBS) +noop_theora_CFLAGS = $(OGG_CFLAGS) + +# comment utilities for the current api +comment_SOURCES = comment.c +comment_LDADD = $(THEORADEC_LIBS) +comment_CFLAGS = $(OGG_CFLAGS) + +# comment utilities for the legacy api and current lib +comment_theoradec_SOURCES = comment.c +comment_theoradec_LDADD = $(THEORADEC_LIBS) +comment_theoradec_CFLAGS = $(OGG_CFLAGS) + +# comment utilities for the legacy api and legacy lib +comment_theora_SOURCES = comment_theora.c +comment_theora_LDADD = $(THEORA_LIBS) +comment_theora_CFLAGS = $(OGG_CFLAGS) + +granulepos_SOURCES = granulepos.c +granulepos_LDADD = $(THEORAENC_LIBS) -lm +granulepos_CFLAGS = $(OGG_CFLAGS) + +granulepos_theoraenc_SOURCES = granulepos_theora.c +granulepos_theoraenc_LDADD = $(THEORAENC_LIBS) -lm +granulepos_theoraenc_CFLAGS = $(OGG_CFLAGS) + +granulepos_theora_SOURCES = granulepos_theora.c +granulepos_theora_LDADD = $(THEORA_LIBS) -lm +granulepos_theora_CFLAGS = $(OGG_CFLAGS) diff --git a/libs/libtheora-1.1/tests/comment.c b/libs/libtheora-1.1/tests/comment.c new file mode 100644 index 00000000..3b1a96eb --- /dev/null +++ b/libs/libtheora-1.1/tests/comment.c @@ -0,0 +1,91 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating comment header code + last mod: $Id: comment.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include + +#include +#include "tests.h" + +#define ARTIST1 "Bug-eyed Fish" +#define ARTIST2 "VJ Fugu" +#define COPYRIGHT "Copyright (C) 2005. Some Rights Reserved." +#define LICENSE "Creative Commons Attribution-ShareAlike 2.5" + +static int +test_comments () +{ + th_comment tc; + int n; + char * value; + + INFO ("+ Initializing th_comment"); + th_comment_init (&tc); + + INFO ("+ Adding ARTIST1"); + th_comment_add (&tc, "ARTIST=" ARTIST1); + + INFO ("+ Adding LICENSE by tag"); + th_comment_add_tag (&tc, "LICENSE", LICENSE); + + INFO ("+ Adding ARTIST2 by tag"); + th_comment_add_tag (&tc, "ARTIST", ARTIST2); + + INFO ("+ Querying value of LICENSE"); + value = th_comment_query (&tc, "LICENSE", 0); + printf("foo %s\n", value); + + if (strcmp (value, LICENSE)) + FAIL ("Incorrect value for LICENSE"); + + INFO ("+ Querying count of ARTIST comments"); + n = th_comment_query_count (&tc, "ARTIST"); + + if (n != 2) + FAIL ("Incorrect count of ARTIST comments"); + + INFO ("+ Querying value of ARTIST index 0"); + value = th_comment_query (&tc, "ARTIST", 0); + if (strcmp (value, ARTIST1)) + FAIL ("Incorrect value for ARTIST index 0"); + + INFO ("+ Querying value of ARTIST index 1"); + value = th_comment_query (&tc, "ARTIST", 1); + if (strcmp (value, ARTIST2)) + FAIL ("Incorrect value for ARTIST index 1"); + + INFO ("+ Querying value of ARTIST index 2 (out of bounds)"); + value = th_comment_query (&tc, "ARTIST", 2); + if (value != NULL) + FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)"); + + INFO ("+ Querying value of UNDEF index 7 (tag not defined)"); + value = th_comment_query (&tc, "UNDEF", 7); + if (value != NULL) + FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)"); + + INFO ("+ Clearing th_comment"); + th_comment_clear (&tc); + + return 0; +} + +int main(int argc, char *argv[]) +{ + test_comments (); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/comment_theora.c b/libs/libtheora-1.1/tests/comment_theora.c new file mode 100644 index 00000000..543b9fc4 --- /dev/null +++ b/libs/libtheora-1.1/tests/comment_theora.c @@ -0,0 +1,91 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating comment header code + last mod: $Id: comment_theora.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include + +#include +#include "tests.h" + +#define ARTIST1 "Bug-eyed Fish" +#define ARTIST2 "VJ Fugu" +#define COPYRIGHT "Copyright (C) 2005. Some Rights Reserved." +#define LICENSE "Creative Commons Attribution-ShareAlike 2.5" + +static int +test_comments () +{ + theora_comment tc; + int n; + char * value; + + INFO ("+ Initializing theora_comment"); + theora_comment_init (&tc); + + INFO ("+ Adding ARTIST1"); + theora_comment_add (&tc, "ARTIST=" ARTIST1); + + INFO ("+ Adding LICENSE by tag"); + theora_comment_add_tag (&tc, "LICENSE", LICENSE); + + INFO ("+ Adding ARTIST2 by tag"); + theora_comment_add_tag (&tc, "ARTIST", ARTIST2); + + INFO ("+ Querying value of LICENSE"); + value = theora_comment_query (&tc, "LICENSE", 0); + printf("foo %s\n", value); + + if (strcmp (value, LICENSE)) + FAIL ("Incorrect value for LICENSE"); + + INFO ("+ Querying count of ARTIST comments"); + n = theora_comment_query_count (&tc, "ARTIST"); + + if (n != 2) + FAIL ("Incorrect count of ARTIST comments"); + + INFO ("+ Querying value of ARTIST index 0"); + value = theora_comment_query (&tc, "ARTIST", 0); + if (strcmp (value, ARTIST1)) + FAIL ("Incorrect value for ARTIST index 0"); + + INFO ("+ Querying value of ARTIST index 1"); + value = theora_comment_query (&tc, "ARTIST", 1); + if (strcmp (value, ARTIST2)) + FAIL ("Incorrect value for ARTIST index 1"); + + INFO ("+ Querying value of ARTIST index 2 (out of bounds)"); + value = theora_comment_query (&tc, "ARTIST", 2); + if (value != NULL) + FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)"); + + INFO ("+ Querying value of UNDEF index 7 (tag not defined)"); + value = theora_comment_query (&tc, "UNDEF", 7); + if (value != NULL) + FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)"); + + INFO ("+ Clearing theora_comment"); + theora_comment_clear (&tc); + + return 0; +} + +int main(int argc, char *argv[]) +{ + test_comments (); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/granulepos.c b/libs/libtheora-1.1/tests/granulepos.c new file mode 100644 index 00000000..1c72fe90 --- /dev/null +++ b/libs/libtheora-1.1/tests/granulepos.c @@ -0,0 +1,149 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating encoder granulepos generation + last mod: $Id: granulepos.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include + +#include "tests.h" + +static int ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +static int +granulepos_test_encode (int frequency) +{ + th_info ti; + th_enc_ctx *te; + int result; + int frame, tframe, keyframe, keydist; + int shift; + double rate, ttime; + th_ycbcr_buffer yuv; + unsigned char *framedata; + ogg_packet op; + long long int last_granule = -1; + +/* INFO ("+ Initializing th_info struct"); */ + th_info_init (&ti); + + ti.frame_width = 32; + ti.frame_height = 32; + ti.pic_width = ti.frame_width; + ti.pic_height = ti.frame_height; + ti.pic_x = 0; + ti.pic_y = 0; + ti.fps_numerator = 16; + ti.fps_denominator = 1; + ti.aspect_numerator = 1; + ti.aspect_denominator = 1; + ti.colorspace = TH_CS_UNSPECIFIED; + ti.pixel_fmt = TH_PF_420; + ti.quality = 16; + ti.keyframe_granule_shift=ilog(frequency); + +/* INFO ("+ Allocating encoder context"); */ + te = th_encode_alloc(&ti); + if (te == NULL) { + INFO ("+ Clearing th_info"); + th_info_clear(&ti); + FAIL ("negative return code initializing encoder"); + } + +/* INFO ("+ Setting up dummy 4:2:0 frame data"); */ + framedata = calloc(ti.frame_height, ti.frame_width); + yuv[0].width = ti.frame_width; + yuv[0].height = ti.frame_height; + yuv[0].stride = ti.frame_width; + yuv[0].data = framedata; + yuv[1].width = ti.frame_width / 2; + yuv[1].height = ti.frame_width / 2; + yuv[1].stride = ti.frame_width; + yuv[1].data = framedata; + yuv[2].width = ti.frame_width / 2; + yuv[2].height = ti.frame_width / 2; + yuv[2].stride = ti.frame_width; + yuv[2].data = framedata; + + INFO ("+ Checking granulepos generation"); + shift = ti.keyframe_granule_shift; + rate = (double)ti.fps_denominator/ti.fps_numerator; + for (frame = 0; frame < frequency * 2 + 1; frame++) { + result = th_encode_ycbcr_in (te, yuv); + if (result < 0) { + printf("th_encode_ycbcr_in() returned %d\n", result); + FAIL ("negative error code submitting frame for compression"); + } + result = th_encode_packetout (te, frame >= frequency * 2, &op); + if (result <= 0) { + printf("th_encode_packetout() returned %d\n", result); + FAIL("failed to retrieve compressed frame"); + } + if ((long long int)op.granulepos < last_granule) + FAIL ("encoder returned a decreasing granulepos value"); + last_granule = op.granulepos; + keyframe = op.granulepos >> shift; + keydist = op.granulepos - (keyframe << shift); + tframe = th_granule_frame (te, op.granulepos); + ttime = th_granule_time(te, op.granulepos); +#if DEBUG + printf("++ frame %d granulepos %lld %d:%d %d %.3lfs\n", + frame, (long long int)op.granulepos, keyframe, keydist, + tframe, th_granule_time (te, op.granulepos)); +#endif + /* granulepos stores the frame count */ + if ((keyframe + keydist) != frame + 1) + FAIL ("encoder granulepos does not map to the correct frame number"); + /* th_granule_frame() returns the frame index */ + if (tframe != frame) + FAIL ("th_granule_frame() returned incorrect results"); + /* th_granule_time() returns the end time */ + if (fabs(rate*(frame+1) - ttime) > 1.0e-6) + FAIL ("th_granule_time() returned incorrect results"); + } + + /* clean up */ +/* INFO ("+ Freeing dummy frame data"); */ + free(framedata); + +/* INFO ("+ Clearing th_info struct"); */ + th_info_clear(&ti); + +/* INFO ("+ Freeing encoder context"); */ + th_encode_free(te); + + return 0; +} + +int main(int argc, char *argv[]) +{ + + granulepos_test_encode (1); + granulepos_test_encode (2); + granulepos_test_encode (3); + granulepos_test_encode (4); + granulepos_test_encode (8); + granulepos_test_encode (64); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/granulepos_theora.c b/libs/libtheora-1.1/tests/granulepos_theora.c new file mode 100644 index 00000000..691775b6 --- /dev/null +++ b/libs/libtheora-1.1/tests/granulepos_theora.c @@ -0,0 +1,154 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating encoder granulepos generation + last mod: $Id: granulepos_theora.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include +#include + +#include "tests.h" + +static int ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +static int +granulepos_test_encode (int frequency, int auto_p) +{ + theora_info ti; + theora_state th; + int result; + int frame, tframe, keyframe, keydist; + int shift; + double rate, ttime; + yuv_buffer yuv; + unsigned char *framedata; + ogg_packet op; + long long int last_granule = -1; + +/* INFO ("+ Initializing theora_info struct"); */ + theora_info_init (&ti); + + ti.width = 32; + ti.height = 32; + ti.frame_width = ti.width; + ti.frame_height = ti.frame_height; + ti.offset_x = 0; + ti.offset_y = 0; + ti.fps_numerator = 16; + ti.fps_denominator = 1; + ti.aspect_numerator = 1; + ti.aspect_denominator = 1; + ti.colorspace = OC_CS_UNSPECIFIED; + ti.pixelformat = OC_PF_420; + ti.target_bitrate = 0; + ti.quality = 16; + + ti.dropframes_p = 0; + ti.quick_p = 1; + + /* check variations of automatic or forced keyframe choice */ + ti.keyframe_auto_p = auto_p; + /* check with variations of the maximum gap */ + ti.keyframe_frequency = frequency; + ti.keyframe_frequency_force = frequency; + + ti.keyframe_data_target_bitrate = ti.target_bitrate * 1.5; + ti.keyframe_auto_threshold = 80; + ti.keyframe_mindistance = MIN(8, frequency); + ti.noise_sensitivity = 1; + +/* INFO ("+ Initializing theora_state for encoding"); */ + result = theora_encode_init (&th, &ti); + if (result == OC_DISABLED) { + INFO ("+ Clearing theora_state"); + theora_clear (&th); + } else if (result < 0) { + FAIL ("negative return code initializing encoder"); + } + +/* INFO ("+ Setting up dummy 4:2:0 frame data"); */ + framedata = calloc(ti.height, ti.width); + yuv.y_width = ti.width; + yuv.y_height = ti.height; + yuv.y_stride = ti.width; + yuv.y = framedata; + yuv.uv_width = ti.width / 2; + yuv.uv_height = ti.width / 2; + yuv.uv_stride = ti.width; + yuv.u = framedata; + yuv.v = framedata; + + INFO ("+ Checking granulepos generation"); + shift = theora_granule_shift(&ti); + rate = (double)ti.fps_denominator/ti.fps_numerator; + for (frame = 0; frame < frequency * 2 + 1; frame++) { + result = theora_encode_YUVin (&th, &yuv); + if (result < 0) { + printf("theora_encode_YUVin() returned %d\n", result); + FAIL ("negative error code submitting frame for compression"); + } + theora_encode_packetout (&th, frame >= frequency * 2, &op); + if ((long long int)op.granulepos < last_granule) + FAIL ("encoder returned a decreasing granulepos value"); + last_granule = op.granulepos; + keyframe = op.granulepos >> shift; + keydist = op.granulepos - (keyframe << shift); + tframe = theora_granule_frame (&th, op.granulepos); + ttime = theora_granule_time(&th, op.granulepos); +#if DEBUG + printf("++ frame %d granulepos %lld %d:%d %d %.3lfs\n", + frame, (long long int)op.granulepos, keyframe, keydist, + tframe, theora_granule_time (&th, op.granulepos)); +#endif + if ((keyframe + keydist) != frame + 1) + FAIL ("encoder granulepos does not map to the correct frame number"); + if (tframe != frame) + FAIL ("theora_granule_frame returned incorrect results"); + if (fabs(rate*(frame+1) - ttime) > 1.0e-6) + FAIL ("theora_granule_time returned incorrect results"); + } + + /* clean up */ +/* INFO ("+ Freeing dummy frame data"); */ + free (framedata); + +/* INFO ("+ Clearing theora_info struct"); */ + theora_info_clear (&ti); + +/* INFO ("+ Clearing theora_state"); */ + theora_clear (&th); + + return 0; +} + +int main(int argc, char *argv[]) +{ + + granulepos_test_encode (1, 1); + granulepos_test_encode (2, 1); + granulepos_test_encode (3, 1); + granulepos_test_encode (4, 1); + granulepos_test_encode (8, 1); + granulepos_test_encode (64, 1); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/noop.c b/libs/libtheora-1.1/tests/noop.c new file mode 100644 index 00000000..173f1f35 --- /dev/null +++ b/libs/libtheora-1.1/tests/noop.c @@ -0,0 +1,119 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating codec initialization + last mod: $Id: noop.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include +#include + +#include "tests.h" + +static int +noop_test_info () +{ + th_info ti; + + INFO ("+ Initializing th_info struct"); + th_info_init (&ti); + + INFO ("+ Clearing empty th_info struct"); + th_info_clear (&ti); + + return 0; +} + +static int +noop_test_comments () +{ + th_comment tc; + + INFO ("+ Initializing th_comment struct"); + th_comment_init (&tc); + + INFO ("+ Clearing empty th_comment struct") + th_comment_clear (&tc); + + return 0; +} + +static int +noop_test_encode () +{ + th_info ti; + th_enc_ctx *te; + + INFO ("+ Initializing th_info struct"); + th_info_init (&ti); + + INFO ("+ Testing encoder context with empty th_info"); + te = th_encode_alloc(&ti); + if (te != NULL) + FAIL("td_encode_alloc accepted an unconfigured th_info"); + + INFO ("+ Setting 16x16 image size"); + ti.frame_width = 16; + ti.frame_height = 16; + + INFO ("+ Allocating encoder context"); + te = th_encode_alloc(&ti); + if (te == NULL) + FAIL("td_encode_alloc returned a null pointer"); + + INFO ("+ Clearing th_info struct"); + th_info_clear (&ti); + + INFO ("+ Freeing encoder context"); + th_encode_free(te); + + return 0; +} + +static int +noop_test_decode () +{ + th_info ti; + th_dec_ctx *td; + + INFO ("+ Testing decoder context with null info and setup"); + td = th_decode_alloc(NULL, NULL); + if (td != NULL) + FAIL("td_decode_alloc accepted null info pointers"); + + INFO ("+ Initializing th_info struct"); + th_info_init (&ti); + + INFO ("+ Testing decoder context with empty info and null setup"); + td = th_decode_alloc(&ti, NULL); + if (td != NULL) + FAIL("td_decode_alloc accepted null info pointers"); + + INFO ("+ Clearing th_info struct"); + th_info_clear (&ti); + + return 0; +} + +int main(int argc, char *argv[]) +{ + noop_test_info (); + + noop_test_comments (); + + noop_test_encode (); + + noop_test_decode (); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/noop_theora.c b/libs/libtheora-1.1/tests/noop_theora.c new file mode 100644 index 00000000..1c9664bf --- /dev/null +++ b/libs/libtheora-1.1/tests/noop_theora.c @@ -0,0 +1,88 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: routines for validating codec initialization + last mod: $Id: noop_theora.c 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include + +#include "tests.h" + +static int +noop_test_encode () +{ + theora_info ti; + theora_state th; + + INFO ("+ Initializing theora_info struct"); + theora_info_init (&ti); + + INFO ("+ Setting a 16x16 frame"); + ti.width = 16; + ti.height = 16; + + INFO ("+ Initializing theora_state for encoding"); + if (theora_encode_init (&th, &ti) != OC_DISABLED) { + INFO ("+ Clearing theora_state"); + theora_clear (&th); + } + + INFO ("+ Clearing theora_info struct"); + theora_info_clear (&ti); + + return 0; +} + +static int +noop_test_decode () +{ + theora_info ti; + theora_state th; + + INFO ("+ Initializing theora_info struct"); + theora_info_init (&ti); + + INFO ("+ Initializing theora_state for decoding"); + theora_decode_init (&th, &ti); + + INFO ("+ Clearing theora_state"); + theora_clear (&th); + + INFO ("+ Clearing theora_info struct"); + theora_info_clear (&ti); + + return 0; +} + +static int +noop_test_comments () +{ + theora_comment tc; + + theora_comment_init (&tc); + theora_comment_clear (&tc); + + return 0; +} + +int main(int argc, char *argv[]) +{ + /*noop_test_decode ();*/ + + noop_test_encode (); + + noop_test_comments (); + + exit (0); +} diff --git a/libs/libtheora-1.1/tests/tests.h b/libs/libtheora-1.1/tests/tests.h new file mode 100644 index 00000000..cb9647d2 --- /dev/null +++ b/libs/libtheora-1.1/tests/tests.h @@ -0,0 +1,33 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: common test utilities + last mod: $Id: tests.h 16503 2009-08-22 18:14:02Z giles $ + + ********************************************************************/ + +#include "config.h" + +#include +#include + +#define INFO(str) \ + { printf ("---- %s ...\n", (str)); } + +#define WARN(str) \ + { printf ("%s:%d: warning: %s\n", __FILE__, __LINE__, (str)); } + +#define FAIL(str) \ + { printf ("%s:%d: %s\n", __FILE__, __LINE__, (str)); exit(1); } + +#undef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) diff --git a/libs/libtheora-1.1/theora-uninstalled.pc.in b/libs/libtheora-1.1/theora-uninstalled.pc.in new file mode 100644 index 00000000..6a8519ed --- /dev/null +++ b/libs/libtheora-1.1/theora-uninstalled.pc.in @@ -0,0 +1,14 @@ +# theora uninstalled pkg-config file + +prefix= +exec_prefix= +libdir=${pcfiledir}/lib +includedir=${pcfiledir}/include + +Name: theora uninstalled +Description: Theora video codec (not installed) +Version: @VERSION@ +Requires: ogg >= 1.1 +Conflicts: +Libs: ${libdir}/libtheora.la +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/theora.pc.in b/libs/libtheora-1.1/theora.pc.in new file mode 100644 index 00000000..d6553dd8 --- /dev/null +++ b/libs/libtheora-1.1/theora.pc.in @@ -0,0 +1,14 @@ +# theora installed pkg-config file + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: theora +Description: Theora video codec +Version: @VERSION@ +Requires: ogg >= 1.1 +Conflicts: +Libs: -L${libdir} -ltheora +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/theoradec-uninstalled.pc.in b/libs/libtheora-1.1/theoradec-uninstalled.pc.in new file mode 100644 index 00000000..8bf9df13 --- /dev/null +++ b/libs/libtheora-1.1/theoradec-uninstalled.pc.in @@ -0,0 +1,14 @@ +# theoradec uninstalled pkg-config file + +prefix= +exec_prefix= +libdir=${pcfiledir}/lib +includedir=${pcfiledir}/include + +Name: theora uninstalled +Description: Theora video codec(decoder) (not installed) +Version: @VERSION@ +Requires: ogg >= 1.1 +Conflicts: +Libs: ${libdir}/libtheoradec.la +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/theoradec.pc.in b/libs/libtheora-1.1/theoradec.pc.in new file mode 100644 index 00000000..615718df --- /dev/null +++ b/libs/libtheora-1.1/theoradec.pc.in @@ -0,0 +1,14 @@ +# theoradec installed pkg-config file + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: theora +Description: Theora video codec (decoder) +Version: @VERSION@ +Requires: ogg >= 1.1 +Conflicts: +Libs: -L${libdir} -ltheoradec +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/theoraenc-uninstalled.pc.in b/libs/libtheora-1.1/theoraenc-uninstalled.pc.in new file mode 100644 index 00000000..00c62242 --- /dev/null +++ b/libs/libtheora-1.1/theoraenc-uninstalled.pc.in @@ -0,0 +1,14 @@ +# theoraenc uninstalled pkg-config file + +prefix= +exec_prefix= +libdir=${pcfiledir}/lib +includedir=${pcfiledir}/include + +Name: theora uninstalled +Description: Theora video codec (encoder) (not installed) +Version: @VERSION@ +Requires: theoradec, ogg >= 1.1 +Conflicts: +Libs: ${libdir}/libtheoraenc.la +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/theoraenc.pc.in b/libs/libtheora-1.1/theoraenc.pc.in new file mode 100644 index 00000000..007ac8f8 --- /dev/null +++ b/libs/libtheora-1.1/theoraenc.pc.in @@ -0,0 +1,14 @@ +# theoraenc installed pkg-config file + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: theora +Description: Theora video codec (encoder) +Version: @VERSION@ +Requires: theoradec, ogg >= 1.1 +Conflicts: +Libs: -L${libdir} -ltheoraenc +Cflags: -I${includedir} diff --git a/libs/libtheora-1.1/win32/VS2005/README b/libs/libtheora-1.1/win32/VS2005/README new file mode 100644 index 00000000..d40e0447 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/README @@ -0,0 +1,22 @@ +libtheora has libogg as a dependency, and for examples, also +libvorbis, therefore you need to have libogg and libvorbis +compiled beforehand. + +Lets say you have libogg, libvorbis and libtheora in the same directory: + +libogg-1.1.4 +libvorbis-1.2.2 +libtheora-1.0 + +Because there is no automatic library detection you have to, +either: + +1. Rename libogg-1.1.4 to libogg, and libvorbis-1.2.2 to libvorbis. + +2. Open libogg.vsprops with a text editor (even notepad.exe +will suffice) and see if LIBOGG_VERSION is set to the correct +version, in this case "1.1.4". + +The same procedure should be done for libvorbis.vsprops and +check LIBVORBIS_VERSION for the correct version, in this +case "1.2.2". diff --git a/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_dynamic.vcproj new file mode 100644 index 00000000..5e8dcb07 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_dynamic.vcproj @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_static.vcproj b/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_static.vcproj new file mode 100644 index 00000000..98023255 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/dump_video/dump_video_static.vcproj @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj new file mode 100644 index 00000000..068d2ed6 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_dynamic.vcproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_static.vcproj b/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_static.vcproj new file mode 100644 index 00000000..9c9a0f90 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/encoder_example/encoder_example_static.vcproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/libogg.vsprops b/libs/libtheora-1.1/win32/VS2005/libogg.vsprops new file mode 100644 index 00000000..7fe0db78 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libogg.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_dynamic.vcproj new file mode 100644 index 00000000..a74344d5 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_dynamic.vcproj @@ -0,0 +1,688 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_static.vcproj b/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_static.vcproj new file mode 100644 index 00000000..37875319 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libtheora/libtheora_static.vcproj @@ -0,0 +1,690 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2005/libtheora_dynamic.sln b/libs/libtheora-1.1/win32/VS2005/libtheora_dynamic.sln new file mode 100644 index 00000000..866ded7d --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libtheora_dynamic.sln @@ -0,0 +1,82 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora\libtheora_dynamic.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video", "dump_video\dump_video_dynamic.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example", "encoder_example\encoder_example_dynamic.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2005/libtheora_static.sln b/libs/libtheora-1.1/win32/VS2005/libtheora_static.sln new file mode 100644 index 00000000..4ea995bd --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libtheora_static.sln @@ -0,0 +1,82 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video_static", "dump_video\dump_video_static.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora_static", "libtheora\libtheora_static.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example_static", "encoder_example\encoder_example_static.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2005/libvorbis.vsprops b/libs/libtheora-1.1/win32/VS2005/libvorbis.vsprops new file mode 100644 index 00000000..1829228a --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2005/libvorbis.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/README b/libs/libtheora-1.1/win32/VS2008/README new file mode 100644 index 00000000..d40e0447 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/README @@ -0,0 +1,22 @@ +libtheora has libogg as a dependency, and for examples, also +libvorbis, therefore you need to have libogg and libvorbis +compiled beforehand. + +Lets say you have libogg, libvorbis and libtheora in the same directory: + +libogg-1.1.4 +libvorbis-1.2.2 +libtheora-1.0 + +Because there is no automatic library detection you have to, +either: + +1. Rename libogg-1.1.4 to libogg, and libvorbis-1.2.2 to libvorbis. + +2. Open libogg.vsprops with a text editor (even notepad.exe +will suffice) and see if LIBOGG_VERSION is set to the correct +version, in this case "1.1.4". + +The same procedure should be done for libvorbis.vsprops and +check LIBVORBIS_VERSION for the correct version, in this +case "1.2.2". diff --git a/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_dynamic.vcproj new file mode 100644 index 00000000..9c527231 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_dynamic.vcproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_static.vcproj b/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_static.vcproj new file mode 100644 index 00000000..8b188b6f --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/dump_video/dump_video_static.vcproj @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj new file mode 100644 index 00000000..ec5486c6 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_dynamic.vcproj @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_static.vcproj b/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_static.vcproj new file mode 100644 index 00000000..7026d33e --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/encoder_example/encoder_example_static.vcproj @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/libogg.vsprops b/libs/libtheora-1.1/win32/VS2008/libogg.vsprops new file mode 100644 index 00000000..1355b507 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libogg.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_dynamic.vcproj b/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_dynamic.vcproj new file mode 100644 index 00000000..ce2170fe --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_dynamic.vcproj @@ -0,0 +1,576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_static.vcproj b/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_static.vcproj new file mode 100644 index 00000000..256fe5ac --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libtheora/libtheora_static.vcproj @@ -0,0 +1,566 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2008/libtheora_dynamic.sln b/libs/libtheora-1.1/win32/VS2008/libtheora_dynamic.sln new file mode 100644 index 00000000..d4bde5de --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libtheora_dynamic.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora\libtheora_dynamic.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video", "dump_video\dump_video_dynamic.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example", "encoder_example\encoder_example_dynamic.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2008/libtheora_static.sln b/libs/libtheora-1.1/win32/VS2008/libtheora_static.sln new file mode 100644 index 00000000..2b396351 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libtheora_static.sln @@ -0,0 +1,146 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video_static", "dump_video\dump_video_static.vcproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora_static", "libtheora\libtheora_static.vcproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example_static", "encoder_example\encoder_example_static.vcproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + Debug|x64 = Debug|x64 + Release_SSE|Win32 = Release_SSE|Win32 + Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE|x64 = Release_SSE|x64 + Release_SSE2|Win32 = Release_SSE2|Win32 + Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + Release_SSE2|x64 = Release_SSE2|x64 + Release|Win32 = Release|Win32 + Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Win32.Build.0 = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.ActiveCfg = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE|x64.Build.0 = Release_SSE|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Win32.Build.0 = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release_SSE2|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.ActiveCfg = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release_SSE2|x64.Build.0 = Release_SSE2|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Pocket PC SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 5.0 Smartphone SDK 2 (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2008/libvorbis.vsprops b/libs/libtheora-1.1/win32/VS2008/libvorbis.vsprops new file mode 100644 index 00000000..cd10cf53 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2008/libvorbis.vsprops @@ -0,0 +1,19 @@ + + + + + + diff --git a/libs/libtheora-1.1/win32/VS2010/README b/libs/libtheora-1.1/win32/VS2010/README new file mode 100644 index 00000000..6c62c1a8 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/README @@ -0,0 +1,22 @@ +libtheora has libogg as a dependency, and for examples, also +libvorbis, therefore you need to have libogg and libvorbis +compiled beforehand. + +Lets say you have libogg, libvorbis and libtheora in the same directory: + +libogg-1.1.4 +libvorbis-1.2.2 +libtheora-1.0 + +Because there is no automatic library detection you have to, +either: + +1. Rename libogg-1.1.4 to libogg, and libvorbis-1.2.2 to libvorbis. + +2. Open libogg.props with a text editor (even notepad.exe +will suffice) and see if LIBOGG_VERSION is set to the correct +version, in this case "1.1.4". + +The same procedure should be done for libvorbis.props and +check LIBVORBIS_VERSION for the correct version, in this +case "1.2.2". diff --git a/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_dynamic.vcxproj b/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_dynamic.vcxproj new file mode 100644 index 00000000..e4fa6edd --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_dynamic.vcxproj @@ -0,0 +1,198 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + dump_video + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF} + dump_video + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + libogg.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX64 + + + + + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + libogg.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX86 + + + + + X64 + + + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + libogg.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX64 + + + + + + + + + + + + + + {653f3841-3f26-49b9-afcf-091db4b67031} + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_static.vcxproj b/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_static.vcxproj new file mode 100644 index 00000000..5457fad3 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/dump_video/dump_video_static.vcxproj @@ -0,0 +1,198 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF} + dump_video + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + libogg_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX64 + + + + + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + libogg_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX86 + + + + + X64 + + + ..\..\..\include;..\..\..\..\libogg\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + libogg_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX64 + + + + + + + + + + + + + + {653f3841-3f26-49b9-afcf-091db4b67031} + false + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_dynamic.vcxproj b/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_dynamic.vcxproj new file mode 100644 index 00000000..2f979567 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_dynamic.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + encoder_example + {AD710263-EBFA-4388-BAA9-AD73C32AFF26} + encoder_example + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + libogg.lib;libvorbis.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg.lib;libvorbis.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX64 + + + + + AnySuitable + true + Speed + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + libogg.lib;libvorbis.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX86 + + + + + X64 + + + AnySuitable + true + Speed + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + libogg.lib;libvorbis.lib;libtheora.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX64 + + + + + + + + + + {653f3841-3f26-49b9-afcf-091db4b67031} + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_static.vcxproj b/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_static.vcxproj new file mode 100644 index 00000000..b90f9137 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/encoder_example/encoder_example_static.vcxproj @@ -0,0 +1,204 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AD710263-EBFA-4388-BAA9-AD73C32AFF26} + encoder_example + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + true + + + Application + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + libogg_static.lib;libvorbis_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg_static.lib;libvorbis_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + true + Console + false + + + MachineX64 + + + + + AnySuitable + true + Speed + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + libogg_static.lib;libvorbis_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX86 + + + + + X64 + + + AnySuitable + true + Speed + ..\..\..\include;..\..\..\..\libogg\include;..\..\..\..\libvorbis\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + libogg_static.lib;libvorbis_static.lib;libtheora_static.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\libvorbis\win32\VS2010\$(Platform)\$(Configuration);..\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + false + Console + true + true + false + + + MachineX64 + + + + + + + + + + {653f3841-3f26-49b9-afcf-091db4b67031} + false + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/libogg.props b/libs/libtheora-1.1/win32/VS2010/libogg.props new file mode 100644 index 00000000..4e1373e1 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libogg.props @@ -0,0 +1,22 @@ + + + + 1.2.0 + + + <_ProjectFileVersion>10.0.30319.1 + + + + ..\..\..\..\libogg-$(LIBOGG_VERSION)\include;..\..\..\..\ogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include;%(AdditionalIncludeDirectories) + + + ..\..\..\..\libogg-$(LIBOGG_VERSION)\win32\VS2010\$(PlatformName)\$(ConfigurationName);..\..\..\..\ogg\win32\VS2010\$(PlatformName)\$(ConfigurationName);..\..\..\..\..\..\..\core\ogg\libogg\win32\VS2010\$(PlatformName)\$(ConfigurationName) + + + + + $(LIBOGG_VERSION) + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_dynamic.vcxproj b/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_dynamic.vcxproj new file mode 100644 index 00000000..4e4688c4 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_dynamic.vcxproj @@ -0,0 +1,285 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libtheora + {653F3841-3F26-49B9-AFCF-091DB4B67031} + libtheora + Win32Proj + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Disabled + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;DEBUG;OC_X86_ASM;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + ..\..\..\lib\theora.def + false + + + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;DEBUG;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + libogg.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + ..\..\..\lib\theora.def + false + + + + + + + MaxSpeed + AnySuitable + true + Speed + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;OC_X86_ASM;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + + + Level4 + + + CompileAsC + 4244;4267;4057;4100;4245;%(DisableSpecificWarnings) + + + libogg.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + ..\..\..\lib\theora.def + false + + + + + + + X64 + + + MaxSpeed + AnySuitable + true + Speed + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + + + Level4 + + + CompileAsC + 4244;4267;4057;4100;4245;%(DisableSpecificWarnings) + + + libogg.lib;%(AdditionalDependencies) + ..\..\..\..\libogg\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + ..\..\..\lib\theora.def + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_static.vcxproj b/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_static.vcxproj new file mode 100644 index 00000000..af5678aa --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libtheora/libtheora_static.vcxproj @@ -0,0 +1,251 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {653F3841-3F26-49B9-AFCF-091DB4B67031} + libtheora + Win32Proj + + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + StaticLibrary + Unicode + true + + + StaticLibrary + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + + + + Disabled + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;DEBUG;OC_X86_ASM;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + + + X64 + + + Disabled + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;DEBUG;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + + + MaxSpeed + AnySuitable + true + Speed + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;OC_X86_ASM;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + + + Level4 + + + CompileAsC + 4244;4267;4057;4100;4245;%(DisableSpecificWarnings) + + + + + X64 + + + MaxSpeed + AnySuitable + true + Speed + ..\..\..\include;..\..\..\lib;..\..\..\..\libogg\include;..\..\..\..\..\..\..\core\ogg\libogg\include\;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBTHEORA_EXPORTS;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + + + Level4 + + + CompileAsC + 4244;4267;4057;4100;4245;%(DisableSpecificWarnings) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + true + true + true + + + + + + + + + + + + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + $(IntDir)%(Filename)1.obj + $(IntDir)%(Filename)1.xdc + + + + + + + + + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/VS2010/libtheora_dynamic.sln b/libs/libtheora-1.1/win32/VS2010/libtheora_dynamic.sln new file mode 100644 index 00000000..e33e9542 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libtheora_dynamic.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora", "libtheora\libtheora_dynamic.vcxproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video", "dump_video\dump_video_dynamic.vcxproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example", "encoder_example\encoder_example_dynamic.vcxproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2010/libtheora_static.sln b/libs/libtheora-1.1/win32/VS2010/libtheora_static.sln new file mode 100644 index 00000000..e6323fa4 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libtheora_static.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dump_video_static", "dump_video\dump_video_static.vcxproj", "{1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtheora_static", "libtheora\libtheora_static.vcxproj", "{653F3841-3F26-49B9-AFCF-091DB4B67031}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "encoder_example_static", "encoder_example\encoder_example_static.vcxproj", "{AD710263-EBFA-4388-BAA9-AD73C32AFF26}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|Win32.Build.0 = Debug|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.ActiveCfg = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Debug|x64.Build.0 = Debug|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.ActiveCfg = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|Win32.Build.0 = Release|Win32 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.ActiveCfg = Release|x64 + {1A8CA99D-B6C7-48CB-B263-6CECDADF5FBF}.Release|x64.Build.0 = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.ActiveCfg = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|Win32.Build.0 = Debug|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.ActiveCfg = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Debug|x64.Build.0 = Debug|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.ActiveCfg = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|Win32.Build.0 = Release|Win32 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.ActiveCfg = Release|x64 + {653F3841-3F26-49B9-AFCF-091DB4B67031}.Release|x64.Build.0 = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|Win32.Build.0 = Debug|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.ActiveCfg = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Debug|x64.Build.0 = Debug|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.ActiveCfg = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|Win32.Build.0 = Release|Win32 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.ActiveCfg = Release|x64 + {AD710263-EBFA-4388-BAA9-AD73C32AFF26}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libtheora-1.1/win32/VS2010/libvorbis.props b/libs/libtheora-1.1/win32/VS2010/libvorbis.props new file mode 100644 index 00000000..e8ae8d85 --- /dev/null +++ b/libs/libtheora-1.1/win32/VS2010/libvorbis.props @@ -0,0 +1,22 @@ + + + + 1.3.1 + + + <_ProjectFileVersion>10.0.30319.1 + + + + ..\..\..\..\libvorbis-$(LIBVORBIS_VERSION)\include;..\..\..\..\vorbis\include;..\..\..\..\..\..\vorbis\libs\libvorbis\include;%(AdditionalIncludeDirectories) + + + ..\..\..\..\libvorbis-$(LIBVORBIS_VERSION)\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\vorbis\win32\VS2010\$(Platform)\$(Configuration);..\..\..\..\..\..\vorbis\libs\libvorbis\win32\VS2010\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + + + + + $(LIBVORBIS_VERSION) + + + \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/build_theora_static.bat b/libs/libtheora-1.1/win32/build_theora_static.bat new file mode 100644 index 00000000..842cef01 --- /dev/null +++ b/libs/libtheora-1.1/win32/build_theora_static.bat @@ -0,0 +1,18 @@ +@echo off +echo ---+++--- Building Theora (Static) ---+++--- + +if .%SRCROOT%==. set SRCROOT=D:\xiph + +set OLDPATH=%PATH% +set OLDINCLUDE=%INCLUDE% +set OLDLIB=%LIB% + +call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat" +echo Setting include paths for Theora +set INCLUDE=%INCLUDE%;%SRCROOT%\ogg\include;%SRCROOT%\theora\include +echo Compiling... +msdev theora_static.dsp /useenv /make "theora_static - Win32 Release" /rebuild + +set PATH=%OLDPATH% +set INCLUDE=%OLDINCLUDE% +set LIB=%OLDLIB% diff --git a/libs/libtheora-1.1/win32/build_theora_static_debug.bat b/libs/libtheora-1.1/win32/build_theora_static_debug.bat new file mode 100644 index 00000000..c58edb0d --- /dev/null +++ b/libs/libtheora-1.1/win32/build_theora_static_debug.bat @@ -0,0 +1,18 @@ +@echo off +echo ---+++--- Building Theora (Static) ---+++--- + +if .%SRCROOT%==. set SRCROOT=D:\xiph + +set OLDPATH=%PATH% +set OLDINCLUDE=%INCLUDE% +set OLDLIB=%LIB% + +call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat" +echo Setting include paths for Theora +set INCLUDE=%INCLUDE%;%SRCROOT%\ogg\include;%SRCROOT%\theora\include +echo Compiling... +msdev theora_static.dsp /useenv /make "theora_static - Win32 Debug" /rebuild + +set PATH=%OLDPATH% +set INCLUDE=%OLDINCLUDE% +set LIB=%OLDLIB% diff --git a/libs/libtheora-1.1/win32/experimental/dumpvid/dumpvid.dsp b/libs/libtheora-1.1/win32/experimental/dumpvid/dumpvid.dsp new file mode 100644 index 00000000..40c4b07b --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/dumpvid/dumpvid.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="dumpvid" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=dumpvid - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "dumpvid.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "dumpvid.mak" CFG="dumpvid - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "dumpvid - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "dumpvid - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "dumpvid - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"dump_vid.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "dumpvid - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"dump_vid.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "dumpvid - Win32 Release" +# Name "dumpvid - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\dump_video.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/libs/libtheora-1.1/win32/experimental/encoderwin/ReadMe.txt b/libs/libtheora-1.1/win32/experimental/encoderwin/ReadMe.txt new file mode 100644 index 00000000..478cd4e1 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/encoderwin/ReadMe.txt @@ -0,0 +1,13 @@ +05/30/03 +Updated to use the common encoder_sample.c source in theora/examples. + +05/23/03 + +Very simple port of the sample encoder for Windows, for testing. +Encoder options in the command line are not working, and the frame rate +of video needs to be set in code (like in the simple sample encoder.) + +This example will be updated to a true Win32 app sometime in the future, +hope it is useful for basic testing now. + +mauricio@xiph.org \ No newline at end of file diff --git a/libs/libtheora-1.1/win32/experimental/encoderwin/encoderwin.dsp b/libs/libtheora-1.1/win32/experimental/encoderwin/encoderwin.dsp new file mode 100644 index 00000000..6befa4ec --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/encoderwin/encoderwin.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="encoderwin" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=encoderwin - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "encoderwin.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "encoderwin.mak" CFG="encoderwin - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "encoderwin - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "encoderwin - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "encoderwin - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib vorbis_static.lib vorbisenc_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"encoderwin.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "encoderwin - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib vorbis_static_d.lib vorbisenc_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"encoderwin.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "encoderwin - Win32 Release" +# Name "encoderwin - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\examples\encoder_example.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avi2vp3.c b/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avi2vp3.c new file mode 100644 index 00000000..1ddfb2a4 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avi2vp3.c @@ -0,0 +1,82 @@ +#include +#include +#ifdef _WIN32 +#include +#else +typedef long DWORD; +#endif + +/*extremely crude app to dump vp3 frames from an avi file*/ +/*filenames are hardcoded*/ + +#include "avilib.h" + +int main(int argc, const char **argv) +{ + + FILE * f = fopen("outfile.vp3", "wb"); + + char * buffer; + int olength; + int length; + avi_t *avifile; + int chunksize; + int frame; + int frames; + int keyframegap = 0; + int maxkeyframegap = 0; + + DWORD initialticks; + + int framew = 0; + int frameh = 0; + double framerate = 0.0f; + double fps_numerator, fps_denominator; + + avifile = AVI_open_input_file("vp31.avi", 1); + frames = AVI_video_frames(avifile); + framew = AVI_video_width(avifile); + frameh = AVI_video_height(avifile); + framerate = AVI_frame_rate(avifile); + chunksize = AVI_max_video_chunk(avifile); + /* avilib only reports the max video chunk size if the file has an + idx table. We fall back to an arbitrary limit otherwise. Better + would be just to handle the chunks dynamically */ + if (chunksize <= 0) chunksize = 131072; + buffer = malloc(chunksize); + printf("Frames(%d) Video(%dx%d) %3.2f fps\n",frames,framew, frameh,framerate); + printf("Video Compressor: %s", AVI_video_compressor(avifile)); + fps_denominator = 1000000.0F; + fps_numerator = framerate * fps_denominator; + + sprintf(buffer,"AVI2VP31R W%d H%d F%.0f:%.0f Ip A0:0\n", framew, frameh, fps_numerator, fps_denominator); + fwrite(buffer, strlen(buffer), 1, f); + + for (frame = 0; frame < frames;) { + int keyframe; + olength = length; + length = AVI_frame_size(avifile, frame++); + if( !length ) { + length = olength; + } + AVI_read_frame(avifile, (char *) buffer, &keyframe); + fwrite("FRAME\n", 6, 1, f); + fwrite(&length, sizeof(int), 1, f); + fwrite(&keyframe, sizeof(int), 1, f); + printf("Frame size(%d) IsKeyframe(%d)\n", length, keyframe); + fwrite(buffer, 1, length, f); + if (!keyframe){ + keyframegap++; + } else { + if (keyframegap>maxkeyframegap) maxkeyframegap=keyframegap; + keyframegap = 0; + } + } + + fclose(f); + printf("Max keyframegap (%d)\n", maxkeyframegap); + + free(buffer); + + exit(0); +} diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avilib.c b/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avilib.c new file mode 100644 index 00000000..c76007da --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/avilib.c @@ -0,0 +1,1839 @@ +/* + * avilib.c + * + * Copyright (C) Thomas Östreich - June 2001 + * multiple audio track support Copyright (C) 2002 Thomas Östreich + * + * Original code: + * Copyright (C) 1999 Rainer Johanni + * + * This file is part of transcode, a linux video stream processing tool + * + * transcode 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, or (at your option) + * any later version. + * + * transcode 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include "avilib.h" +//#include + +#define INFO_LIST + +/* The following variable indicates the kind of error */ + +long AVI_errno; + +#define MAX_INFO_STRLEN 64 +static char id_str[MAX_INFO_STRLEN]; + +#define FRAME_RATE_SCALE 1000000 + +#ifndef PACKAGE +#define PACKAGE "my" +#define VERSION "0.00" +#endif + +#ifndef O_BINARY +/* win32 wants a binary flag to open(); this sets it to null + on platforms that don't have it. */ +#define O_BINARY 0 +#endif + +/******************************************************************* + * * + * Utilities for writing an AVI File * + * * + *******************************************************************/ + +static size_t avi_read(int fd, char *buf, size_t len) +{ + size_t n = 0; + size_t r = 0; + + while (r < len) { + n = read (fd, buf + r, len - r); + + if (n <= 0) + return r; + r += n; + } + + return r; +} + +static size_t avi_write (int fd, char *buf, size_t len) +{ + size_t n = 0; + size_t r = 0; + + while (r < len) { + n = write (fd, buf + r, len - r); + if (n < 0) + return n; + + r += n; + } + return r; +} + +/* HEADERBYTES: The number of bytes to reserve for the header */ + +#define HEADERBYTES 2048 + +/* AVI_MAX_LEN: The maximum length of an AVI file, we stay a bit below + the 2GB limit (Remember: 2*10^9 is smaller than 2 GB) */ + +#define AVI_MAX_LEN (UINT_MAX-(1<<20)*16-HEADERBYTES) + +#define PAD_EVEN(x) ( ((x)+1) & ~1 ) + + +/* Copy n into dst as a 4 byte, little endian number. + Should also work on big endian machines */ + +static void long2str(unsigned char *dst, int n) +{ + dst[0] = (n )&0xff; + dst[1] = (n>> 8)&0xff; + dst[2] = (n>>16)&0xff; + dst[3] = (n>>24)&0xff; +} + +/* Convert a string of 4 or 2 bytes to a number, + also working on big endian machines */ + +static unsigned long str2ulong(unsigned char *str) +{ + return ( str[0] | (str[1]<<8) | (str[2]<<16) | (str[3]<<24) ); +} +static unsigned long str2ushort(unsigned char *str) +{ + return ( str[0] | (str[1]<<8) ); +} + +/* Calculate audio sample size from number of bits and number of channels. + This may have to be adjusted for eg. 12 bits and stereo */ + +static int avi_sampsize(avi_t *AVI, int j) +{ + int s; + s = ((AVI->track[j].a_bits+7)/8)*AVI->track[j].a_chans; + // if(s==0) s=1; /* avoid possible zero divisions */ + if(s<4) s=4; /* avoid possible zero divisions */ + return s; +} + +/* Add a chunk (=tag and data) to the AVI file, + returns -1 on write error, 0 on success */ + +static int avi_add_chunk(avi_t *AVI, unsigned char *tag, unsigned char *data, int length) +{ + unsigned char c[8]; + + /* Copy tag and length int c, so that we need only 1 write system call + for these two values */ + + memcpy(c,tag,4); + long2str(c+4,length); + + /* Output tag, length and data, restore previous position + if the write fails */ + + length = PAD_EVEN(length); + + if( avi_write(AVI->fdes,(char *)c,8) != 8 || + avi_write(AVI->fdes,(char *)data,length) != length ) + { + lseek(AVI->fdes,AVI->pos,SEEK_SET); + AVI_errno = AVI_ERR_WRITE; + return -1; + } + + /* Update file position */ + + AVI->pos += 8 + length; + + //fprintf(stderr, "pos=%lu %s\n", AVI->pos, tag); + + return 0; +} + +static int avi_add_index_entry(avi_t *AVI, unsigned char *tag, long flags, unsigned long pos, unsigned long len) +{ + void *ptr; + + if(AVI->n_idx>=AVI->max_idx) { + ptr = realloc((void *)AVI->idx,(AVI->max_idx+4096)*16); + + if(ptr == 0) { + AVI_errno = AVI_ERR_NO_MEM; + return -1; + } + AVI->max_idx += 4096; + AVI->idx = (unsigned char((*)[16]) ) ptr; + } + + /* Add index entry */ + + // fprintf(stderr, "INDEX %s %ld %lu %lu\n", tag, flags, pos, len); + + memcpy(AVI->idx[AVI->n_idx],tag,4); + long2str(AVI->idx[AVI->n_idx]+ 4,flags); + long2str(AVI->idx[AVI->n_idx]+ 8, pos); + long2str(AVI->idx[AVI->n_idx]+12, len); + + /* Update counter */ + + AVI->n_idx++; + + if(len>AVI->max_len) AVI->max_len=len; + + return 0; +} + +/* + AVI_open_output_file: Open an AVI File and write a bunch + of zero bytes as space for the header. + + returns a pointer to avi_t on success, a zero pointer on error +*/ + +avi_t* AVI_open_output_file(char * filename) +{ + avi_t *AVI; + int i; + + int mask = 0; + + unsigned char AVI_header[HEADERBYTES]; + + /* Allocate the avi_t struct and zero it */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==0) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + /* Since Linux needs a long time when deleting big files, + we do not truncate the file when we open it. + Instead it is truncated when the AVI file is closed */ + + /* mask = umask (0); + umask (mask);*/ + + AVI->fdes = open(filename, O_RDWR|O_CREAT|O_BINARY, 0644 &~ mask); + if (AVI->fdes < 0) + { + AVI_errno = AVI_ERR_OPEN; + free(AVI); + return 0; + } + + /* Write out HEADERBYTES bytes, the header will go here + when we are finished with writing */ + + for (i=0;ifdes,(char *)AVI_header,HEADERBYTES); + if (i != HEADERBYTES) + { + close(AVI->fdes); + AVI_errno = AVI_ERR_WRITE; + free(AVI); + return 0; + } + + AVI->pos = HEADERBYTES; + AVI->mode = AVI_MODE_WRITE; /* open for writing */ + + //init + AVI->anum = 0; + AVI->aptr = 0; + + return AVI; +} + +void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor) +{ + /* may only be called if file is open for writing */ + + if(AVI->mode==AVI_MODE_READ) return; + + AVI->width = width; + AVI->height = height; + AVI->fps = fps; + + if(strncmp(compressor, "RGB", 3)==0) { + memset(AVI->compressor, 0, 4); + } else { + memcpy(AVI->compressor,compressor,4); + } + + AVI->compressor[4] = 0; + + avi_update_header(AVI); +} + +void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate) +{ + /* may only be called if file is open for writing */ + + if(AVI->mode==AVI_MODE_READ) return; + + //inc audio tracks + AVI->aptr=AVI->anum; + ++AVI->anum; + + if(AVI->anum > AVI_MAX_TRACKS) { + fprintf(stderr, "error - only %d audio tracks supported\n", AVI_MAX_TRACKS); + exit(1); + } + + AVI->track[AVI->aptr].a_chans = channels; + AVI->track[AVI->aptr].a_rate = rate; + AVI->track[AVI->aptr].a_bits = bits; + AVI->track[AVI->aptr].a_fmt = format; + AVI->track[AVI->aptr].mp3rate = mp3rate; + + avi_update_header(AVI); +} + +#define OUT4CC(s) \ + if(nhb<=HEADERBYTES-4) memcpy(AVI_header+nhb,s,4); nhb += 4 + +#define OUTLONG(n) \ + if(nhb<=HEADERBYTES-4) long2str(AVI_header+nhb,n); nhb += 4 + +#define OUTSHRT(n) \ + if(nhb<=HEADERBYTES-2) { \ + AVI_header[nhb ] = (n )&0xff; \ + AVI_header[nhb+1] = (n>>8)&0xff; \ + } \ + nhb += 2 + + +//ThOe write preliminary AVI file header: 0 frames, max vid/aud size +int avi_update_header(avi_t *AVI) +{ + int njunk, sampsize, hasIndex, ms_per_frame, frate, flag; + int movi_len, hdrl_start, strl_start, j; + unsigned char AVI_header[HEADERBYTES]; + long nhb; + + //assume max size + movi_len = AVI_MAX_LEN - HEADERBYTES + 4; + + //assume index will be written + hasIndex=1; + + if(AVI->fps < 0.001) { + frate=0; + ms_per_frame=0; + } else { + frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); + ms_per_frame=(int) (1000000/AVI->fps + 0.5); + } + + /* Prepare the file header */ + + nhb = 0; + + /* The RIFF header */ + + OUT4CC ("RIFF"); + OUTLONG(movi_len); // assume max size + OUT4CC ("AVI "); + + /* Start the header list */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + hdrl_start = nhb; /* Store start position */ + OUT4CC ("hdrl"); + + /* The main AVI header */ + + /* The Flags in AVI File header */ + +#define AVIF_HASINDEX 0x00000010 /* Index at end of file */ +#define AVIF_MUSTUSEINDEX 0x00000020 +#define AVIF_ISINTERLEAVED 0x00000100 +#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ +#define AVIF_WASCAPTUREFILE 0x00010000 +#define AVIF_COPYRIGHTED 0x00020000 + + OUT4CC ("avih"); + OUTLONG(56); /* # of bytes to follow */ + OUTLONG(ms_per_frame); /* Microseconds per frame */ + //ThOe ->0 + // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ + OUTLONG(0); + OUTLONG(0); /* PaddingGranularity (whatever that might be) */ + /* Other sources call it 'reserved' */ + flag = AVIF_ISINTERLEAVED; + if(hasIndex) flag |= AVIF_HASINDEX; + if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; + OUTLONG(flag); /* Flags */ + OUTLONG(0); // no frames yet + OUTLONG(0); /* InitialFrames */ + + OUTLONG(AVI->anum+1); + + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + /* MS calls the following 'reserved': */ + OUTLONG(0); /* TimeScale: Unit used to measure time */ + OUTLONG(0); /* DataRate: Data rate of playback */ + OUTLONG(0); /* StartTime: Starting time of AVI data */ + OUTLONG(0); /* DataLength: Size of AVI data chunk */ + + + /* Start the video stream list ---------------------------------- */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The video stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("vids"); /* Type */ + OUT4CC (AVI->compressor); /* Handler */ + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + OUTLONG(FRAME_RATE_SCALE); /* Scale */ + OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ + OUTLONG(0); /* Start */ + OUTLONG(0); // no frames yet + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + OUTLONG(0); /* SampleSize */ + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The video stream format */ + + OUT4CC ("strf"); + OUTLONG(40); /* # of bytes to follow */ + OUTLONG(40); /* Size */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ + OUT4CC (AVI->compressor); /* Compression */ + // ThOe (*3) + OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ + OUTLONG(0); /* XPelsPerMeter */ + OUTLONG(0); /* YPelsPerMeter */ + OUTLONG(0); /* ClrUsed: Number of colors used */ + OUTLONG(0); /* ClrImportant: Number of colors important */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + + + /* Start the audio stream list ---------------------------------- */ + + for(j=0; janum; ++j) { + + sampsize = avi_sampsize(AVI, j); + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The audio stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("auds"); + + // ----------- + // ThOe + OUTLONG(0); /* Format (Optionally) */ + // ----------- + + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + + // ThOe /4 + OUTLONG(sampsize/4); /* Scale */ + OUTLONG(1000*AVI->track[j].mp3rate/8); + OUTLONG(0); /* Start */ + OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + + // ThOe /4 + OUTLONG(sampsize/4); /* SampleSize */ + + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The audio stream format */ + + OUT4CC ("strf"); + OUTLONG(16); /* # of bytes to follow */ + OUTSHRT(AVI->track[j].a_fmt); /* Format */ + OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ + OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ + // ThOe + OUTLONG(1000*AVI->track[j].mp3rate/8); + //ThOe (/4) + + OUTSHRT(sampsize/4); /* BlockAlign */ + + + OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + } + + /* Finish header list */ + + long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); + + + /* Calculate the needed amount of junk bytes, output junk */ + + njunk = HEADERBYTES - nhb - 8 - 12; + + /* Safety first: if njunk <= 0, somebody has played with + HEADERBYTES without knowing what (s)he did. + This is a fatal error */ + + if(njunk<=0) + { + fprintf(stderr,"AVI_close_output_file: # of header bytes too small\n"); + exit(1); + } + + OUT4CC ("JUNK"); + OUTLONG(njunk); + memset(AVI_header+nhb,0,njunk); + + //11/14/01 added id string + + if(njunk > strlen(id_str)+8) { + sprintf(id_str, "%s-%s", PACKAGE, VERSION); + memcpy(AVI_header+nhb, id_str, strlen(id_str)); + } + + nhb += njunk; + + /* Start the movi list */ + + OUT4CC ("LIST"); + OUTLONG(movi_len); /* Length of list in bytes */ + OUT4CC ("movi"); + + /* Output the header, truncate the file to the number of bytes + actually written, report an error if someting goes wrong */ + + if ( lseek(AVI->fdes,0,SEEK_SET)<0 || + avi_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES || + lseek(AVI->fdes,AVI->pos,SEEK_SET)<0) + { + AVI_errno = AVI_ERR_CLOSE; + return -1; + } + + return 0; +} + +/* + Write the header of an AVI file and close it. + returns 0 on success, -1 on write error. +*/ + +static int avi_close_output_file(avi_t *AVI) +{ + + int ret, njunk, sampsize, hasIndex, ms_per_frame, frate, idxerror, flag; + unsigned long movi_len; + int hdrl_start, strl_start, j; + unsigned char AVI_header[HEADERBYTES]; + long nhb; + +#ifdef INFO_LIST + long info_len; +// time_t calptr; +#endif + + /* Calculate length of movi list */ + + movi_len = AVI->pos - HEADERBYTES + 4; + + /* Try to ouput the index entries. This may fail e.g. if no space + is left on device. We will report this as an error, but we still + try to write the header correctly (so that the file still may be + readable in the most cases */ + + idxerror = 0; + // fprintf(stderr, "pos=%lu, index_len=%ld \n", AVI->pos, AVI->n_idx*16); + ret = avi_add_chunk(AVI, (unsigned char *)"idx1", (void*)AVI->idx, AVI->n_idx*16); + hasIndex = (ret==0); + //fprintf(stderr, "pos=%lu, index_len=%d\n", AVI->pos, hasIndex); + + if(ret) { + idxerror = 1; + AVI_errno = AVI_ERR_WRITE_INDEX; + } + + /* Calculate Microseconds per frame */ + + if(AVI->fps < 0.001) { + frate=0; + ms_per_frame=0; + } else { + frate = (int) (FRAME_RATE_SCALE*AVI->fps + 0.5); + ms_per_frame=(int) (1000000/AVI->fps + 0.5); + } + + /* Prepare the file header */ + + nhb = 0; + + /* The RIFF header */ + + OUT4CC ("RIFF"); + OUTLONG(AVI->pos - 8); /* # of bytes to follow */ + OUT4CC ("AVI "); + + /* Start the header list */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + hdrl_start = nhb; /* Store start position */ + OUT4CC ("hdrl"); + + /* The main AVI header */ + + /* The Flags in AVI File header */ + +#define AVIF_HASINDEX 0x00000010 /* Index at end of file */ +#define AVIF_MUSTUSEINDEX 0x00000020 +#define AVIF_ISINTERLEAVED 0x00000100 +#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames */ +#define AVIF_WASCAPTUREFILE 0x00010000 +#define AVIF_COPYRIGHTED 0x00020000 + + OUT4CC ("avih"); + OUTLONG(56); /* # of bytes to follow */ + OUTLONG(ms_per_frame); /* Microseconds per frame */ + //ThOe ->0 + // OUTLONG(10000000); /* MaxBytesPerSec, I hope this will never be used */ + OUTLONG(0); + OUTLONG(0); /* PaddingGranularity (whatever that might be) */ + /* Other sources call it 'reserved' */ + flag = AVIF_ISINTERLEAVED; + if(hasIndex) flag |= AVIF_HASINDEX; + if(hasIndex && AVI->must_use_index) flag |= AVIF_MUSTUSEINDEX; + OUTLONG(flag); /* Flags */ + OUTLONG(AVI->video_frames); /* TotalFrames */ + OUTLONG(0); /* InitialFrames */ + + OUTLONG(AVI->anum+1); +// if (AVI->track[0].audio_bytes) +// { OUTLONG(2); } /* Streams */ +// else +// { OUTLONG(1); } /* Streams */ + + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + /* MS calls the following 'reserved': */ + OUTLONG(0); /* TimeScale: Unit used to measure time */ + OUTLONG(0); /* DataRate: Data rate of playback */ + OUTLONG(0); /* StartTime: Starting time of AVI data */ + OUTLONG(0); /* DataLength: Size of AVI data chunk */ + + + /* Start the video stream list ---------------------------------- */ + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The video stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("vids"); /* Type */ + OUT4CC (AVI->compressor); /* Handler */ + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + OUTLONG(FRAME_RATE_SCALE); /* Scale */ + OUTLONG(frate); /* Rate: Rate/Scale == samples/second */ + OUTLONG(0); /* Start */ + OUTLONG(AVI->video_frames); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + OUTLONG(0); /* SampleSize */ + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The video stream format */ + + OUT4CC ("strf"); + OUTLONG(40); /* # of bytes to follow */ + OUTLONG(40); /* Size */ + OUTLONG(AVI->width); /* Width */ + OUTLONG(AVI->height); /* Height */ + OUTSHRT(1); OUTSHRT(24); /* Planes, Count */ + OUT4CC (AVI->compressor); /* Compression */ + // ThOe (*3) + OUTLONG(AVI->width*AVI->height*3); /* SizeImage (in bytes?) */ + OUTLONG(0); /* XPelsPerMeter */ + OUTLONG(0); /* YPelsPerMeter */ + OUTLONG(0); /* ClrUsed: Number of colors used */ + OUTLONG(0); /* ClrImportant: Number of colors important */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + + long2str(AVI_header+strl_start-4,nhb-strl_start); + + /* Start the audio stream list ---------------------------------- */ + + for(j=0; janum; ++j) { + + //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes) + { + + sampsize = avi_sampsize(AVI, j); + + OUT4CC ("LIST"); + OUTLONG(0); /* Length of list in bytes, don't know yet */ + strl_start = nhb; /* Store start position */ + OUT4CC ("strl"); + + /* The audio stream header */ + + OUT4CC ("strh"); + OUTLONG(56); /* # of bytes to follow */ + OUT4CC ("auds"); + + // ----------- + // ThOe + OUTLONG(0); /* Format (Optionally) */ + // ----------- + + OUTLONG(0); /* Flags */ + OUTLONG(0); /* Reserved, MS says: wPriority, wLanguage */ + OUTLONG(0); /* InitialFrames */ + + // ThOe /4 + OUTLONG(sampsize/4); /* Scale */ + OUTLONG(1000*AVI->track[j].mp3rate/8); + OUTLONG(0); /* Start */ + OUTLONG(4*AVI->track[j].audio_bytes/sampsize); /* Length */ + OUTLONG(0); /* SuggestedBufferSize */ + OUTLONG(-1); /* Quality */ + + // ThOe /4 + OUTLONG(sampsize/4); /* SampleSize */ + + OUTLONG(0); /* Frame */ + OUTLONG(0); /* Frame */ + // OUTLONG(0); /* Frame */ + //OUTLONG(0); /* Frame */ + + /* The audio stream format */ + + OUT4CC ("strf"); + OUTLONG(16); /* # of bytes to follow */ + OUTSHRT(AVI->track[j].a_fmt); /* Format */ + OUTSHRT(AVI->track[j].a_chans); /* Number of channels */ + OUTLONG(AVI->track[j].a_rate); /* SamplesPerSec */ + // ThOe + OUTLONG(1000*AVI->track[j].mp3rate/8); + //ThOe (/4) + + OUTSHRT(sampsize/4); /* BlockAlign */ + + + OUTSHRT(AVI->track[j].a_bits); /* BitsPerSample */ + + /* Finish stream list, i.e. put number of bytes in the list to proper pos */ + } + long2str(AVI_header+strl_start-4,nhb-strl_start); + } + + /* Finish header list */ + + long2str(AVI_header+hdrl_start-4,nhb-hdrl_start); + + + // add INFO list --- (0.6.0pre4) + +#ifdef INFO_LIST + OUT4CC ("LIST"); + + //FIXME + info_len = MAX_INFO_STRLEN + 12; + OUTLONG(info_len); + OUT4CC ("INFO"); + +// OUT4CC ("INAM"); +// OUTLONG(MAX_INFO_STRLEN); + +// sprintf(id_str, "\t"); +// memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); +// memcpy(AVI_header+nhb, id_str, strlen(id_str)); +// nhb += MAX_INFO_STRLEN; + + OUT4CC ("ISFT"); + OUTLONG(MAX_INFO_STRLEN); + + sprintf(id_str, "%s-%s", PACKAGE, VERSION); + memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); + memcpy(AVI_header+nhb, id_str, strlen(id_str)); + nhb += MAX_INFO_STRLEN; + +// OUT4CC ("ICMT"); +// OUTLONG(MAX_INFO_STRLEN); + +// calptr=time(NULL); +// sprintf(id_str, "\t%s %s", ctime(&calptr), ""); +// memset(AVI_header+nhb, 0, MAX_INFO_STRLEN); +// memcpy(AVI_header+nhb, id_str, 25); +// nhb += MAX_INFO_STRLEN; +#endif + + // ---------------------------- + + /* Calculate the needed amount of junk bytes, output junk */ + + njunk = HEADERBYTES - nhb - 8 - 12; + + /* Safety first: if njunk <= 0, somebody has played with + HEADERBYTES without knowing what (s)he did. + This is a fatal error */ + + if(njunk<=0) + { + fprintf(stderr,"AVI_close_output_file: # of header bytes too small\n"); + exit(1); + } + + OUT4CC ("JUNK"); + OUTLONG(njunk); + memset(AVI_header+nhb,0,njunk); + + nhb += njunk; + + /* Start the movi list */ + + OUT4CC ("LIST"); + OUTLONG(movi_len); /* Length of list in bytes */ + OUT4CC ("movi"); + + /* Output the header, truncate the file to the number of bytes + actually written, report an error if someting goes wrong */ + + if ( lseek(AVI->fdes,0,SEEK_SET)<0 || + avi_write(AVI->fdes,(char *)AVI_header,HEADERBYTES)!=HEADERBYTES + //|| ftruncate(AVI->fdes,AVI->pos)<0 + ) + { + AVI_errno = AVI_ERR_CLOSE; + return -1; + } + + if(idxerror) return -1; + + return 0; +} + +/* + AVI_write_data: + Add video or audio data to the file; + + Return values: + 0 No error; + -1 Error, AVI_errno is set appropriatly; + +*/ + +static int avi_write_data(avi_t *AVI, char *data, unsigned long length, int audio, int keyframe) +{ + int n; + + unsigned char astr[5]; + + /* Check for maximum file length */ + + if ( (AVI->pos + 8 + length + 8 + (AVI->n_idx+1)*16) > AVI_MAX_LEN ) { + AVI_errno = AVI_ERR_SIZELIM; + return -1; + } + + /* Add index entry */ + + //set tag for current audio track + sprintf((char *)astr, "0%1dwb", AVI->aptr+1); + + if(audio) + n = avi_add_index_entry(AVI,astr,0x00,AVI->pos,length); + else + n = avi_add_index_entry(AVI,(unsigned char *) "00db",((keyframe)?0x10:0x0),AVI->pos,length); + + if(n) return -1; + + /* Output tag and data */ + + if(audio) + n = avi_add_chunk(AVI,(unsigned char *) astr, (unsigned char *)data,length); + else + n = avi_add_chunk(AVI,(unsigned char *)"00db",(unsigned char *)data,length); + + if (n) return -1; + + return 0; +} + +int AVI_write_frame(avi_t *AVI, char *data, long bytes, int keyframe) +{ + unsigned long pos; + + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + pos = AVI->pos; + + if(avi_write_data(AVI,data,bytes,0,keyframe)) return -1; + + AVI->last_pos = pos; + AVI->last_len = bytes; + AVI->video_frames++; + return 0; +} + +int AVI_dup_frame(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + if(AVI->last_pos==0) return 0; /* No previous real frame */ + if(avi_add_index_entry(AVI,(unsigned char *)"00db",0x10,AVI->last_pos,AVI->last_len)) return -1; + AVI->video_frames++; + AVI->must_use_index = 1; + return 0; +} + +int AVI_write_audio(avi_t *AVI, char *data, long bytes) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + if( avi_write_data(AVI,data,bytes,1,0) ) return -1; + AVI->track[AVI->aptr].audio_bytes += bytes; + return 0; +} + + +int AVI_append_audio(avi_t *AVI, char *data, long bytes) +{ + + long i, length, pos; + unsigned char c[4]; + + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + // update last index entry: + + --AVI->n_idx; + length = str2ulong(AVI->idx[AVI->n_idx]+12); + pos = str2ulong(AVI->idx[AVI->n_idx]+8); + + //update; + long2str(AVI->idx[AVI->n_idx]+12,length+bytes); + + ++AVI->n_idx; + + AVI->track[AVI->aptr].audio_bytes += bytes; + + //update chunk header + lseek(AVI->fdes, pos+4, SEEK_SET); + long2str(c, length+bytes); + avi_write(AVI->fdes,(char *) c, 4); + + lseek(AVI->fdes, pos+8+length, SEEK_SET); + + i=PAD_EVEN(length + bytes); + + bytes = i - length; + avi_write(AVI->fdes, data, bytes); + AVI->pos = pos + 8 + i; + + return 0; +} + + +long AVI_bytes_remain(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) return 0; + + return ( AVI_MAX_LEN - (AVI->pos + 8 + 16*AVI->n_idx)); +} + +long AVI_bytes_written(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_READ) return 0; + + return (AVI->pos + 8 + 16*AVI->n_idx); +} + +int AVI_set_audio_track(avi_t *AVI, int track) +{ + + if(track < 0 || track + 1 > AVI->anum) return(-1); + + //this info is not written to file anyway + AVI->aptr=track; + return 0; +} + +int AVI_get_audio_track(avi_t *AVI) +{ + return(AVI->aptr); +} + + +/******************************************************************* + * * + * Utilities for reading video and audio from an AVI File * + * * + *******************************************************************/ + +int AVI_close(avi_t *AVI) +{ + int ret; + + /* If the file was open for writing, the header and index still have + to be written */ + + if(AVI->mode == AVI_MODE_WRITE) + ret = avi_close_output_file(AVI); + else + ret = 0; + + /* Even if there happened an error, we first clean up */ + + close(AVI->fdes); + if(AVI->idx) free(AVI->idx); + if(AVI->video_index) free(AVI->video_index); + //FIXME + //if(AVI->audio_index) free(AVI->audio_index); + free(AVI); + + return ret; +} + + +#define ERR_EXIT(x) \ +{ \ + AVI_close(AVI); \ + AVI_errno = x; \ + return 0; \ +} + +avi_t *AVI_open_input_file(char *filename, int getIndex) +{ + avi_t *AVI=NULL; + + /* Create avi_t structure */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==NULL) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + AVI->mode = AVI_MODE_READ; /* open for reading */ + + /* Open the file */ + + AVI->fdes = open(filename,O_RDONLY|O_BINARY); + if(AVI->fdes < 0) + { + AVI_errno = AVI_ERR_OPEN; + free(AVI); + return 0; + } + + avi_parse_input_file(AVI, getIndex); + + AVI->aptr=0; //reset + + return AVI; +} + +avi_t *AVI_open_fd(int fd, int getIndex) +{ + avi_t *AVI=NULL; + + /* Create avi_t structure */ + + AVI = (avi_t *) malloc(sizeof(avi_t)); + if(AVI==NULL) + { + AVI_errno = AVI_ERR_NO_MEM; + return 0; + } + memset((void *)AVI,0,sizeof(avi_t)); + + AVI->mode = AVI_MODE_READ; /* open for reading */ + + // file alread open + AVI->fdes = fd; + + avi_parse_input_file(AVI, getIndex); + + AVI->aptr=0; //reset + + return AVI; +} + +int avi_parse_input_file(avi_t *AVI, int getIndex) +{ + long i, n, rate, scale, idx_type; + unsigned char *hdrl_data; + long header_offset=0, hdrl_len=0; + long nvi, nai[AVI_MAX_TRACKS], ioff; + long tot[AVI_MAX_TRACKS]; + int j; + int lasttag = 0; + int vids_strh_seen = 0; + int vids_strf_seen = 0; + int auds_strh_seen = 0; + // int auds_strf_seen = 0; + int num_stream = 0; + char data[256]; + + /* Read first 12 bytes and check that this is an AVI file */ + + if( avi_read(AVI->fdes,data,12) != 12 ) ERR_EXIT(AVI_ERR_READ) + + if( strncasecmp(data ,"RIFF",4) !=0 || + strncasecmp(data+8,"AVI ",4) !=0 ) ERR_EXIT(AVI_ERR_NO_AVI) + + /* Go through the AVI file and extract the header list, + the start position of the 'movi' list and an optionally + present idx1 tag */ + + hdrl_data = 0; + + while(1) + { + if( avi_read(AVI->fdes,data,8) != 8 ) break; /* We assume it's EOF */ + + n = str2ulong((unsigned char *) data+4); + n = PAD_EVEN(n); + + if(strncasecmp(data,"LIST",4) == 0) + { + if( avi_read(AVI->fdes,data,4) != 4 ) ERR_EXIT(AVI_ERR_READ) + n -= 4; + if(strncasecmp(data,"hdrl",4) == 0) + { + hdrl_len = n; + hdrl_data = (unsigned char *) malloc(n); + if(hdrl_data==0) ERR_EXIT(AVI_ERR_NO_MEM); + + // offset of header + + header_offset = lseek(AVI->fdes,0,SEEK_CUR); + + if( avi_read(AVI->fdes,(char *)hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ) + } + else if(strncasecmp(data,"movi",4) == 0) + { + AVI->movi_start = lseek(AVI->fdes,0,SEEK_CUR); + lseek(AVI->fdes,n,SEEK_CUR); + } + else + lseek(AVI->fdes,n,SEEK_CUR); + } + else if(strncasecmp(data,"idx1",4) == 0) + { + /* n must be a multiple of 16, but the reading does not + break if this is not the case */ + + AVI->n_idx = AVI->max_idx = n/16; + AVI->idx = (unsigned char((*)[16]) ) malloc(n); + if(AVI->idx==0) ERR_EXIT(AVI_ERR_NO_MEM) + if(avi_read(AVI->fdes, (char *) AVI->idx, n) != n ) ERR_EXIT(AVI_ERR_READ) + } + else + lseek(AVI->fdes,n,SEEK_CUR); + } + + if(!hdrl_data ) ERR_EXIT(AVI_ERR_NO_HDRL) + if(!AVI->movi_start) ERR_EXIT(AVI_ERR_NO_MOVI) + + /* Interpret the header list */ + + for(i=0;icompressor,hdrl_data+i+4,4); + AVI->compressor[4] = 0; + + // ThOe + AVI->v_codech_off = header_offset + i+4; + + scale = str2ulong((unsigned char *)hdrl_data+i+20); + rate = str2ulong(hdrl_data+i+24); + if(scale!=0) AVI->fps = (double)rate/(double)scale; + AVI->video_frames = str2ulong(hdrl_data+i+32); + AVI->video_strn = num_stream; + AVI->max_len = 0; + vids_strh_seen = 1; + lasttag = 1; /* vids */ + } + else if (strncasecmp ((char *) hdrl_data+i,"auds",4) ==0 && ! auds_strh_seen) + { + + //inc audio tracks + AVI->aptr=AVI->anum; + ++AVI->anum; + + if(AVI->anum > AVI_MAX_TRACKS) { + fprintf(stderr, "error - only %d audio tracks supported\n", AVI_MAX_TRACKS); + return(-1); + } + + AVI->track[AVI->aptr].audio_bytes = str2ulong(hdrl_data+i+32)*avi_sampsize(AVI, 0); + AVI->track[AVI->aptr].audio_strn = num_stream; + // auds_strh_seen = 1; + lasttag = 2; /* auds */ + + // ThOe + AVI->track[AVI->aptr].a_codech_off = header_offset + i; + + } + else + lasttag = 0; + num_stream++; + } + else if(strncasecmp((char *) hdrl_data+i,"strf",4)==0) + { + i += 8; + if(lasttag == 1) + { + AVI->width = str2ulong(hdrl_data+i+4); + AVI->height = str2ulong(hdrl_data+i+8); + vids_strf_seen = 1; + //ThOe + AVI->v_codecf_off = header_offset + i+16; + + memcpy(AVI->compressor2, hdrl_data+i+16, 4); + AVI->compressor2[4] = 0; + + } + else if(lasttag == 2) + { + AVI->track[AVI->aptr].a_fmt = str2ushort(hdrl_data+i ); + + //ThOe + AVI->track[AVI->aptr].a_codecf_off = header_offset + i; + + AVI->track[AVI->aptr].a_chans = str2ushort(hdrl_data+i+2); + AVI->track[AVI->aptr].a_rate = str2ulong (hdrl_data+i+4); + //ThOe: read mp3bitrate + AVI->track[AVI->aptr].mp3rate = 8*str2ulong(hdrl_data+i+8)/1000; + //:ThOe + AVI->track[AVI->aptr].a_bits = str2ushort(hdrl_data+i+14); + // auds_strf_seen = 1; + } + lasttag = 0; + } + else + { + i += 8; + lasttag = 0; + } + + i += n; + } + + free(hdrl_data); + + if(!vids_strh_seen || !vids_strf_seen) ERR_EXIT(AVI_ERR_NO_VIDS) + + AVI->video_tag[0] = AVI->video_strn/10 + '0'; + AVI->video_tag[1] = AVI->video_strn%10 + '0'; + AVI->video_tag[2] = 'd'; + AVI->video_tag[3] = 'b'; + + /* Audio tag is set to "99wb" if no audio present */ + if(!AVI->track[0].a_chans) AVI->track[0].audio_strn = 99; + + for(j=0; janum; ++j) { + AVI->track[j].audio_tag[0] = (j+1)/10 + '0'; + AVI->track[j].audio_tag[1] = (j+1)%10 + '0'; + AVI->track[j].audio_tag[2] = 'w'; + AVI->track[j].audio_tag[3] = 'b'; + } + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + + /* get index if wanted */ + + if(!getIndex) return(0); + + /* if the file has an idx1, check if this is relative + to the start of the file or to the start of the movi list */ + + idx_type = 0; + + if(AVI->idx) + { + long pos, len; + + /* Search the first videoframe in the idx1 and look where + it is in the file */ + + for(i=0;in_idx;i++) + if( strncasecmp((char *) AVI->idx[i],(char *) AVI->video_tag,3)==0 ) break; + if(i>=AVI->n_idx) ERR_EXIT(AVI_ERR_NO_VIDS) + + pos = str2ulong(AVI->idx[i]+ 8); + len = str2ulong(AVI->idx[i]+12); + + lseek(AVI->fdes,pos,SEEK_SET); + if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ) + if( strncasecmp((char *)data,(char *)AVI->idx[i],4)==0 && + str2ulong((unsigned char *)data+4)==len ) + { + idx_type = 1; /* Index from start of file */ + } + else + { + lseek(AVI->fdes,pos+AVI->movi_start-4,SEEK_SET); + if(avi_read(AVI->fdes,data,8)!=8) ERR_EXIT(AVI_ERR_READ) + if( strncasecmp((char *)data,(char *)AVI->idx[i],4)==0 && str2ulong((unsigned char *)data+4)==len ) + { + idx_type = 2; /* Index from start of movi list */ + } + } + /* idx_type remains 0 if neither of the two tests above succeeds */ + } + + if(idx_type == 0) + { + /* we must search through the file to get the index */ + + lseek(AVI->fdes, AVI->movi_start, SEEK_SET); + + AVI->n_idx = 0; + + while(1) + { + if( avi_read(AVI->fdes,data,8) != 8 ) break; + n = str2ulong((unsigned char *)data+4); + + /* The movi list may contain sub-lists, ignore them */ + + if(strncasecmp(data,"LIST",4)==0) + { + lseek(AVI->fdes,4,SEEK_CUR); + continue; + } + + /* Check if we got a tag ##db, ##dc or ##wb */ + + if( ( (data[2]=='d' || data[2]=='D') && + (data[3]=='b' || data[3]=='B' || data[3]=='c' || data[3]=='C') ) + || ( (data[2]=='w' || data[2]=='W') && + (data[3]=='b' || data[3]=='B') ) ) + { + avi_add_index_entry(AVI,(unsigned char *) data,0,lseek(AVI->fdes,0,SEEK_CUR)-8,n); + } + + lseek(AVI->fdes,PAD_EVEN(n),SEEK_CUR); + } + idx_type = 1; + } + + /* Now generate the video index and audio index arrays */ + + nvi = 0; + for(j=0; janum; ++j) nai[j] = 0; + + for(i=0;in_idx;i++) { + + if(strncasecmp((char *)AVI->idx[i],(char *) AVI->video_tag,3) == 0) nvi++; + + for(j=0; janum; ++j) if(strncasecmp((char *)AVI->idx[i], AVI->track[j].audio_tag,4) == 0) nai[j]++; + } + + AVI->video_frames = nvi; + for(j=0; janum; ++j) AVI->track[j].audio_chunks = nai[j]; + +// fprintf(stderr, "chunks = %ld %d %s\n", AVI->track[0].audio_chunks, AVI->anum, AVI->track[0].audio_tag); + + if(AVI->video_frames==0) ERR_EXIT(AVI_ERR_NO_VIDS); + AVI->video_index = (video_index_entry *) malloc(nvi*sizeof(video_index_entry)); + if(AVI->video_index==0) ERR_EXIT(AVI_ERR_NO_MEM); + + for(j=0; janum; ++j) { + if(AVI->track[j].audio_chunks) { + AVI->track[j].audio_index = (audio_index_entry *) malloc(nai[j]*sizeof(audio_index_entry)); + if(AVI->track[j].audio_index==0) ERR_EXIT(AVI_ERR_NO_MEM); + } + } + + nvi = 0; + for(j=0; janum; ++j) nai[j] = tot[j] = 0; + + ioff = idx_type == 1 ? 8 : AVI->movi_start+4; + + for(i=0;in_idx;i++) { + + //video + if(strncasecmp((char *)AVI->idx[i],(char *)AVI->video_tag,3) == 0) { + AVI->video_index[nvi].key = str2ulong(AVI->idx[i]+ 4); + AVI->video_index[nvi].pos = str2ulong(AVI->idx[i]+ 8)+ioff; + AVI->video_index[nvi].len = str2ulong(AVI->idx[i]+12); + nvi++; + } + + //audio + for(j=0; janum; ++j) { + + if(strncasecmp((char *)AVI->idx[i],AVI->track[j].audio_tag,4) == 0) { + AVI->track[j].audio_index[nai[j]].pos = str2ulong(AVI->idx[i]+ 8)+ioff; + AVI->track[j].audio_index[nai[j]].len = str2ulong(AVI->idx[i]+12); + AVI->track[j].audio_index[nai[j]].tot = tot[j]; + tot[j] += AVI->track[j].audio_index[nai[j]].len; + nai[j]++; + } + } + } + + + for(j=0; janum; ++j) AVI->track[j].audio_bytes = tot[j]; + + /* Reposition the file */ + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + AVI->video_pos = 0; + + return(0); +} + +long AVI_video_frames(avi_t *AVI) +{ + return AVI->video_frames; +} +int AVI_video_width(avi_t *AVI) +{ + return AVI->width; +} +int AVI_video_height(avi_t *AVI) +{ + return AVI->height; +} +double AVI_frame_rate(avi_t *AVI) +{ + return AVI->fps; +} +char* AVI_video_compressor(avi_t *AVI) +{ + return AVI->compressor2; +} + +long AVI_max_video_chunk(avi_t *AVI) +{ + return AVI->max_len; +} + +int AVI_audio_tracks(avi_t *AVI) +{ + return(AVI->anum); +} + +int AVI_audio_channels(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_chans; +} + +long AVI_audio_mp3rate(avi_t *AVI) +{ + return AVI->track[AVI->aptr].mp3rate; +} + +int AVI_audio_bits(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_bits; +} + +int AVI_audio_format(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_fmt; +} + +long AVI_audio_rate(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_rate; +} + +long AVI_audio_bytes(avi_t *AVI) +{ + return AVI->track[AVI->aptr].audio_bytes; +} + +long AVI_audio_chunks(avi_t *AVI) +{ + return AVI->track[AVI->aptr].audio_chunks; +} + +long AVI_audio_codech_offset(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_codech_off; +} + +long AVI_audio_codecf_offset(avi_t *AVI) +{ + return AVI->track[AVI->aptr].a_codecf_off; +} + +long AVI_video_codech_offset(avi_t *AVI) +{ + return AVI->v_codech_off; +} + +long AVI_video_codecf_offset(avi_t *AVI) +{ + return AVI->v_codecf_off; +} + +long AVI_frame_size(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->video_frames) return 0; + return(AVI->video_index[frame].len); +} + +long AVI_audio_size(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->track[AVI->aptr].audio_chunks) return 0; + return(AVI->track[AVI->aptr].audio_index[frame].len); +} + +long AVI_get_video_position(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(frame < 0 || frame >= AVI->video_frames) return 0; + return(AVI->video_index[frame].pos); +} + + +int AVI_seek_start(avi_t *AVI) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + lseek(AVI->fdes,AVI->movi_start,SEEK_SET); + AVI->video_pos = 0; + return 0; +} + +int AVI_set_video_position(avi_t *AVI, long frame) +{ + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if (frame < 0 ) frame = 0; + AVI->video_pos = frame; + return 0; +} + +int AVI_set_audio_bitrate(avi_t *AVI, long bitrate) +{ + if(AVI->mode==AVI_MODE_READ) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + + AVI->track[AVI->aptr].mp3rate = bitrate; + return 0; +} + + +long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) +{ + long n; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(AVI->video_pos < 0 || AVI->video_pos >= AVI->video_frames) return -1; + n = AVI->video_index[AVI->video_pos].len; + + *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0; + + lseek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET); + + if (avi_read(AVI->fdes,vidbuf,n) != n) + { + AVI_errno = AVI_ERR_READ; + return -1; + } + + AVI->video_pos++; + + return n; +} + +int AVI_set_audio_position(avi_t *AVI, long byte) +{ + long n0, n1, n; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + if(byte < 0) byte = 0; + + /* Binary search in the audio chunks */ + + n0 = 0; + n1 = AVI->track[AVI->aptr].audio_chunks; + + while(n0track[AVI->aptr].audio_index[n].tot>byte) + n1 = n; + else + n0 = n; + } + + AVI->track[AVI->aptr].audio_posc = n0; + AVI->track[AVI->aptr].audio_posb = byte - AVI->track[AVI->aptr].audio_index[n0].tot; + + return 0; +} + +long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes) +{ + long nr, pos, left, todo; + + if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } + if(!AVI->track[AVI->aptr].audio_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } + + nr = 0; /* total number of bytes read */ + + while(bytes>0) + { + left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb; + if(left==0) + { + if(AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks-1) return nr; + AVI->track[AVI->aptr].audio_posc++; + AVI->track[AVI->aptr].audio_posb = 0; + continue; + } + if(bytestrack[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb; + lseek(AVI->fdes, pos, SEEK_SET); + if (avi_read(AVI->fdes,audbuf+nr,todo) != todo) + { + AVI_errno = AVI_ERR_READ; + return -1; + } + bytes -= todo; + nr += todo; + AVI->track[AVI->aptr].audio_posb += todo; + } + + return nr; +} + +/* AVI_read_data: Special routine for reading the next audio or video chunk + without having an index of the file. */ + +int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, + char *audbuf, long max_audbuf, + long *len) +{ + +/* + * Return codes: + * + * 1 = video data read + * 2 = audio data read + * 0 = reached EOF + * -1 = video buffer too small + * -2 = audio buffer too small + */ + + int n; + char data[8]; + + if(AVI->mode==AVI_MODE_WRITE) return 0; + + while(1) + { + /* Read tag and length */ + + if( avi_read(AVI->fdes,data,8) != 8 ) return 0; + + /* if we got a list tag, ignore it */ + + if(strncasecmp(data,"LIST",4) == 0) + { + lseek(AVI->fdes,4,SEEK_CUR); + continue; + } + + n = PAD_EVEN(str2ulong((unsigned char *)data+4)); + + if(strncasecmp(data,AVI->video_tag,3) == 0) + { + *len = n; + AVI->video_pos++; + if(n>max_vidbuf) + { + lseek(AVI->fdes,n,SEEK_CUR); + return -1; + } + if(avi_read(AVI->fdes,vidbuf,n) != n ) return 0; + return 1; + } + else if(strncasecmp(data,AVI->track[AVI->aptr].audio_tag,4) == 0) + { + *len = n; + if(n>max_audbuf) + { + lseek(AVI->fdes,n,SEEK_CUR); + return -2; + } + if(avi_read(AVI->fdes,audbuf,n) != n ) return 0; + return 2; + break; + } + else + if(lseek(AVI->fdes,n,SEEK_CUR)<0) return 0; + } +} + +/* AVI_print_error: Print most recent error (similar to perror) */ + +char *(avi_errors[]) = +{ + /* 0 */ "avilib - No Error", + /* 1 */ "avilib - AVI file size limit reached", + /* 2 */ "avilib - Error opening AVI file", + /* 3 */ "avilib - Error reading from AVI file", + /* 4 */ "avilib - Error writing to AVI file", + /* 5 */ "avilib - Error writing index (file may still be useable)", + /* 6 */ "avilib - Error closing AVI file", + /* 7 */ "avilib - Operation (read/write) not permitted", + /* 8 */ "avilib - Out of memory (malloc failed)", + /* 9 */ "avilib - Not an AVI file", + /* 10 */ "avilib - AVI file has no header list (corrupted?)", + /* 11 */ "avilib - AVI file has no MOVI list (corrupted?)", + /* 12 */ "avilib - AVI file has no video data", + /* 13 */ "avilib - operation needs an index", + /* 14 */ "avilib - Unkown Error" +}; +static int num_avi_errors = sizeof(avi_errors)/sizeof(char*); + +static char error_string[4096]; + +void AVI_print_error(char *str) +{ + int aerrno; + + aerrno = (AVI_errno>=0 && AVI_errno=0 && AVI_errno + * + * This file is part of transcode, a linux video stream processing tool + * + * transcode 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, or (at your option) + * any later version. + * + * transcode 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AVILIB_H +#define AVILIB_H + +#define AVI_MAX_TRACKS 8 + +typedef struct +{ + unsigned long key; + unsigned long pos; + unsigned long len; +} video_index_entry; + +typedef struct +{ + unsigned long pos; + unsigned long len; + unsigned long tot; +} audio_index_entry; + +typedef struct track_s +{ + + long a_fmt; /* Audio format, see #defines below */ + long a_chans; /* Audio channels, 0 for no audio */ + long a_rate; /* Rate in Hz */ + long a_bits; /* bits per audio sample */ + long mp3rate; /* mp3 bitrate kbs*/ + + long audio_strn; /* Audio stream number */ + long audio_bytes; /* Total number of bytes of audio data */ + long audio_chunks; /* Chunks of audio data in the file */ + + char audio_tag[4]; /* Tag of audio data */ + long audio_posc; /* Audio position: chunk */ + long audio_posb; /* Audio position: byte within chunk */ + + long a_codech_off; /* absolut offset of audio codec information */ + long a_codecf_off; /* absolut offset of audio codec information */ + + audio_index_entry *audio_index; + +} track_t; + +typedef struct +{ + + long fdes; /* File descriptor of AVI file */ + long mode; /* 0 for reading, 1 for writing */ + + long width; /* Width of a video frame */ + long height; /* Height of a video frame */ + double fps; /* Frames per second */ + char compressor[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ + char compressor2[8]; /* Type of compressor, 4 bytes + padding for 0 byte */ + long video_strn; /* Video stream number */ + long video_frames; /* Number of video frames */ + char video_tag[4]; /* Tag of video data */ + long video_pos; /* Number of next frame to be read + (if index present) */ + + unsigned long max_len; /* maximum video chunk present */ + + track_t track[AVI_MAX_TRACKS]; // up to AVI_MAX_TRACKS audio tracks supported + + unsigned long pos; /* position in file */ + long n_idx; /* number of index entries actually filled */ + long max_idx; /* number of index entries actually allocated */ + + long v_codech_off; /* absolut offset of video codec (strh) info */ + long v_codecf_off; /* absolut offset of video codec (strf) info */ + + unsigned char (*idx)[16]; /* index entries (AVI idx1 tag) */ + video_index_entry *video_index; + + unsigned long last_pos; /* Position of last frame written */ + unsigned long last_len; /* Length of last frame written */ + int must_use_index; /* Flag if frames are duplicated */ + unsigned long movi_start; + + int anum; // total number of audio tracks + int aptr; // current audio working track + +} avi_t; + +#define AVI_MODE_WRITE 0 +#define AVI_MODE_READ 1 + +/* The error codes delivered by avi_open_input_file */ + +#define AVI_ERR_SIZELIM 1 /* The write of the data would exceed + the maximum size of the AVI file. + This is more a warning than an error + since the file may be closed safely */ + +#define AVI_ERR_OPEN 2 /* Error opening the AVI file - wrong path + name or file nor readable/writable */ + +#define AVI_ERR_READ 3 /* Error reading from AVI File */ + +#define AVI_ERR_WRITE 4 /* Error writing to AVI File, + disk full ??? */ + +#define AVI_ERR_WRITE_INDEX 5 /* Could not write index to AVI file + during close, file may still be + usable */ + +#define AVI_ERR_CLOSE 6 /* Could not write header to AVI file + or not truncate the file during close, + file is most probably corrupted */ + +#define AVI_ERR_NOT_PERM 7 /* Operation not permitted: + trying to read from a file open + for writing or vice versa */ + +#define AVI_ERR_NO_MEM 8 /* malloc failed */ + +#define AVI_ERR_NO_AVI 9 /* Not an AVI file */ + +#define AVI_ERR_NO_HDRL 10 /* AVI file has no has no header list, + corrupted ??? */ + +#define AVI_ERR_NO_MOVI 11 /* AVI file has no has no MOVI list, + corrupted ??? */ + +#define AVI_ERR_NO_VIDS 12 /* AVI file contains no video data */ + +#define AVI_ERR_NO_IDX 13 /* The file has been opened with + getIndex==0, but an operation has been + performed that needs an index */ + +/* Possible Audio formats */ + +#ifndef WAVE_FORMAT_PCM +#define WAVE_FORMAT_UNKNOWN (0x0000) +#define WAVE_FORMAT_PCM (0x0001) +#define WAVE_FORMAT_ADPCM (0x0002) +#define WAVE_FORMAT_IBM_CVSD (0x0005) +#define WAVE_FORMAT_ALAW (0x0006) +#define WAVE_FORMAT_MULAW (0x0007) +#define WAVE_FORMAT_OKI_ADPCM (0x0010) +#define WAVE_FORMAT_DVI_ADPCM (0x0011) +#define WAVE_FORMAT_DIGISTD (0x0015) +#define WAVE_FORMAT_DIGIFIX (0x0016) +#define WAVE_FORMAT_YAMAHA_ADPCM (0x0020) +#define WAVE_FORMAT_DSP_TRUESPEECH (0x0022) +#define WAVE_FORMAT_GSM610 (0x0031) +#define IBM_FORMAT_MULAW (0x0101) +#define IBM_FORMAT_ALAW (0x0102) +#define IBM_FORMAT_ADPCM (0x0103) +#endif + +avi_t* AVI_open_output_file(char * filename); +void AVI_set_video(avi_t *AVI, int width, int height, double fps, char *compressor); +void AVI_set_audio(avi_t *AVI, int channels, long rate, int bits, int format, long mp3rate); +int AVI_write_frame(avi_t *AVI, char *data, long bytes, int keyframe); +int AVI_dup_frame(avi_t *AVI); +int AVI_write_audio(avi_t *AVI, char *data, long bytes); +int AVI_append_audio(avi_t *AVI, char *data, long bytes); +long AVI_bytes_remain(avi_t *AVI); +int AVI_close(avi_t *AVI); +long AVI_bytes_written(avi_t *AVI); + +avi_t *AVI_open_input_file(char *filename, int getIndex); +avi_t *AVI_open_fd(int fd, int getIndex); +int avi_parse_input_file(avi_t *AVI, int getIndex); +long AVI_audio_mp3rate(avi_t *AVI); +long AVI_video_frames(avi_t *AVI); +int AVI_video_width(avi_t *AVI); +int AVI_video_height(avi_t *AVI); +double AVI_frame_rate(avi_t *AVI); +char* AVI_video_compressor(avi_t *AVI); + +int AVI_audio_channels(avi_t *AVI); +int AVI_audio_bits(avi_t *AVI); +int AVI_audio_format(avi_t *AVI); +long AVI_audio_rate(avi_t *AVI); +long AVI_audio_bytes(avi_t *AVI); +long AVI_audio_chunks(avi_t *AVI); + +long AVI_max_video_chunk(avi_t *AVI); + +long AVI_frame_size(avi_t *AVI, long frame); +long AVI_audio_size(avi_t *AVI, long frame); +int AVI_seek_start(avi_t *AVI); +int AVI_set_video_position(avi_t *AVI, long frame); +long AVI_get_video_position(avi_t *AVI, long frame); +long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe); + +int AVI_set_audio_position(avi_t *AVI, long byte); +int AVI_set_audio_bitrate(avi_t *AVI, long bitrate); + +long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes); + +long AVI_audio_codech_offset(avi_t *AVI); +long AVI_audio_codecf_offset(avi_t *AVI); +long AVI_video_codech_offset(avi_t *AVI); +long AVI_video_codecf_offset(avi_t *AVI); + +int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, + char *audbuf, long max_audbuf, + long *len); + +void AVI_print_error(char *str); +char *AVI_strerror(); +char *AVI_syserror(); + +int AVI_scan(char *name); +int AVI_dump(char *name, int mode); + +char *AVI_codec2str(short cc); +int AVI_file_check(char *import_file); + +void AVI_info(avi_t *avifile); +uint64_t AVI_max_size(); +int avi_update_header(avi_t *AVI); + +int AVI_set_audio_track(avi_t *AVI, int track); +int AVI_get_audio_track(avi_t *AVI); +int AVI_audio_tracks(avi_t *AVI); + + +struct riff_struct +{ + unsigned char id[4]; /* RIFF */ + unsigned long len; + unsigned char wave_id[4]; /* WAVE */ +}; + + +struct chunk_struct +{ + unsigned char id[4]; + unsigned long len; +}; + +struct common_struct +{ + unsigned short wFormatTag; + unsigned short wChannels; + unsigned long dwSamplesPerSec; + unsigned long dwAvgBytesPerSec; + unsigned short wBlockAlign; + unsigned short wBitsPerSample; /* Only for PCM */ +}; + +struct wave_header +{ + struct riff_struct riff; + struct chunk_struct format; + struct common_struct common; + struct chunk_struct data; +}; + + + +struct AVIStreamHeader { + long fccType; + long fccHandler; + long dwFlags; + long dwPriority; + long dwInitialFrames; + long dwScale; + long dwRate; + long dwStart; + long dwLength; + long dwSuggestedBufferSize; + long dwQuality; + long dwSampleSize; +}; + +#endif diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/outfile.vp3 b/libs/libtheora-1.1/win32/experimental/transcoder/avi2vp3/outfile.vp3 new file mode 100644 index 0000000000000000000000000000000000000000..ed74aa99cec181f27f347d4182f56f868105e460 GIT binary patch literal 233132 zcmdSA^LJ)V)A$?Pn2F7aZQIV3WMbR8V$8(0ZQHhO+qQG==Y8(?d+;BeT6^{Gz51uF zUG-U2)m=jBQq1a#EKJHo02XFOB1vXeMj~-$E-ntne}tRqKO-X}k(51=5FhMj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etS`*uqW;qj#Y_8Z`HM>g)cGj_7K7%27r5wrT6+=d zo6?(J!Fs)`Ty&nFc@1;50xmi)#}r~7avkQAIuF?0Q7vB9`@;i{X*&aJy@^&nXNZA-sk@?Z|lYW!uz2AQ~q@Ov0nWfci=qB`up%5^ZFlL z^gO4T!$bA;gy9X`&#?8{0*A$)=VR7imI&4-i}KKZOAyCALV}0Z&jJpM^!_#+#v7gDRA;zIZH;2!Aze@Os}k9`kBd z9^p~_uzn)um6Lb_=R-E$5_KMdBi=86sv1}?tI0#phkRyW?hHTe3P-e`{X%#iv6v0x z9sb*2jS1G5FT(2+yBPD`@BxrmDj$WVm`hsl2KqCbzmYW$J)hEr4^z74m_37+jxju<3kS*7L{;ikoa0;Qt3y C6oyU! literal 0 HcmV?d00001 diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/readme.txt b/libs/libtheora-1.1/win32/experimental/transcoder/readme.txt new file mode 100644 index 00000000..4f106ce1 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/transcoder/readme.txt @@ -0,0 +1,17 @@ +Quick hack at a transcoder tool from VP3 to Theora + +I actually built the avi2vp3 tool with codeWarrior, but it should compile under +VC as well. I have included a source avi file and the converted .vp3 output. +Output is a file with some header info matching YUVMPEG, and for each frame: + +FRAME header block matching YUV2MPEG +long (Intel aligned) keyframeflag describing in frame is a keyframe +long (Intel aligned) fsize storing frame size in bytes +bytes[fsize] with binary frame data + +The transcode tool is a modification of the current encoder. PUt it into the +win32/experimental subdirectory, and the paths should be correct. It produces +an apparently valid theora stream, but outputs garbage data. The code is packing +the binary frame data in a way that SHOULD work at least imo, but I am probably +missing some initialization issue (or vp3 is not transcodable to theora). + diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/transcoder.dsp b/libs/libtheora-1.1/win32/experimental/transcoder/transcoder.dsp new file mode 100644 index 00000000..863908b3 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/transcoder/transcoder.dsp @@ -0,0 +1,121 @@ +# Microsoft Developer Studio Project File - Name="transcoder" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=transcoder - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "transcoder.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "transcoder.mak" CFG="transcoder - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "transcoder - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "transcoder - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "transcoder - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D GETOPT_API= /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static.lib ogg_static.lib vorbis_static.lib vorbisenc_static.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMT" /out:"transcoder.exe" /libpath:"..\..\Static_Release" /libpath:"..\..\..\..\ogg\win32\Static_Release" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Release" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Release" + +!ELSEIF "$(CFG)" == "transcoder - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /I "..\..\..\..\vorbis\include" /I "..\..\..\..\ogg\include" /I "..\wincompat" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D GETOPT_API= /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib theora_static_d.lib ogg_static_d.lib vorbis_static_d.lib vorbisenc_static_d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCD" /out:"transcoder.exe" /pdbtype:sept /libpath:"..\..\Static_Debug" /libpath:"..\..\..\..\ogg\win32\Static_Debug" /libpath:"..\..\..\..\vorbis\win32\Vorbis_Static_Debug" /libpath:"..\..\..\..\vorbis\win32\VorbisEnc_Static_Debug" +# SUBTRACT LINK32 /nodefaultlib + +!ENDIF + +# Begin Target + +# Name "transcoder - Win32 Release" +# Name "transcoder - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\wincompat\getopt.c +# End Source File +# Begin Source File + +SOURCE=..\wincompat\getopt_long.c +# End Source File +# Begin Source File + +SOURCE=.\transcoder_example.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# Begin Group "library" + +# PROP Default_Filter "" +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/libs/libtheora-1.1/win32/experimental/transcoder/transcoder_example.c b/libs/libtheora-1.1/win32/experimental/transcoder/transcoder_example.c new file mode 100644 index 00000000..7c2dcbf8 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/transcoder/transcoder_example.c @@ -0,0 +1,926 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2004 * + * by the Xiph.Org Foundation http://www.xiph.org/ * + * * + ******************************************************************** + + function: example encoder application; makes an Ogg Theora/Vorbis + file from YUV4MPEG2 and WAV input + last mod: $Id: transcoder_example.c,v 1.4 2004/03/20 00:14:04 tterribe Exp $ + + ********************************************************************/ + +#define _GNU_SOURCE +#define _REENTRANT +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include +#include +#include +#include +#include +#include "theora/theora.h" +#include "vorbis/codec.h" +#include "vorbis/vorbisenc.h" + +#ifdef _WIN32 +/*supply missing headers and functions to Win32. going to hell, I know*/ +#include +#include + +static double rint(double x) +{ + if (x < 0.0) + return (double)(int)(x - 0.5); + else + return (double)(int)(x + 0.5); +} +#endif + +/*Copied from vorbis/sharedbook.c*/ +static int _ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + + +const char *optstring = "o:a:A:v:V:"; +struct option options [] = { + {"output",required_argument,NULL,'o'}, + {"audio-rate-target",required_argument,NULL,'A'}, + {"video-rate-target",required_argument,NULL,'V'}, + {"audio-quality",required_argument,NULL,'a'}, + {"video-quality",required_argument,NULL,'v'}, + {NULL,0,NULL,0} +}; + +typedef struct TC_INSTANCE { + ogg_uint32_t LastKeyFrame ; + ogg_int64_t KeyFrameCount; + int ThisIsFirstFrame; + int ThisIsKeyFrame; + ogg_uint32_t CurrentFrame; + ogg_int64_t granulepos; + int keyframe_granule_shift; + char * in_bytes; + long in_bytecount; + ogg_uint32_t fps_denominator; + ogg_uint32_t fps_numerator; + oggpack_buffer opb_in; + oggpack_buffer opb_out; +} TC_INSTANCE; + +/* You'll go to Hell for using globals. */ + +FILE *audio=NULL; +FILE *video=NULL; + +int audio_ch=0; +int audio_hz=0; + +float audio_q=.1; +int audio_r=-1; + +int video_x=0; +int video_y=0; +int frame_x=0; +int frame_y=0; +int frame_x_offset=0; +int frame_y_offset=0; +int video_hzn=0; +int video_hzd=0; +int video_an=0; +int video_ad=0; + +int video_r=-1; +int video_q=16; + + char *vp3frame[2]; + int framebytecount[2]; + int frameiskey[2]; + + ogg_page audiopage; + ogg_page videopage; + +static void usage(void){ + fprintf(stderr, + "Usage: encoder_example [options] [audio_file] video_file\n\n" + "Options: \n\n" + " -o --output file name for encoded output;\n" + " If this option is not given, the\n" + " compressed data is sent to stdout.\n\n" + " -A --audio-rate-target bitrate target for Vorbis audio;\n" + " use -a and not -A if at all possible,\n" + " as -a gives higher quality for a given\n" + " bitrate.\n\n" + " -V --video-rate-target bitrate target for Theora video\n\n" + " -a --audio-quality Vorbis quality selector from -1 to 10\n" + " (-1 yields smallest files but lowest\n" + " fidelity; 10 yields highest fidelity\n" + " but large files. '2' is a reasonable\n" + " default).\n\n" + " -v --video-quality Theora quality selector fro 0 to 10\n" + " (0 yields smallest files but lowest\n" + " video quality. 10 yields highest\n" + " fidelity but large files).\n\n" + "encoder_example accepts only uncompressed RIFF WAV format audio and\n" + "YUV4MPEG2 uncompressed video.\n\n"); + exit(1); +} + +static void id_file(char *f){ + FILE *test; + unsigned char buffer[80]; + int ret; + + /* open it, look for magic */ + + if(!strcmp(f,"-")){ + /* stdin */ + test=stdin; + }else{ + test=fopen(f,"rb"); + if(!test){ + fprintf(stderr,"Unable to open file %s.\n",f); + exit(1); + } + } + + ret=fread(buffer,1,4,test); + if(ret<4){ + fprintf(stderr,"EOF determining file type of file %s.\n",f); + exit(1); + } + + if(!memcmp(buffer,"RIFF",4)){ + /* possible WAV file */ + + if(audio){ + /* umm, we already have one */ + fprintf(stderr,"Multiple RIFF WAVE files specified on command line.\n"); + exit(1); + } + + /* Parse the rest of the header */ + + ret=fread(buffer,1,4,test); + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp(buffer,"WAVE",4)){ + + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("fmt",buffer,3)){ + + /* OK, this is our audio specs chunk. Slurp it up. */ + + ret=fread(buffer,1,20,test); + if(ret<20)goto riff_err; + + if(memcmp(buffer+4,"\001\000",2)){ + fprintf(stderr,"The WAV file %s is in a compressed format; " + "can't read it.\n",f); + exit(1); + } + + audio=test; + audio_ch=buffer[6]+(buffer[7]<<8); + audio_hz=buffer[8]+(buffer[9]<<8)+ + (buffer[10]<<16)+(buffer[11]<<24); + + if(buffer[18]+(buffer[19]<<8)!=16){ + fprintf(stderr,"Can only read 16 bit WAV files for now.\n"); + exit(1); + } + + /* Now, align things to the beginning of the data */ + /* Look for 'dataxxxx' */ + while(!feof(test)){ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + if(!memcmp("data",buffer,4)){ + /* We're there. Ignore the declared size for now. */ + ret=fread(buffer,1,4,test); + if(ret<4)goto riff_err; + + fprintf(stderr,"File %s is 16 bit %d channel %d Hz RIFF WAV audio.\n", + f,audio_ch,audio_hz); + + return; + } + } + } + } + } + + fprintf(stderr,"Couldn't find WAVE data in RIFF file %s.\n",f); + exit(1); + + } + if(!memcmp(buffer,"AVI2",4)){ + /* possible AVI2VP31 format file */ + /* read until newline, or 80 cols, whichever happens first */ + int i; + for(i=0;i<79;i++){ + ret=fread(buffer+i,1,1,test); + if(ret<1)goto yuv_err; + if(buffer[i]=='\n')break; + } + if(i==79){ + fprintf(stderr,"Error parsing %s header; not a VP31 raw frames file?\n",f); + } + buffer[i]='\0'; + + if(!memcmp(buffer,"VP31",4)){ + char interlace; + + if(video){ + /* umm, we already have one */ + fprintf(stderr,"Multiple video files specified on command line.\n"); + exit(1); + } + + if(buffer[4]!='R'){ + fprintf(stderr,"Incorrect file ; VP31 raw frames required.\n"); + } + + ret=sscanf(buffer,"VP31R W%d H%d F%d:%d I%c A%d:%d", + &frame_x,&frame_y,&video_hzn,&video_hzd,&interlace, + &video_an,&video_ad); + if(ret<7){ + fprintf(stderr,"Error parsing AVI2VP31R header in file %s.\n",f); + exit(1); + } + + if(interlace!='p'){ + fprintf(stderr,"Input video is interlaced; Theora handles only progressive scan\n"); + exit(1); + } + + video=test; + + fprintf(stderr,"File %s is %dx%d %.02f fps VP31 video.\n", + f,frame_x,frame_y,(double)video_hzn/video_hzd); + + return; + } + } + fprintf(stderr,"Input file %s is neither a WAV nor VP31 file.\n",f); + exit(1); + + riff_err: + fprintf(stderr,"EOF parsing RIFF file %s.\n",f); + exit(1); + yuv_err: + fprintf(stderr,"EOF parsing VP31 file %s.\n",f); + exit(1); + +} + +int spinner=0; +char *spinascii="|/-\\"; +void spinnit(void){ + spinner++; + if(spinner==4)spinner=0; + fprintf(stderr,"\r%c",spinascii[spinner]); +} + +int fetch_and_process_audio(FILE *audio,ogg_page *audiopage, + ogg_stream_state *vo, + vorbis_dsp_state *vd, + vorbis_block *vb, + int audioflag){ + ogg_packet op; + int i,j; + + while(audio && !audioflag){ + /* process any audio already buffered */ + spinnit(); + if(ogg_stream_pageout(vo,audiopage)>0) return 1; + if(ogg_stream_eos(vo))return 0; + + { + /* read and process more audio */ + signed char readbuffer[4096]; + int toread=4096/2/audio_ch; + int bytesread=fread(readbuffer,1,toread*2*audio_ch,audio); + int sampread=bytesread/2/audio_ch; + float **vorbis_buffer; + int count=0; + + if(bytesread<=0){ + /* end of file. this can be done implicitly, but it's + easier to see here in non-clever fashion. Tell the + library we're at end of stream so that it can handle the + last frame and mark end of stream in the output properly */ + vorbis_analysis_wrote(vd,0); + }else{ + vorbis_buffer=vorbis_analysis_buffer(vd,sampread); + /* uninterleave samples */ + for(i=0;iin_bytecount; + + if(!bytes)return(0); + + op->packet=ttc->in_bytes; + op->bytes=bytes; + op->b_o_s=0; + op->e_o_s=last_p; + + op->packetno=ttc->CurrentFrame; + op->granulepos=ttc->granulepos; + + return 1; +} + +void TranscodeKeyFrame(TC_INSTANCE *ttc){ + /* Keep track of the total number of Key Frames Coded */ + ttc->KeyFrameCount += 1; + ttc->LastKeyFrame = 1; +} + +void TranscodeFrame(TC_INSTANCE *ttc){ + ttc->LastKeyFrame++; +} + +void TranscodeFirstFrame(TC_INSTANCE *ttc){ + /* Keep track of the total number of Key Frames Coded. */ + ttc->KeyFrameCount = 1; + ttc->LastKeyFrame = 1; +} + +int theora_transcode_bufferin( TC_INSTANCE *ttc, int isKeyFrame, char * bytes, int bytecount){ + + /*transcode: record keyframe flag*/ + ttc->ThisIsKeyFrame = isKeyFrame; + + /* Special case for first frame */ + if ( ttc->ThisIsFirstFrame ){ + ttc->ThisIsFirstFrame = 0; + ttc->ThisIsKeyFrame = 0; + } else if ( ttc->ThisIsKeyFrame ) { + TranscodeKeyFrame(ttc); + ttc->ThisIsKeyFrame = 0; + } else { + /* Compress the frame. */ + TranscodeFrame( ttc ); + } + /*need to pack info here*/ + { + + int frame_type; + long total_bits; + long total_words; + int frac_bits; + + oggpackB_readinit(&ttc->opb_in,bytes,bytecount); + oggpackB_reset(&ttc->opb_out); + + /*Mark as video frame.*/ + oggpackB_write(&ttc->opb_out,0,1); + /*Copy frame type.*/ + frame_type=oggpackB_read1(&ttc->opb_in); + oggpackB_write(&ttc->opb_out,frame_type,1); + /*Skip an unused bit in the VP32 header.*/ + oggpackB_adv1(&ttc->opb_in); + /*Copy Q multiplier.*/ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,6),6); + /*VP3 has no per-block Q multipliers*/ + oggpackB_write(&ttc->opb_out,0,1); + /*If the frame is a base/key/golden frame, copy a few extra bits.*/ + if(frame_type==0){ + /*These 13 bits are not included in a Theora frame header. + They were 0's and VP3 version info in VP32.*/ + oggpackB_adv(&ttc->opb_in,13); + /*Copy the key frame type and the spare configuration bits.*/ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,3),3); + } + + /*Copy the rest of the bits over.*/ + total_bits=bytecount*8-oggpack_bits(&ttc->opb_in); + frac_bits=(int)(total_bits&31); + if(frac_bits){ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,frac_bits), + frac_bits); + } + total_words=total_bits>>5; + while(total_words-->0){ + oggpackB_write(&ttc->opb_out,oggpackB_read(&ttc->opb_in,32),32); + } + + ttc->in_bytecount = oggpackB_bytes(&ttc->opb_out); + ttc->in_bytes = oggpackB_get_buffer(&ttc->opb_out); + } + + /* Update stats variables. */ + ttc->CurrentFrame++; + + ttc->granulepos= + ((ttc->CurrentFrame-ttc->LastKeyFrame-1)<keyframe_granule_shift)+ + ttc->LastKeyFrame-1; + + return 0; +} + +//static void _tp_writebuffer(oggpack_buffer *opb, const char *buf, const long len) + +int theora_transcoder_init(theora_info * ti, TC_INSTANCE * ttc){ + memset(ttc, 0, sizeof(*ttc)); + ttc->granulepos = -1; + ttc->keyframe_granule_shift=_ilog(ti->keyframe_frequency_force-1); + ttc->LastKeyFrame = 0; + ttc->KeyFrameCount = 0; + ttc->ThisIsFirstFrame = 1; + ttc->ThisIsKeyFrame = 0; + ttc->CurrentFrame = 1; + ttc->in_bytes = 0; + ttc->in_bytecount = 0; + ttc->fps_denominator = ti->fps_denominator; + ttc->fps_numerator = ti->fps_numerator; + oggpackB_writeinit(&ttc->opb_out); + return 0; +} + +int fetch_and_process_video(FILE *video,ogg_page *videopage, + ogg_stream_state *to, + TC_INSTANCE *ttc, + int videoflag){ + /* You'll go to Hell for using static variables */ + static int state=-1; + ogg_packet op; + int i; + int keyframeflag, framelength; + + + if(state==-1){ + /* initialize the double frame buffer */ + state=0; + } + + /* is there a video page flushed? If not, work until there is. */ + while(!videoflag){ + spinnit(); + + if(ogg_stream_pageout(to,videopage)>0) return 1; + if(ogg_stream_eos(to)) return 0; + + { + /* read and process more video */ + /* video strategy reads one frame ahead so we know when we're + at end of stream and can mark last video frame as such + (vorbis audio has to flush one frame past last video frame + due to overlap and thus doesn't need this extra work */ + + /* have two frame buffers full (if possible) before + proceeding. after first pass and until eos, one will + always be full when we get here */ + + for(i=state;i<2;i++){ + char c,frame[6]; + int ret=fread(frame,1,6,video); + + /* match and skip the frame header */ + if(ret<6)break; + if(memcmp(frame,"FRAME",5)){ + fprintf(stderr,"Loss of framing in VP31 input data\n"); + exit(1); + } + if(frame[5]!='\n'){ + int j; + for(j=0;j<79;j++) + if(fread(&c,1,1,video)&&c=='\n')break; + if(j==79){ + fprintf(stderr,"Error parsing VP31 frame header\n"); + exit(1); + } + } + + /*read the length*/ + ret=fread(&framelength, sizeof(int), 1, video); + + /*read the keyframeflag*/ + ret=fread(&keyframeflag, sizeof(int), 1, video); + + vp3frame[i] = malloc(framelength); + framebytecount[i] = framelength; + frameiskey[i] = keyframeflag; + + /* read the frame */ + ret=fread((char *) vp3frame[i], sizeof(char), framelength, video); + if(ret!=framelength) break; + + state++; + } + + if(state<1){ + /* can't get here unless VP31 stream has no video */ + fprintf(stderr,"Video input contains no frames.\n"); + exit(1); + } + + /* Theora is a one-frame-in,one-frame-out system; submit a frame + for compression and pull out the packet */ + + //theora_encode_YUVin(td,&yuv); + theora_transcode_bufferin( ttc, frameiskey[0], vp3frame[0], framebytecount[0]); + + /* if there's only one frame, it's the last in the stream */ + if(state<2) + theora_transcode_packetout(ttc,1,&op); + else + theora_transcode_packetout(ttc,0,&op); + + ogg_stream_packetin(to,&op); + + { + signed char *temp=vp3frame[0]; + vp3frame[0]=vp3frame[1]; + vp3frame[1] = temp; + free(temp); + + framebytecount[0]= framebytecount[1]; + frameiskey[0] = frameiskey[1]; + state--; + } + } + } + return videoflag; +} + +/* returns, in seconds, absolute time of current packet in given + logical stream */ +double transcode_granule_time(TC_INSTANCE *ttc,ogg_int64_t granulepos){ + if(granulepos>=0){ + ogg_int64_t iframe=granulepos>>ttc->keyframe_granule_shift; + ogg_int64_t pframe=granulepos-(iframe<keyframe_granule_shift); + + return (iframe+pframe)* + ((double)ttc->fps_denominator/ttc->fps_numerator); + + } + return(-1); +} + +int main(int argc,char *argv[]){ + int c,long_option_index,ret; + + ogg_stream_state to; /* take physical pages, weld into a logical + stream of packets */ + ogg_stream_state vo; /* take physical pages, weld into a logical + stream of packets */ + ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */ + ogg_packet op; /* one raw packet of data for decode */ + + theora_state td; + theora_info ti; + theora_comment tc; + + vorbis_info vi; /* struct that stores all the static vorbis bitstream + settings */ + vorbis_comment vc; /* struct that stores all the user comments */ + + vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ + vorbis_block vb; /* local working space for packet->PCM decode */ + + int audioflag=0; + int videoflag=0; + int akbps=0; + int vkbps=0; + + ogg_int64_t audio_bytesout=0; + ogg_int64_t video_bytesout=0; + double timebase; + + FILE* outfile = stdout; + + TC_INSTANCE ttc; + +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ + /* if we were reading/writing a file, it would also need to in + binary mode, eg, fopen("file.wav","wb"); */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + + while((c=getopt_long(argc,argv,optstring,options,&long_option_index))!=EOF){ + switch(c){ + case 'o': + outfile=fopen(optarg,"wb"); + if(outfile==NULL){ + fprintf(stderr,"Unable to open output file '%s'\n", optarg); + exit(1); + } + break;; + + case 'a': + audio_q=atof(optarg)*.099; + if(audio_q<-.1 || audio_q>1){ + fprintf(stderr,"Illegal audio quality (choose -1 through 10)\n"); + exit(1); + } + audio_r=-1; + break; + + case 'v': + video_q=rint(atof(optarg)*6.3); + if(video_q<0 || video_q>63){ + fprintf(stderr,"Illegal video quality (choose 0 through 10)\n"); + exit(1); + } + video_r=0; + break; + + case 'A': + audio_r=atof(optarg)*1000; + if(audio_q<0){ + fprintf(stderr,"Illegal audio quality (choose > 0 please)\n"); + exit(1); + } + audio_q=-99; + break; + + case 'V': + video_r=rint(atof(optarg)*1000); + if(video_r<45000 || video_r>2000000){ + fprintf(stderr,"Illegal video bitrate (choose 45kbps through 2000kbps)\n"); + exit(1); + } + video_q=0; + break; + default: + usage(); + } + } + + while(optind>4)<<4; + video_y=((frame_y + 15) >>4)<<4; + frame_x_offset=(video_x-frame_x)/2; + frame_y_offset=(video_y-frame_y)/2; + + theora_info_init(&ti); + ti.width=video_x; + ti.height=video_y; + ti.frame_width=frame_x; + ti.frame_height=frame_y; + ti.offset_x=frame_x_offset; + ti.offset_y=frame_y_offset; + ti.fps_numerator=video_hzn; + ti.fps_denominator=video_hzd; + ti.aspect_numerator=video_an; + ti.aspect_denominator=video_ad; + ti.colorspace=OC_CS_UNSPECIFIED; + ti.target_bitrate=video_r; + ti.quality=video_q; + + ti.dropframes_p=0; + ti.quick_p=1; + ti.keyframe_auto_p=1; + ti.keyframe_frequency=32768; + ti.keyframe_frequency_force=32768; + ti.keyframe_data_target_bitrate=video_r*1.5; + ti.keyframe_auto_threshold=80; + ti.keyframe_mindistance=8; + ti.noise_sensitivity=1; + + theora_encode_init(&td,&ti); + theora_transcoder_init(&ti, &ttc); + theora_info_clear(&ti); + + /* initialize Vorbis too, assuming we have audio to compress. */ + if(audio){ + vorbis_info_init(&vi); + if(audio_q>-99) + ret = vorbis_encode_init_vbr(&vi,audio_ch,audio_hz,audio_q); + else + ret = vorbis_encode_init(&vi,audio_ch,audio_hz,-1,audio_r,-1); + if(ret){ + fprintf(stderr,"The Vorbis encoder could not set up a mode according to\n" + "the requested quality or bitrate.\n\n"); + exit(1); + } + + vorbis_comment_init(&vc); + vorbis_analysis_init(&vd,&vi); + vorbis_block_init(&vd,&vb); + } + + /* write the bitstream header packets with proper page interleave */ + + /* first packet will get its own page automatically */ + theora_encode_header(&td,&op); + ogg_stream_packetin(&to,&op); + if(ogg_stream_pageout(&to,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + + /* create the remaining theora headers */ + theora_comment_init(&tc); + theora_encode_comment(&tc,&op); + ogg_stream_packetin(&to,&op); + theora_encode_tables(&td,&op); + ogg_stream_packetin(&to,&op); + + if(audio){ + ogg_packet header; + ogg_packet header_comm; + ogg_packet header_code; + + vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); + ogg_stream_packetin(&vo,&header); /* automatically placed in its own + page */ + if(ogg_stream_pageout(&vo,&og)!=1){ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + + /* remaining vorbis header packets */ + ogg_stream_packetin(&vo,&header_comm); + ogg_stream_packetin(&vo,&header_code); + } + + /* Flush the rest of our headers. This ensures + the actual data in each stream will start + on a new page, as per spec. */ + while(1){ + int result = ogg_stream_flush(&to,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + if(audio){ + while(1){ + int result=ogg_stream_flush(&vo,&og); + if(result<0){ + /* can't get here */ + fprintf(stderr,"Internal Ogg library error.\n"); + exit(1); + } + if(result==0)break; + fwrite(og.header,1,og.header_len,outfile); + fwrite(og.body,1,og.body_len,outfile); + } + } + + /* setup complete. Raw processing loop */ + fprintf(stderr,"Compressing....\n"); + while(1){ + + + /* is there an audio page flushed? If not, fetch one if possible */ + audioflag=fetch_and_process_audio(audio,&audiopage,&vo,&vd,&vb,audioflag); + + /* is there a video page flushed? If not, fetch one if possible */ + videoflag=fetch_and_process_video(video,&videopage,&to,&ttc,videoflag); + + /* no pages of either? Must be end of stream. */ + if(!audioflag && !videoflag)break; + + /* which is earlier; the end of the audio page or the end of the + video page? Flush the earlier to stream */ + { + int audio_or_video=-1; + double audiotime= + audioflag?vorbis_granule_time(&vd,ogg_page_granulepos(&audiopage)):-1; + double videotime= + videoflag?transcode_granule_time(&ttc,ogg_page_granulepos(&videopage)):-1; + + if(!audioflag){ + audio_or_video=1; + } else if(!videoflag) { + audio_or_video=0; + } else { + if(audiotime +//__FBSDID("$FreeBSD: src/lib/libc/stdlib/getopt.c,v 1.6 2002/03/29 22:43:42 markm Exp $"); + +#include "namespace.h"*/ +#include +#include +#include +/*#include "un-namespace.h"*/ + +/*#include "libc_private.h"*/ + +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define BADARG (int)':' +#define EMSG "" + +/* + * getopt -- + * Parse argc/argv argument vector. + */ +int +getopt(nargc, nargv, ostr) + int nargc; + char * const *nargv; + const char *ostr; +{ + static char *place = EMSG; /* option letter processing */ + char *oli; /* option letter list index */ + + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc || *(place = nargv[optind]) != '-') { + place = EMSG; + return (-1); + } + if (place[1] && *++place == '-') { /* found "--" */ + ++optind; + place = EMSG; + return (-1); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = strchr(ostr, optopt))) { + /* + * if the user didn't specify '-' as an option, + * assume it means -1. + */ + if (optopt == (int)'-') + return (-1); + if (!*place) + ++optind; + if (opterr && *ostr != ':' && optopt != BADCH) + (void)fprintf(stderr, "%s: illegal option -- %c\n", + "progname", optopt); + return (BADCH); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + if (*ostr == ':') + return (BADARG); + if (opterr) + (void)fprintf(stderr, + "%s: option requires an argument -- %c\n", + "progname", optopt); + return (BADCH); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return (optopt); /* dump back option letter */ +} diff --git a/libs/libtheora-1.1/win32/experimental/wincompat/getopt.h b/libs/libtheora-1.1/win32/experimental/wincompat/getopt.h new file mode 100644 index 00000000..ef305bf1 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/wincompat/getopt.h @@ -0,0 +1,110 @@ +/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */ +/* $FreeBSD: src/include/getopt.h,v 1.1 2002/09/29 04:14:30 eric Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +#ifndef _GETOPT_H_ +#define _GETOPT_H_ + +#ifdef _WIN32 +/* from */ +# ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +# else +# define __BEGIN_DECLS +# define __END_DECLS +# endif +# define __P(args) args +#endif + +/*#ifndef _WIN32 +#include +#include +#endif*/ + +#ifdef _WIN32 +# if !defined(GETOPT_API) +# define GETOPT_API __declspec(dllimport) +# endif +#endif + +/* + * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions + */ +#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +struct option { + /* name of long option */ + const char *name; + /* + * one of no_argument, required_argument, and optional_argument: + * whether option takes an argument + */ + int has_arg; + /* if not NULL, set *flag to val when option found */ + int *flag; + /* if flag not NULL, value to set *flag to; else return value */ + int val; +}; + +__BEGIN_DECLS +GETOPT_API int getopt_long __P((int, char * const *, const char *, + const struct option *, int *)); +__END_DECLS +#endif + +#ifdef _WIN32 +/* These are global getopt variables */ +__BEGIN_DECLS + +GETOPT_API extern int opterr, /* if error message should be printed */ + optind, /* index into parent argv vector */ + optopt, /* character checked for validity */ + optreset; /* reset getopt */ +GETOPT_API extern char* optarg; /* argument associated with option */ + +/* Original getopt */ +GETOPT_API int getopt __P((int, char * const *, const char *)); + +__END_DECLS +#endif + +#endif /* !_GETOPT_H_ */ diff --git a/libs/libtheora-1.1/win32/experimental/wincompat/getopt_long.c b/libs/libtheora-1.1/win32/experimental/wincompat/getopt_long.c new file mode 100644 index 00000000..a74b23e7 --- /dev/null +++ b/libs/libtheora-1.1/win32/experimental/wincompat/getopt_long.c @@ -0,0 +1,547 @@ +/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */ +/* $FreeBSD: src/lib/libc/stdlib/getopt_long.c,v 1.2 2002/10/16 22:18:42 alfred Exp $ */ + +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + + +#include +#include +#include + +#ifdef _WIN32 + +/* Windows needs warnx(). We change the definition though: + * 1. (another) global is defined, opterrmsg, which holds the error message + * 2. errors are always printed out on stderr w/o the program name + * Note that opterrmsg always gets set no matter what opterr is set to. The + * error message will not be printed if opterr is 0 as usual. + */ + +#include +#include + +GETOPT_API extern char opterrmsg[128]; +char opterrmsg[128]; /* last error message is stored here */ + +static void warnx(int print_error, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + if (fmt != NULL) + _vsnprintf(opterrmsg, 128, fmt, ap); + else + opterrmsg[0]='\0'; + va_end(ap); + if (print_error) { + fprintf(stderr, opterrmsg); + fprintf(stderr, "\n"); + } +} + +#endif /*_WIN32*/ + +/* not part of the original file */ +#ifndef _DIAGASSERT +#define _DIAGASSERT(X) +#endif + +#if HAVE_CONFIG_H && !HAVE_GETOPT_LONG && !HAVE_DECL_OPTIND +#define REPLACE_GETOPT +#endif + +#ifdef REPLACE_GETOPT +#ifdef __weak_alias +__weak_alias(getopt,_getopt) +#endif +int opterr = 1; /* if error message should be printed */ +int optind = 1; /* index into parent argv vector */ +int optopt = '?'; /* character checked for validity */ +int optreset; /* reset getopt */ +char *optarg; /* argument associated with option */ +#elif HAVE_CONFIG_H && !HAVE_DECL_OPTRESET +static int optreset; +#endif + +#ifdef __weak_alias +__weak_alias(getopt_long,_getopt_long) +#endif + +#if !HAVE_GETOPT_LONG +#define IGNORE_FIRST (*options == '-' || *options == '+') +#define PRINT_ERROR ((opterr) && ((*options != ':') \ + || (IGNORE_FIRST && options[1] != ':'))) +#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) +#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) +/* XXX: GNU ignores PC if *options == '-' */ +#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') + +/* return values */ +#define BADCH (int)'?' +#define BADARG ((IGNORE_FIRST && options[1] == ':') \ + || (*options == ':') ? (int)':' : (int)'?') +#define INORDER (int)1 + +#define EMSG "" + +static int getopt_internal(int, char * const *, const char *); +static int gcd(int, int); +static void permute_args(int, int, int, char * const *); + +static char *place = EMSG; /* option letter processing */ + +/* XXX: set optreset to 1 rather than these two */ +static int nonopt_start = -1; /* first non option argument (for permute) */ +static int nonopt_end = -1; /* first option after non options (for permute) */ + +/* Error messages */ +static const char recargchar[] = "option requires an argument -- %c"; +static const char recargstring[] = "option requires an argument -- %s"; +static const char ambig[] = "ambiguous option -- %.*s"; +static const char noarg[] = "option doesn't take an argument -- %.*s"; +static const char illoptchar[] = "unknown option -- %c"; +static const char illoptstring[] = "unknown option -- %s"; + + +/* + * Compute the greatest common divisor of a and b. + */ +static int +gcd(a, b) + int a; + int b; +{ + int c; + + c = a % b; + while (c != 0) { + a = b; + b = c; + c = a % b; + } + + return b; +} + +/* + * Exchange the block from nonopt_start to nonopt_end with the block + * from nonopt_end to opt_end (keeping the same order of arguments + * in each block). + */ +static void +permute_args(panonopt_start, panonopt_end, opt_end, nargv) + int panonopt_start; + int panonopt_end; + int opt_end; + char * const *nargv; +{ + int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; + char *swap; + + _DIAGASSERT(nargv != NULL); + + /* + * compute lengths of blocks and number and size of cycles + */ + nnonopts = panonopt_end - panonopt_start; + nopts = opt_end - panonopt_end; + ncycle = gcd(nnonopts, nopts); + cyclelen = (opt_end - panonopt_start) / ncycle; + + for (i = 0; i < ncycle; i++) { + cstart = panonopt_end+i; + pos = cstart; + for (j = 0; j < cyclelen; j++) { + if (pos >= panonopt_end) + pos -= nnonopts; + else + pos += nopts; + swap = nargv[pos]; + /* LINTED const cast */ + ((char **) nargv)[pos] = nargv[cstart]; + /* LINTED const cast */ + ((char **)nargv)[cstart] = swap; + } + } +} + +/* + * getopt_internal -- + * Parse argc/argv argument vector. Called by user level routines. + * Returns -2 if -- is found (can be long option or end of options marker). + */ +static int +getopt_internal(nargc, nargv, options) + int nargc; + char * const *nargv; + const char *options; +{ + char *oli; /* option letter list index */ + int optchar; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + optarg = NULL; + + /* + * XXX Some programs (like rsyncd) expect to be able to + * XXX re-initialize optind to 0 and have getopt_long(3) + * XXX properly function again. Work around this braindamage. + */ + if (optind == 0) + optind = 1; + + if (optreset) + nonopt_start = nonopt_end = -1; +start: + if (optreset || !*place) { /* update scanning pointer */ + optreset = 0; + if (optind >= nargc) { /* end of argument vector */ + place = EMSG; + if (nonopt_end != -1) { + /* do permutation, if we have to */ + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + else if (nonopt_start != -1) { + /* + * If we skipped non-options, set optind + * to the first of them. + */ + optind = nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((*(place = nargv[optind]) != '-') + || (place[1] == '\0')) { /* found non-option */ + place = EMSG; + if (IN_ORDER) { + /* + * GNU extension: + * return non-option as argument to option 1 + */ + optarg = nargv[optind++]; + return INORDER; + } + if (!PERMUTE) { + /* + * if no permutation wanted, stop parsing + * at first non-option + */ + return -1; + } + /* do permutation */ + if (nonopt_start == -1) + nonopt_start = optind; + else if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + nonopt_start = optind - + (nonopt_end - nonopt_start); + nonopt_end = -1; + } + optind++; + /* process next argument */ + goto start; + } + if (nonopt_start != -1 && nonopt_end == -1) + nonopt_end = optind; + if (place[1] && *++place == '-') { /* found "--" */ + place++; + return -2; + } + } + if ((optchar = (int)*place++) == (int)':' || + (oli = strchr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) { + /* option letter unknown or ':' */ + if (!*place) + ++optind; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(illoptchar, optchar); +#else + warnx(PRINT_ERROR, illoptchar, optchar); +#endif + optopt = optchar; + return BADCH; + } + if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ + /* XXX: what if no long options provided (called by getopt)? */ + if (*place) + return -2; + + if (++optind >= nargc) { /* no arg */ + place = EMSG; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargchar, optchar); +#else + warnx(PRINT_ERROR, recargchar, optchar); +#endif + optopt = optchar; + return BADARG; + } else /* white space */ + place = nargv[optind]; + /* + * Handle -W arg the same as --arg (which causes getopt to + * stop parsing). + */ + return -2; + } + if (*++oli != ':') { /* doesn't take argument */ + if (!*place) + ++optind; + } else { /* takes (optional) argument */ + optarg = NULL; + if (*place) /* no white space */ + optarg = place; + /* XXX: disable test for :: if PC? (GNU doesn't) */ + else if (oli[1] != ':') { /* arg not optional */ + if (++optind >= nargc) { /* no arg */ + place = EMSG; +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargchar, optchar); +#else + warnx(PRINT_ERROR, recargchar, optchar); +#endif + optopt = optchar; + return BADARG; + } else + optarg = nargv[optind]; + } + place = EMSG; + ++optind; + } + /* dump back option letter */ + return optchar; +} + +#ifdef REPLACE_GETOPT +/* + * getopt -- + * Parse argc/argv argument vector. + * + * [eventually this will replace the real getopt] + */ +int +getopt(nargc, nargv, options) + int nargc; + char * const *nargv; + const char *options; +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + ++optind; + /* + * We found an option (--), so if we skipped non-options, + * we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, optind, + nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + retval = -1; + } + return retval; +} +#endif + +/* + * getopt_long -- + * Parse argc/argv argument vector. + */ +int +getopt_long(nargc, nargv, options, long_options, idx) + int nargc; + char * const *nargv; + const char *options; + const struct option *long_options; + int *idx; +{ + int retval; + + _DIAGASSERT(nargv != NULL); + _DIAGASSERT(options != NULL); + _DIAGASSERT(long_options != NULL); + /* idx may be NULL */ + + if ((retval = getopt_internal(nargc, nargv, options)) == -2) { + char *current_argv, *has_equal; + size_t current_argv_len; + int i, match; + + current_argv = place; + match = -1; + + optind++; + place = EMSG; + + if (*current_argv == '\0') { /* found "--" */ + /* + * We found an option (--), so if we skipped + * non-options, we have to permute. + */ + if (nonopt_end != -1) { + permute_args(nonopt_start, nonopt_end, + optind, nargv); + optind -= nonopt_end - nonopt_start; + } + nonopt_start = nonopt_end = -1; + return -1; + } + if ((has_equal = strchr(current_argv, '=')) != NULL) { + /* argument found (--option=arg) */ + current_argv_len = has_equal - current_argv; + has_equal++; + } else + current_argv_len = strlen(current_argv); + + for (i = 0; long_options[i].name; i++) { + /* find matching long option */ + if (strncmp(current_argv, long_options[i].name, + current_argv_len)) + continue; + + if (strlen(long_options[i].name) == + (unsigned)current_argv_len) { + /* exact match */ + match = i; + break; + } + if (match == -1) /* partial match */ + match = i; + else { + /* ambiguous abbreviation */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(ambig, (int)current_argv_len, + current_argv); +#else + warnx(PRINT_ERROR, ambig, (int)current_argv_len, + current_argv); +#endif + optopt = 0; + return BADCH; + } + } + if (match != -1) { /* option found */ + if (long_options[match].has_arg == no_argument + && has_equal) { +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(noarg, (int)current_argv_len, + current_argv); +#else + warnx(PRINT_ERROR, noarg, (int)current_argv_len, + current_argv); +#endif + /* + * XXX: GNU sets optopt to val regardless of + * flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + return BADARG; + } + if (long_options[match].has_arg == required_argument || + long_options[match].has_arg == optional_argument) { + if (has_equal) + optarg = has_equal; + else if (long_options[match].has_arg == + required_argument) { + /* + * optional argument doesn't use + * next nargv + */ + optarg = nargv[optind++]; + } + } + if ((long_options[match].has_arg == required_argument) + && (optarg == NULL)) { + /* + * Missing argument; leading ':' + * indicates no error should be generated + */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(recargstring, current_argv); +#else + warnx(PRINT_ERROR, recargstring, current_argv); +#endif + /* + * XXX: GNU sets optopt to val regardless + * of flag + */ + if (long_options[match].flag == NULL) + optopt = long_options[match].val; + else + optopt = 0; + --optind; + return BADARG; + } + } else { /* unknown option */ +#ifndef _WIN32 + if (PRINT_ERROR) + warnx(illoptstring, current_argv); +#else + warnx(PRINT_ERROR, illoptstring, current_argv); +#endif + optopt = 0; + return BADCH; + } + if (long_options[match].flag) { + *long_options[match].flag = long_options[match].val; + retval = 0; + } else + retval = long_options[match].val; + if (idx) + *idx = match; + } + return retval; +} +#endif /* !GETOPT_LONG */ diff --git a/libs/libtheora-1.1/win32/experimental/wincompat/unistd.h b/libs/libtheora-1.1/win32/experimental/wincompat/unistd.h new file mode 100644 index 00000000..e69de29b diff --git a/libs/libtheora-1.1/win32/getopt.c b/libs/libtheora-1.1/win32/getopt.c new file mode 100644 index 00000000..33d299bd --- /dev/null +++ b/libs/libtheora-1.1/win32/getopt.c @@ -0,0 +1,1047 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to drepper@gnu.org + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 + Free Software Foundation, Inc. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +# define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +# ifndef const +# define const +# endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +# include +# include +#endif /* GNU C library. */ + +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + +#ifndef _ +/* This is for other GNU distributions with internationalized messages. + When compiling libc, the _ macro is predefined. */ +# ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +# else +# define _(msgid) (msgid) +# endif +#endif + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_win.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +/* Value of POSIXLY_CORRECT environment variable. */ +static char *posixly_correct; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +# include +# define my_index strchr +#else + +#include + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#ifndef getenv +extern char *getenv (); +#endif + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +# if (!defined __STDC__ || !__STDC__) && !defined strlen +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +# endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +#ifdef _LIBC +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; +static int nonoption_flags_len; + +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +# ifdef text_set_element +text_set_element (__libc_subinit, store_args_and_env); +# endif /* text_set_element */ + +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +#if defined __STDC__ && __STDC__ +static void exchange (char **); +#endif + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#ifdef _LIBC + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); +#endif +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + if (posixly_correct) + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: illegal option -- %c\n"), + argv[0], c); + else + fprintf (stderr, _("%s: invalid option -- %c\n"), + argv[0], c); + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/libs/libtheora-1.1/win32/getopt1.c b/libs/libtheora-1.1/win32/getopt1.c new file mode 100644 index 00000000..39f8383e --- /dev/null +++ b/libs/libtheora-1.1/win32/getopt1.c @@ -0,0 +1,188 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "getopt_win.h" + +#if !defined __STDC__ || !__STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* Not ELIDE_CODE. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == -1) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/libs/libtheora-1.1/win32/getopt_win.h b/libs/libtheora-1.1/win32/getopt_win.h new file mode 100644 index 00000000..91eb54e5 --- /dev/null +++ b/libs/libtheora-1.1/win32/getopt_win.h @@ -0,0 +1,169 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ diff --git a/libs/libtheora-1.1/win32/theora_static.dsp b/libs/libtheora-1.1/win32/theora_static.dsp new file mode 100644 index 00000000..f794e108 --- /dev/null +++ b/libs/libtheora-1.1/win32/theora_static.dsp @@ -0,0 +1,336 @@ +# Microsoft Developer Studio Project File - Name="theora_static" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=theora_static - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "theora_static.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "theora_static.mak" CFG="theora_static - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "theora_static - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "theora_static - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "theora_static - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Static_Release" +# PROP Intermediate_Dir "Static_Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\ogg\include" /I "..\..\theora\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "theora_static - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Static_Debug" +# PROP Intermediate_Dir "Static_Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\..\ogg\include" /I "..\..\theora\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"Static_Debug\theora_static_d.lib" + +!ENDIF + +# Begin Target + +# Name "theora_static - Win32 Release" +# Name "theora_static - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\lib\enc\dct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_decode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dct_encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encapiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_huffman.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_idct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_toplevel.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_quant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\frarray.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\frinit.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mathops.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mcenc.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\mode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\reconstruct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\dsp_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\fdct_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\x86_32_vs\recon_mmx.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\apiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\bitpack.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decapiwrapper.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decinfo.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decode.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dequant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\fragment.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffdec.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\idct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\info.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\internal.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\quant.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\state.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxfrag.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxidct.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxloopfilter.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\mmxstate.c +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\x86_vc\x86stat.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\lib\dec\apiwrapper.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\block_inline.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\codec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\codec_internal.h +# End Source File +# Begin Source File + +SOURCE=..\lib\cpu.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dct.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\decint.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\dequant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\dsp.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_huffman.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\encoder_lookup.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\enquant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffdec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\huffman.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\hufftables.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\idct.h +# End Source File +# Begin Source File + +SOURCE=..\lib\internal.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\ocintrin.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\pp.h +# End Source File +# Begin Source File + +SOURCE=..\lib\dec\quant.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\quant_lookup.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\theora.h +# End Source File +# Begin Source File + +SOURCE=..\include\theora\theoradec.h +# End Source File +# Begin Source File + +SOURCE=..\lib\enc\toplevel_lookup.h +# End Source File +# End Group +# End Target +# End Project diff --git a/libs/libtheora-1.1/win32/xmingw32/Makefile b/libs/libtheora-1.1/win32/xmingw32/Makefile new file mode 100644 index 00000000..cf016d4a --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/Makefile @@ -0,0 +1,393 @@ +# NOTE: This Makefile requires GNU make +# Location to put the targets. +TARGETBINDIR = . +TARGETLIBDIR = . +# DLL version information. Currently this must be updated manually. +# Fields are: major, minor, build number, QFE version +VERSION_FIELD = 1,0,0,0 +VERSION_STRING = \\\"1.0\\\" +# Name of the targets +# Hooray for Windows DLL hell. +LIBTHEORAENC_TARGET = libtheoraenc.dll +LIBTHEORAENCD_TARGET = libtheoraencd.dll +LIBTHEORAENC70_TARGET = libtheoraenc70.dll +LIBTHEORAENC70D_TARGET = libtheoraenc70d.dll +LIBTHEORAENC71_TARGET = libtheoraenc71.dll +LIBTHEORAENC71D_TARGET = libtheoraenc71d.dll +LIBTHEORAENC80_TARGET = libtheoraenc80.dll +LIBTHEORAENC80D_TARGET = libtheoraenc80d.dll + +LIBTHEORADEC_TARGET = libtheoradec.dll +LIBTHEORADECD_TARGET = libtheoradecd.dll +LIBTHEORADEC70_TARGET = libtheoradec70.dll +LIBTHEORADEC70D_TARGET = libtheoradec70d.dll +LIBTHEORADEC71_TARGET = libtheoradec71.dll +LIBTHEORADEC71D_TARGET = libtheoradec71d.dll +LIBTHEORADEC80_TARGET = libtheoradec80.dll +LIBTHEORADEC80D_TARGET = libtheoradec80d.dll + +DUMP_VIDEO_TARGET = dump_video.exe +PLAYER_EXAMPLE_TARGET = player_example.exe +ENCODER_EXAMPLE_TARGET = encoder_example.exe + +# The compiler tools to use +# The is no standard mingw prefix, so try to guess +MINGW_PREFIX := $(or $(strip $(foreach exeprefix, \ + i686-mingw32 i686-pc-mingw32 i586-mingw32msvc i386-mingw32 \ + no-mingw32, \ + $(if $(shell which $(exeprefix)-gcc 2>/dev/null), $(exeprefix) )))) +CC = $(MINGW_PREFIX)-gcc +RC = $(MINGW_PREFIX)-windres +DLLTOOL = $(MINGW_PREFIX)-dlltool +LD = $(MINGW_PREFIX)-ld +SDLCONFIG = $(MINGW_PREFIX)-sdl-config +# The command to use to generate dependency information +MAKEDEPEND = ${CC} -MM +#MAKEDEPEND = makedepend -f- -Y -- + +# The location of include files. +# Modify these to point to your Ogg and Vorbis include directories if they are +# not installed in a standard location. +CINCLUDE = -D_REENTRANT +# Extra compilation flags. +# You may get speed increases by including flags such as -O2 or -O3 or +# -ffast-math, or additional flags, depending on your system and compiler. +# The correct -march= flag will also generate much better code +# on newer architectures. +CFLAGS = -Wall -Wno-parentheses -DOC_X86_ASM +RELEASE_CFLAGS = ${CFLAGS} -mtune=native -O3 -fomit-frame-pointer -fforce-addr \ + -finline-functions +# The -g flag will generally include debugging information. +DEBUG_CFLAGS = ${CFLAGS} -g +# Libraries to link with, and the location of library files. +LIBS = -logg -lvorbis -lvorbisenc + +# ANYTHING BELOW THIS LINE PROBABLY DOES NOT NEED EDITING +CINCLUDE := -I../../include ${CINCLUDE} +LIBSRCDIR = ../../lib +BINSRCDIR = ../../examples +WORKDIR = objs + +# C source file lists + +LIBTHEORADEC_CSOURCES = \ +apiwrapper.c \ +bitpack.c \ +decapiwrapper.c \ +decinfo.c \ +decode.c \ +dequant.c \ +fragment.c \ +huffdec.c \ +idct.c \ +info.c \ +internal.c \ +quant.c \ +state.c \ +$(if $(findstring -DOC_X86_ASM,${CFLAGS}), \ +x86/mmxidct.c \ +x86/mmxfrag.c \ +x86/mmxstate.c \ +x86/x86state.c \ +) + +LIBTHEORAENC_CSOURCES = \ +apiwrapper.c \ +fragment.c \ +idct.c \ +internal.c \ +state.c \ +quant.c \ +analyze.c \ +fdct.c \ +encfrag.c \ +encapiwrapper.c \ +encinfo.c \ +encode.c \ +enquant.c \ +huffenc.c \ +mathops.c \ +mcenc.c \ +rate.c \ +tokenize.c \ +$(if $(findstring -DOC_X86_ASM,${CFLAGS}), \ +x86/mmxfrag.c \ +x86/mmxidct.c \ +x86/mmxstate.c \ +x86/x86state.c \ +x86/mmxencfrag.c \ +x86/mmxfdct.c \ +x86/x86enc.c \ +) + + +DUMP_VIDEO_CSOURCES = dump_video.c +ENCODER_EXAMPLE_CSOURCES = encoder_example.c +PLAYER_EXAMPLE_CSOURCES = player_example.c + +# Create object file list. +LIBTHEORADEC_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.o} +LIBTHEORADECD_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.do} +LIBTHEORAENC_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.o} +LIBTHEORAENCD_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.do} +DUMP_VIDEO_OBJS:= ${DUMP_VIDEO_CSOURCES:%.c=${WORKDIR}/%.o} +ENCODER_EXAMPLE_OBJS:= ${ENCODER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o} +PLAYER_EXAMPLE_OBJS:= ${PLAYER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o} +RC_OBJS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \ + ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \ + ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \ + ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \ + ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \ + ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \ + ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \ + ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET} +RC_OBJS:= ${RC_OBJS:%.dll=${WORKDIR}/%.rco} +ALL_OBJS:= ${LIBTHEORADEC_OBJS} ${LIBTHEORAENC_OBJS} \ + ${LIBTHEORADECD_OBJS} ${LIBTHEORAENCD_OBJS} ${RC_OBJS} \ + ${DUMP_VIDEO_OBJS} ${ENCODER_EXAMPLE_OBJS} #${PLAYER_EXAMPLE_OBJS} +# Create the dependency file list +ALL_DEPS:= ${ALL_OBJS:%.o=%.d} +ALL_DEPS:= ${ALL_DEPS:%.do=%.dd} +ALL_DEPS:= ${ALL_DEPS:%.rco=%.d} +# Prepend source path to file names. +LIBTHEORADEC_CSOURCES:= ${LIBTHEORADEC_CSOURCES:%=${LIBSRCDIR}/%} +LIBTHEORAENC_CSOURCES:= ${LIBTHEORAENC_CSOURCES:%=${LIBSRCDIR}/%} +DUMP_VIDEO_CSOURCES:= ${DUMP_VIDEO_CSOURCES:%=${BINSRCDIR}/%} +ENCODER_EXAMPLE_CSOURCES:= ${ENCODER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%} +PLAYER_EXAMPLE_CSOURCES:= ${PLAYER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%} +ALL_CSOURCES:= ${LIBTHEORADEC_CSOURCES} ${LIBTHEORAENC_CSOURCES} \ + ${DUMP_VIDEO_CSOURCES} ${PLAYER_EXAMPLE_CSOURCES} \ + ${ENCODER_EXAMPLE_CSOURCES} +LIBTHEORAENC_RCO:= ${WORKDIR}/${LIBTHEORAENC_TARGET:%.dll=%.rco} +LIBTHEORAENCD_RCO:= ${WORKDIR}/${LIBTHEORAENCD_TARGET:%.dll=%.rco} +LIBTHEORAENC70_RCO:= ${WORKDIR}/${LIBTHEORAENC70_TARGET:%.dll=%.rco} +LIBTHEORAENC70D_RCO:= ${WORKDIR}/${LIBTHEORAENC70D_TARGET:%.dll=%.rco} +LIBTHEORAENC71_RCO:= ${WORKDIR}/${LIBTHEORAENC71_TARGET:%.dll=%.rco} +LIBTHEORAENC71D_RCO:= ${WORKDIR}/${LIBTHEORAENC71D_TARGET:%.dll=%.rco} +LIBTHEORAENC80_RCO:= ${WORKDIR}/${LIBTHEORAENC80_TARGET:%.dll=%.rco} +LIBTHEORAENC80D_RCO:= ${WORKDIR}/${LIBTHEORAENC80D_TARGET:%.dll=%.rco} +LIBTHEORADEC_RCO:= ${WORKDIR}/${LIBTHEORADEC_TARGET:%.dll=%.rco} +LIBTHEORADECD_RCO:= ${WORKDIR}/${LIBTHEORADECD_TARGET:%.dll=%.rco} +LIBTHEORADEC70_RCO:= ${WORKDIR}/${LIBTHEORADEC70_TARGET:%.dll=%.rco} +LIBTHEORADEC70D_RCO:= ${WORKDIR}/${LIBTHEORADEC70D_TARGET:%.dll=%.rco} +LIBTHEORADEC71_RCO:= ${WORKDIR}/${LIBTHEORADEC71_TARGET:%.dll=%.rco} +LIBTHEORADEC71D_RCO:= ${WORKDIR}/${LIBTHEORADEC71D_TARGET:%.dll=%.rco} +LIBTHEORADEC80_RCO:= ${WORKDIR}/${LIBTHEORADEC80_TARGET:%.dll=%.rco} +LIBTHEORADEC80D_RCO:= ${WORKDIR}/${LIBTHEORADEC80D_TARGET:%.dll=%.rco} +# Prepand target path to file names. +LIBTHEORAENC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC_TARGET} +LIBTHEORAENCD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENCD_TARGET} +LIBTHEORAENC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70_TARGET} +LIBTHEORAENC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70D_TARGET} +LIBTHEORAENC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71_TARGET} +LIBTHEORAENC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71D_TARGET} +LIBTHEORAENC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80_TARGET} +LIBTHEORAENC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80D_TARGET} +LIBTHEORADEC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC_TARGET} +LIBTHEORADECD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADECD_TARGET} +LIBTHEORADEC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70_TARGET} +LIBTHEORADEC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70D_TARGET} +LIBTHEORADEC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71_TARGET} +LIBTHEORADEC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71D_TARGET} +LIBTHEORADEC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80_TARGET} +LIBTHEORADEC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80D_TARGET} +DUMP_VIDEO_TARGET:= ${TARGETBINDIR}/${DUMP_VIDEO_TARGET} +ENCODER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${ENCODER_EXAMPLE_TARGET} +PLAYER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${PLAYER_EXAMPLE_TARGET} +DLL_TARGETS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \ + ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \ + ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \ + ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \ + ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \ + ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \ + ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \ + ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET} +ALL_TARGETS:= ${DLL_TARGETS} ${DLL_TARGETS:%.dll=%.dll.a} \ + ${DUMP_VIDEO_TARGET} ${ENCODER_EXAMPLE_TARGET} #${PLAYER_EXAMPLE_TARGET} +IMPLIB_TARGETS:= ${DLL_TARGETS:%.dll=%.def} ${DLL_TARGETS:%.dll=%.lib} \ + ${DLL_TARGETS:%.dll=%.exp} + +# Targets: +# Everything (default) +all: ${ALL_TARGETS} + +# These require Microsoft's lib.exe to build, and so are not made by default. +implibs: ${IMPLIB_TARGETS} + +# libtheoradec +${LIBTHEORADEC_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcrt \ + ${LIBTHEORADEC_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADECD_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADECD_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcrtd \ + ${LIBTHEORADECD_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC70_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC70_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr70 \ + ${LIBTHEORADEC70_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC70D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC70D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr70d \ + ${LIBTHEORADEC70D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC71_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC71_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr71 \ + ${LIBTHEORADEC71_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC71D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC71D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr71d \ + ${LIBTHEORADEC71D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC80_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC80_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr80 \ + ${LIBTHEORADEC80_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def +${LIBTHEORADEC80D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC80D_RCO} \ + libtheoradec-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr80d \ + ${LIBTHEORADEC80D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def + +# libtheoraenc +${LIBTHEORAENC_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC_TARGET} -logg -lmsvcrt \ + ${LIBTHEORAENC_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENCD_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENCD_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADECD_TARGET} -logg -lmsvcrtd \ + ${LIBTHEORAENCD_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC70_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC70_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC70_TARGET} -logg -lmsvcr70 \ + ${LIBTHEORAENC70_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC70D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC70D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC70D_TARGET} -logg -lmsvcr70d \ + ${LIBTHEORAENC70D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC71_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC71_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC71_TARGET} -logg -lmsvcr71 \ + ${LIBTHEORAENC71_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC71D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC71D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC71D_TARGET} -logg -lmsvcr71d \ + ${LIBTHEORAENC71D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC80_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC80_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC80_TARGET} -logg -lmsvcr80 \ + ${LIBTHEORAENC80_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def +${LIBTHEORAENC80D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC80D_RCO} \ + libtheoraenc-all.def + mkdir -p ${TARGETLIBDIR} + ${CC} -shared -o $@ \ + ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC80D_TARGET} -logg -lmsvcr80d \ + ${LIBTHEORAENC80D_RCO} \ + -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def + +# dump_video +${DUMP_VIDEO_TARGET}: ${DUMP_VIDEO_OBJS} ${LIBTHEORADEC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${DUMP_VIDEO_OBJS} ${LIBS} \ + ${LIBTHEORADEC_TARGET}.a + +# encoder_example +${ENCODER_EXAMPLE_TARGET}: ${ENCODER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET} \ + ${LIBTHEORAENC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${ENCODER_EXAMPLE_OBJS} ${LIBS} \ + ${LIBTHEORAENC_TARGET}.a ${LIBTHEORADEC_TARGET}.a + +# player_example +${PLAYER_EXAMPLE_TARGET}: CINCLUDE += $(SDLCONFIG) --cflags +${PLAYER_EXAMPLE_TARGET}: ${PLAYER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET} + mkdir -p ${TARGETBINDIR} + ${CC} ${CFLAGS} -o $@ ${PLAYER_EXAMPLE_OBJS} ${LIBS} \ + ${LIBTHEORADEC_TARGET}.a `${SDLCONFIG} --libs` + +# Remove all targets. +clean: + -rm $(sort ${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} ${IMPLIB_TARGETS}) + -rmdir ${WORKDIR}/x86 + -rmdir ${WORKDIR} + +# Make everything depend on changes in the Makefile +${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} : Makefile + +# Specify which targets are phony for GNU make +.PHONY : all clean + +# Rules +# Windows-specific rules +%.dll.a : %.dll +%.def : %.dll +%.exp : %.lib +%.lib : %.def + wine lib /machine:i386 /def:$< +${WORKDIR}/%.d : %.rc + mkdir -p ${dir $@} + ${MAKEDEPEND} -x c-header ${CINCLUDE} $< -MT ${@:%.d=%.rco} > $@ +${WORKDIR}/%.rco : %.rc + mkdir -p ${dir $@} + ${RC} ${CINCLUDE} -DTH_VERSION_FIELD=${VERSION_FIELD} \ + -DTH_VERSION_STRING=${VERSION_STRING} $< $@ +# Normal compilation +${WORKDIR}/%.d : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@ +${WORKDIR}/%.d : ${BINSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@ +${WORKDIR}/%.o : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $< +${WORKDIR}/%.o : ${BINSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $< +# Debug versions +${WORKDIR}/%.dd : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${MAKEDEPEND} ${CINCLUDE} ${DEBUG_CFLAGS} $< -MT ${@:%.d=%.do} > $@ +${WORKDIR}/%.do : ${LIBSRCDIR}/%.c + mkdir -p ${dir $@} + ${CC} ${CINCLUDE} ${DEBUG_CFLAGS} -c -o $@ $< + +# Include header file dependencies +-include ${ALL_DEPS} diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.def b/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.def new file mode 100644 index 00000000..566eeb30 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.def @@ -0,0 +1,58 @@ +EXPORTS +; Old alpha API + theora_version_string @ 1 + theora_version_number @ 2 + + theora_decode_header @ 3 + theora_decode_init @ 4 + theora_decode_packetin @ 5 + theora_decode_YUVout @ 6 + + theora_control @ 7 + + theora_packet_isheader @ 8 + theora_packet_iskeyframe @ 9 + + theora_granule_shift @ 10 + theora_granule_frame @ 11 + theora_granule_time @ 12 + + theora_info_init @ 13 + theora_info_clear @ 14 + + theora_clear @ 15 + + theora_comment_init @ 16 + theora_comment_add @ 17 + theora_comment_add_tag @ 18 + theora_comment_query @ 19 + theora_comment_query_count @ 20 + theora_comment_clear @ 21 + +; New theora-exp API + th_version_string @ 22 + th_version_number @ 23 + + th_decode_headerin @ 24 + th_decode_alloc @ 25 + th_setup_free @ 26 + th_decode_ctl @ 27 + th_decode_packetin @ 28 + th_decode_ycbcr_out @ 29 + th_decode_free @ 30 + + th_packet_isheader @ 31 + th_packet_iskeyframe @ 32 + + th_granule_frame @ 33 + th_granule_time @ 34 + + th_info_init @ 35 + th_info_clear @ 36 + + th_comment_init @ 37 + th_comment_add @ 38 + th_comment_add_tag @ 39 + th_comment_query @ 40 + th_comment_query_count @ 41 + th_comment_clear @ 42 diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.rc new file mode 100644 index 00000000..f6a5c60b --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec-all.rc @@ -0,0 +1,39 @@ +#include + +/*See "VERSIONINFO Resource" in MSDN, + http://msdn2.microsoft.com/en-us/library/Aa381058.aspx */ +VS_VERSION_INFO VERSIONINFO +FILEVERSION TH_VERSION_FIELD +PRODUCTVERSION TH_VERSION_FIELD +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#if defined(_DEBUG) +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0 +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + /*0x040904B0 == US English, Unicode*/ + BLOCK "0x040904B0" + BEGIN + VALUE "Comments","Xiph.Org " TH_DEC_INTERNAL_NAME ".dll" + VALUE "CompanyName","The Xiph.Org Foundation" + VALUE "FileDescription","Xiph.Org Theora Decoder Library" + VALUE "FileVersion",TH_VERSION_STRING + VALUE "InternalName",TH_DEC_INTERNAL_NAME + VALUE "LegalCopyright","Copyright (C) 2002-2007 Xiph.Org Foundation" + VALUE "OriginalFilename",TH_DEC_INTERNAL_NAME ".dll" + VALUE "ProductName","libtheora" + VALUE "ProductVersion",TH_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + /*0x0409, 1200 == US English, Unicode*/ + VALUE "Translation",0x0409,1200 + END +END diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec.rc new file mode 100644 index 00000000..3ed5da2a --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec70.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec70.rc new file mode 100644 index 00000000..ee82820c --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec70.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec70" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec70d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec70d.rc new file mode 100644 index 00000000..783800d1 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec70d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec70d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec71.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec71.rc new file mode 100644 index 00000000..0becd190 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec71.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec71" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec71d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec71d.rc new file mode 100644 index 00000000..e1a03980 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec71d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec71d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec80.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec80.rc new file mode 100644 index 00000000..932cce92 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec80.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec80" +#undef _DEBUG +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradec80d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradec80d.rc new file mode 100644 index 00000000..1ff55129 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradec80d.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradec80d" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoradecd.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoradecd.rc new file mode 100644 index 00000000..5cfaf6e6 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoradecd.rc @@ -0,0 +1,3 @@ +#define TH_DEC_INTERNAL_NAME "libtheoradecd" +#define _DEBUG (1) +#include "libtheoradec-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.def b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.def new file mode 100644 index 00000000..36d2dadb --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.def @@ -0,0 +1,17 @@ +EXPORTS +; Old alpha API + theora_encode_init @ 1 + theora_encode_YUVin @ 2 + theora_encode_packetout @ 3 + theora_encode_header @ 4 + theora_encode_comment @ 5 + theora_encode_tables @ 6 +; New theora-exp API + th_encode_alloc @ 7 + th_encode_ctl @ 8 + th_encode_flushheader @ 9 + th_encode_ycbcr_in @ 10 + th_encode_packetout @ 11 + th_encode_free @ 12 + TH_VP31_QUANT_INFO @ 13 + TH_VP31_HUFF_CODES @ 14 diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.rc new file mode 100644 index 00000000..5c96b09e --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc-all.rc @@ -0,0 +1,39 @@ +#include + +/*See "VERSIONINFO Resource" in MSDN, + http://msdn2.microsoft.com/en-us/library/Aa381058.aspx */ +VS_VERSION_INFO VERSIONINFO +FILEVERSION TH_VERSION_FIELD +PRODUCTVERSION TH_VERSION_FIELD +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#if defined(_DEBUG) +FILEFLAGS VS_FF_DEBUG +#else +FILEFLAGS 0 +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + /*0x040904B0 == US English, Unicode*/ + BLOCK "0x040904B0" + BEGIN + VALUE "Comments","Xiph.Org " TH_ENC_INTERNAL_NAME ".dll" + VALUE "CompanyName","The Xiph.Org Foundation" + VALUE "FileDescription","Xiph.Org Theora Encoder Library" + VALUE "FileVersion",TH_VERSION_STRING + VALUE "InternalName",TH_ENC_INTERNAL_NAME + VALUE "LegalCopyright","Copyright (C) 2002-2007 Xiph.Org Foundation" + VALUE "OriginalFilename",TH_ENC_INTERNAL_NAME ".dll" + VALUE "ProductName","libtheora" + VALUE "ProductVersion",TH_VERSION_STRING + END + END + BLOCK "VarFileInfo" + BEGIN + /*0x0409, 1200 == US English, Unicode*/ + VALUE "Translation",0x0409,1200 + END +END diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc.rc new file mode 100644 index 00000000..26a356dc --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70.rc new file mode 100644 index 00000000..12cf7c17 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc70" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70d.rc new file mode 100644 index 00000000..0fdb70b0 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc70d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc70d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71.rc new file mode 100644 index 00000000..86075168 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc71" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71d.rc new file mode 100644 index 00000000..3ef2ef16 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc71d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc71d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80.rc new file mode 100644 index 00000000..66ef776f --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc80" +#undef _DEBUG +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80d.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80d.rc new file mode 100644 index 00000000..dcca72c6 --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraenc80d.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraenc80d" +#define _DEBUG (1) +#include "libtheoraenc-all.rc" diff --git a/libs/libtheora-1.1/win32/xmingw32/libtheoraencd.rc b/libs/libtheora-1.1/win32/xmingw32/libtheoraencd.rc new file mode 100644 index 00000000..fe2a56bf --- /dev/null +++ b/libs/libtheora-1.1/win32/xmingw32/libtheoraencd.rc @@ -0,0 +1,3 @@ +#define TH_ENC_INTERNAL_NAME "libtheoraencd" +#define _DEBUG (1) +#include "libtheoraenc-all.rc"