[xiph-commits] r11325 - in trunk/xiph-qt: . Theora Theora/English.lproj Theora/Theora.xcodeproj Theora/src

arek at svn.xiph.org arek at svn.xiph.org
Sun Apr 30 15:46:22 PDT 2006


Author: arek
Date: 2006-04-30 15:46:08 -0700 (Sun, 30 Apr 2006)
New Revision: 11325

Added:
   trunk/xiph-qt/Theora/
   trunk/xiph-qt/Theora/English.lproj/
   trunk/xiph-qt/Theora/English.lproj/InfoPlist.strings
   trunk/xiph-qt/Theora/Info.plist
   trunk/xiph-qt/Theora/Theora.xcodeproj/
   trunk/xiph-qt/Theora/Theora.xcodeproj/project.pbxproj
   trunk/xiph-qt/Theora/Theora_Prefix.pch
   trunk/xiph-qt/Theora/src/
   trunk/xiph-qt/Theora/src/Theora.exp
   trunk/xiph-qt/Theora/src/TheoraDecoder.c
   trunk/xiph-qt/Theora/src/TheoraDecoder.h
   trunk/xiph-qt/Theora/src/TheoraDecoder.r
   trunk/xiph-qt/Theora/src/TheoraDecoderDispatch.h
   trunk/xiph-qt/Theora/src/decoder_types.h
   trunk/xiph-qt/Theora/src/theora_versions.h
Log:
Initial TheoraDecoder code import.


Property changes on: trunk/xiph-qt/Theora
___________________________________________________________________
Name: svn:ignore
   + build


Added: trunk/xiph-qt/Theora/English.lproj/InfoPlist.strings
===================================================================
(Binary files differ)


Property changes on: trunk/xiph-qt/Theora/English.lproj/InfoPlist.strings
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/xiph-qt/Theora/Info.plist
===================================================================
--- trunk/xiph-qt/Theora/Info.plist	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/Info.plist	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>CFBundleDevelopmentRegion</key>
+    <string>English</string>
+    <key>CFBundleExecutable</key>
+    <string>Theora</string>
+    <key>CFBundleIconFile</key>
+    <string></string>
+    <key>CFBundleIdentifier</key>
+    <string>org.xiph.xiph-qt.theora</string>
+    <key>CFBundleInfoDictionaryVersion</key>
+    <string>6.0</string>
+    <key>CFBundlePackageType</key>
+    <string>BNDL</string>
+    <key>CFBundleSignature</key>
+    <string>imdc</string>
+    <key>CFBundleVersion</key>
+    <string>0.1.1</string>
+    <key>CFBundleShortVersionString</key>
+    <string>0.1.1</string>
+    <key>CSResourcesFileMapped</key>
+    <true/>
+</dict>
+</plist>


Property changes on: trunk/xiph-qt/Theora/Theora.xcodeproj
___________________________________________________________________
Name: svn:ignore
   + *.mode*
*.pbxuser


Added: trunk/xiph-qt/Theora/Theora.xcodeproj/project.pbxproj
===================================================================
--- trunk/xiph-qt/Theora/Theora.xcodeproj/project.pbxproj	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/Theora.xcodeproj/project.pbxproj	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,344 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 42;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		7321B37E0A022D43004A699F /* TheoraExp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7321B37D0A022D43004A699F /* TheoraExp.framework */; };
+		7380D65E09D9853300A36679 /* TheoraDecoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 7380D65C09D9853300A36679 /* TheoraDecoder.c */; };
+		7380D66909D9859D00A36679 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7380D66709D9859D00A36679 /* Ogg.framework */; };
+		7380D66E09D985B800A36679 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7380D66D09D985B800A36679 /* QuickTime.framework */; };
+		7380D6A009D9884600A36679 /* TheoraDecoder.r in Rez */ = {isa = PBXBuildFile; fileRef = 7380D65F09D9854100A36679 /* TheoraDecoder.r */; };
+		8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
+		8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXBuildStyle section */
+		4F9091AC011F3BD104CA0E50 /* Debug */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+			};
+			name = Debug;
+		};
+		4F9091AD011F3BD104CA0E50 /* Release */ = {
+			isa = PBXBuildStyle;
+			buildSettings = {
+			};
+			name = Release;
+		};
+/* End PBXBuildStyle section */
+
+/* Begin PBXFileReference section */
+		089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
+		32BAE0B30371A71500C91783 /* Theora_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Theora_Prefix.pch; sourceTree = "<group>"; };
+		7321B37D0A022D43004A699F /* TheoraExp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TheoraExp.framework; path = /Library/Frameworks/TheoraExp.framework; sourceTree = "<absolute>"; };
+		7321B3B10A04F1CC004A699F /* TheoraDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TheoraDecoder.h; path = src/TheoraDecoder.h; sourceTree = "<group>"; };
+		7321B3C20A04F91D004A699F /* decoder_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = decoder_types.h; path = src/decoder_types.h; sourceTree = "<group>"; };
+		7380D65509D9849B00A36679 /* config.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../common/config.h; sourceTree = SOURCE_ROOT; };
+		7380D65609D984CD00A36679 /* fccs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fccs.h; path = ../common/fccs.h; sourceTree = SOURCE_ROOT; };
+		7380D65709D984CD00A36679 /* data_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = data_types.h; path = ../common/data_types.h; sourceTree = SOURCE_ROOT; };
+		7380D65809D984FD00A36679 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = icon.icns; path = ../resources/icon.icns; sourceTree = SOURCE_ROOT; };
+		7380D65909D984FD00A36679 /* icon.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = icon.r; path = ../resources/icon.r; sourceTree = SOURCE_ROOT; };
+		7380D65B09D9853300A36679 /* theora_versions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = theora_versions.h; path = src/theora_versions.h; sourceTree = "<group>"; };
+		7380D65C09D9853300A36679 /* TheoraDecoder.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = TheoraDecoder.c; path = src/TheoraDecoder.c; sourceTree = "<group>"; };
+		7380D65D09D9853300A36679 /* TheoraDecoderDispatch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TheoraDecoderDispatch.h; path = src/TheoraDecoderDispatch.h; sourceTree = "<group>"; };
+		7380D65F09D9854100A36679 /* TheoraDecoder.r */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.rez; name = TheoraDecoder.r; path = src/TheoraDecoder.r; sourceTree = "<group>"; };
+		7380D66709D9859D00A36679 /* Ogg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Ogg.framework; path = /Library/Frameworks/Ogg.framework; sourceTree = "<absolute>"; };
+		7380D66D09D985B800A36679 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
+		7380D6E809D98EEE00A36679 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debug.h; path = ../utils/debug.h; sourceTree = SOURCE_ROOT; };
+		8D01CCD10486CAD60068D4B7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
+		8D01CCD20486CAD60068D4B7 /* Theora.component */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Theora.component; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		8D01CCCD0486CAD60068D4B7 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */,
+				7380D66909D9859D00A36679 /* Ogg.framework in Frameworks */,
+				7380D66E09D985B800A36679 /* QuickTime.framework in Frameworks */,
+				7321B37E0A022D43004A699F /* TheoraExp.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		089C166AFE841209C02AAC07 /* Theora */ = {
+			isa = PBXGroup;
+			children = (
+				08FB77ADFE841716C02AAC07 /* Source */,
+				089C167CFE841241C02AAC07 /* Resources */,
+				089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
+				19C28FB4FE9D528D11CA2CBB /* Products */,
+			);
+			name = Theora;
+			sourceTree = "<group>";
+		};
+		089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = {
+			isa = PBXGroup;
+			children = (
+				7321B37D0A022D43004A699F /* TheoraExp.framework */,
+				7380D66709D9859D00A36679 /* Ogg.framework */,
+				7380D66D09D985B800A36679 /* QuickTime.framework */,
+				08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */,
+			);
+			name = "External Frameworks and Libraries";
+			sourceTree = "<group>";
+		};
+		089C167CFE841241C02AAC07 /* Resources */ = {
+			isa = PBXGroup;
+			children = (
+				7380D65F09D9854100A36679 /* TheoraDecoder.r */,
+				7380D65809D984FD00A36679 /* icon.icns */,
+				7380D65909D984FD00A36679 /* icon.r */,
+				8D01CCD10486CAD60068D4B7 /* Info.plist */,
+				089C167DFE841241C02AAC07 /* InfoPlist.strings */,
+			);
+			name = Resources;
+			sourceTree = "<group>";
+		};
+		08FB77ADFE841716C02AAC07 /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				7321B3C20A04F91D004A699F /* decoder_types.h */,
+				7321B3B10A04F1CC004A699F /* TheoraDecoder.h */,
+				7380D6E809D98EEE00A36679 /* debug.h */,
+				7380D65B09D9853300A36679 /* theora_versions.h */,
+				7380D65C09D9853300A36679 /* TheoraDecoder.c */,
+				7380D65D09D9853300A36679 /* TheoraDecoderDispatch.h */,
+				7380D65609D984CD00A36679 /* fccs.h */,
+				7380D65709D984CD00A36679 /* data_types.h */,
+				7380D65509D9849B00A36679 /* config.h */,
+				32BAE0B30371A71500C91783 /* Theora_Prefix.pch */,
+			);
+			name = Source;
+			sourceTree = "<group>";
+		};
+		19C28FB4FE9D528D11CA2CBB /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				8D01CCD20486CAD60068D4B7 /* Theora.component */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		8D01CCC60486CAD60068D4B7 /* Theora */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 4FADC23308B4156C00ABE55E /* Build configuration list for PBXNativeTarget "Theora" */;
+			buildPhases = (
+				8D01CCC90486CAD60068D4B7 /* Resources */,
+				8D01CCCB0486CAD60068D4B7 /* Sources */,
+				8D01CCCD0486CAD60068D4B7 /* Frameworks */,
+				7380D69D09D987FC00A36679 /* Rez */,
+				7380D6A209D9886500A36679 /* ShellScript */,
+			);
+			buildRules = (
+			);
+			buildSettings = {
+			};
+			dependencies = (
+			);
+			name = Theora;
+			productInstallPath = "$(HOME)/Library/Bundles";
+			productName = Theora;
+			productReference = 8D01CCD20486CAD60068D4B7 /* Theora.component */;
+			productType = "com.apple.product-type.bundle";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		089C1669FE841209C02AAC07 /* Project object */ = {
+			isa = PBXProject;
+			buildConfigurationList = 4FADC23708B4156C00ABE55E /* Build configuration list for PBXProject "Theora" */;
+			buildSettings = {
+			};
+			buildStyles = (
+				4F9091AC011F3BD104CA0E50 /* Debug */,
+				4F9091AD011F3BD104CA0E50 /* Release */,
+			);
+			hasScannedForEncodings = 1;
+			mainGroup = 089C166AFE841209C02AAC07 /* Theora */;
+			projectDirPath = "";
+			targets = (
+				8D01CCC60486CAD60068D4B7 /* Theora */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		8D01CCC90486CAD60068D4B7 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				8D01CCCA0486CAD60068D4B7 /* InfoPlist.strings in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+		7380D69D09D987FC00A36679 /* Rez */ = {
+			isa = PBXRezBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				7380D6A009D9884600A36679 /* TheoraDecoder.r in Rez */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+		7380D6A209D9886500A36679 /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+				../resources/icon.r,
+				../resources/icon.icns,
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "cd ../resources\n${SYSTEM_DEVELOPER_TOOLS}/Rez -o \"${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}\"/$'Icon\\x0D' icon.r\n${SYSTEM_DEVELOPER_TOOLS}/SetFile -a CE \"${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}\"";
+		};
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		8D01CCCB0486CAD60068D4B7 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				7380D65E09D9853300A36679 /* TheoraDecoder.c in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+		089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {
+			isa = PBXVariantGroup;
+			children = (
+				089C167EFE841241C02AAC07 /* English */,
+			);
+			name = InfoPlist.strings;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		4FADC23408B4156C00ABE55E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				EXPORTED_SYMBOLS_FILE = src/Theora.exp;
+				GCC_DYNAMIC_NO_PIC = NO;
+				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 = "$(HOME)/Library/QuickTime";
+				PRODUCT_NAME = Theora;
+				WRAPPER_EXTENSION = component;
+				ZERO_LINK = YES;
+			};
+			name = Debug;
+		};
+		4FADC23508B4156C00ABE55E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ARCHS = (
+					ppc,
+					i386,
+				);
+				EXPORTED_SYMBOLS_FILE = src/Theora.exp;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				GCC_PRECOMPILE_PREFIX_HEADER = YES;
+				GCC_PREFIX_HEADER = Theora_Prefix.pch;
+				INFOPLIST_FILE = Info.plist;
+				INSTALL_PATH = "$(HOME)/Library/QuickTime";
+				PRODUCT_NAME = Theora;
+				WRAPPER_EXTENSION = component;
+			};
+			name = Release;
+		};
+		4FADC23808B4156C00ABE55E /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(FRAMEWORK_SEARCH_PATHS)",
+					"$(LOCAL_LIBRARY_DIR)/Frameworks",
+				);
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"$(GCC_PREPROCESSOR_DEFINITIONS)",
+					__MACOSX__,
+				);
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				OTHER_REZFLAGS = "$(OTHER_REZFLAGS) -D TARGET_REZ_MAC_PPC=1 -D BUILD_UNIVERSAL";
+				PREBINDING = NO;
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Debug;
+		};
+		4FADC23908B4156C00ABE55E /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(FRAMEWORK_SEARCH_PATHS)",
+					"$(LOCAL_LIBRARY_DIR)/Frameworks",
+				);
+				GCC_OPTIMIZATION_LEVEL = 3;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"$(GCC_PREPROCESSOR_DEFINITIONS)",
+					__MACOSX__,
+				);
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				OTHER_CFLAGS = (
+					"$(OTHER_CFLAGS)",
+					"-falign-loops=16",
+					"-ffast-math",
+				);
+				OTHER_REZFLAGS = "$(OTHER_REZFLAGS) -D TARGET_REZ_MAC_PPC=1 -D BUILD_UNIVERSAL";
+				PREBINDING = NO;
+				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		4FADC23308B4156C00ABE55E /* Build configuration list for PBXNativeTarget "Theora" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				4FADC23408B4156C00ABE55E /* Debug */,
+				4FADC23508B4156C00ABE55E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		4FADC23708B4156C00ABE55E /* Build configuration list for PBXProject "Theora" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				4FADC23808B4156C00ABE55E /* Debug */,
+				4FADC23908B4156C00ABE55E /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 089C1669FE841209C02AAC07 /* Project object */;
+}

Added: trunk/xiph-qt/Theora/Theora_Prefix.pch
===================================================================
--- trunk/xiph-qt/Theora/Theora_Prefix.pch	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/Theora_Prefix.pch	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,5 @@
+//
+// Prefix header for all source files of the 'Theora' target in the 'Theora' project.
+//
+
+#include <Carbon/Carbon.h>

Added: trunk/xiph-qt/Theora/src/Theora.exp
===================================================================
--- trunk/xiph-qt/Theora/src/Theora.exp	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/Theora.exp	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1 @@
+_Theora_ImageCodecComponentDispatch

Added: trunk/xiph-qt/Theora/src/TheoraDecoder.c
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoder.c	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/TheoraDecoder.c	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,720 @@
+/*
+ *  TheoraDecoder.c
+ *
+ *    Theora video decoder (ImageCodec) implementation.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+/*
+ *  The implementation in this file is based on the 'ElectricImageCodec' and
+ *  the 'ExampleIPBCodec' example QuickTime components.
+ */
+
+#if defined(__APPLE_CC__)
+#include <Carbon/Carbon.h>
+#include <QuickTime/QuickTime.h>
+#else
+#include <ConditionalMacros.h>
+#include <Endian.h>
+#include <QuickTimeComponents.h>
+#include <ImageCodec.h>
+#endif /* __APPLE_CC__ */
+
+#include "decoder_types.h"
+#include "theora_versions.h"
+
+#include "data_types.h"
+#include "TheoraDecoder.h"
+#include "debug.h"
+
+
+static OSStatus CopyPlanarYCbCr420ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy);
+static OSStatus CopyPlanarYCbCr422ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy);
+static OSStatus CopyPlanarYCbCr444ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy);
+static OSErr CopyPlanarYCbCr422ToPlanarYUV422(th_ycbcr_buffer ycbcr, ICMDataProcRecordPtr dataProc, UInt8 *baseAddr, long stride, long width, long height);
+
+// Setup required for ComponentDispatchHelper.c
+#define IMAGECODEC_BASENAME() 		Theora_ImageCodec
+#define IMAGECODEC_GLOBALS() 		Theora_Globals storage
+
+#define CALLCOMPONENT_BASENAME()	IMAGECODEC_BASENAME()
+#define	CALLCOMPONENT_GLOBALS()		IMAGECODEC_GLOBALS()
+
+#define COMPONENT_UPP_PREFIX()		uppImageCodec
+#define COMPONENT_DISPATCH_FILE		"TheoraDecoderDispatch.h"
+#define COMPONENT_SELECT_PREFIX()  	kImageCodec
+
+#define	GET_DELEGATE_COMPONENT()	(storage->delegateComponent)
+
+#if defined(__APPLE_CC__)
+#include <CoreServices/Components.k.h>
+#include <QuickTime/ImageCodec.k.h>
+#include <QuickTime/ComponentDispatchHelper.c>
+#else
+#include <Components.k.h>
+#include <ImageCodec.k.h>
+#include <ComponentDispatchHelper.c>
+#endif /* __APPLE_CC__ */
+
+
+OSErr init_theora_decoder(Theora_Globals glob, CodecDecompressParams *p)
+{
+    OSErr err = noErr;
+    Handle ext;
+    OggSerialNoAtom *atom;
+    Byte *ptrheader, *mCookie;
+    UInt32 mCookieSize;
+    CookieAtomHeader *aheader;
+    th_comment tc;
+    ogg_packet op;
+    int i = 0;
+
+    if (glob->info_initialised) {
+        dbg_printf("--:Theora:- Decoder already initialised, skipping...\n");
+        return err;
+    }
+
+    err = GetImageDescriptionExtension(p->imageDescription, &ext, kSampleDescriptionExtensionTheora, 1);
+    if (err != noErr) {
+        dbg_printf("XXX GetImageDescriptionExtension() failed!\n");
+        err = codecBadDataErr;
+        return err;
+    }
+
+    mCookie = *ext;
+    mCookieSize = GetHandleSize(ext);
+
+    atom = (OggSerialNoAtom*)mCookie;
+    ptrheader = mCookie + EndianU32_BtoN(atom->size);
+    aheader = (CookieAtomHeader*)ptrheader;
+
+    err = codecBadDataErr;
+    // scan quickly through the cookie, check types and packet sizes
+    if (EndianS32_BtoN(atom->type) != kCookieTypeOggSerialNo || (UInt32) (ptrheader - mCookie) > mCookieSize)
+        return err;
+    ptrheader += EndianU32_BtoN(aheader->size);
+    if (EndianS32_BtoN(aheader->type) != kCookieTypeTheoraHeader || (UInt32) (ptrheader - mCookie) > mCookieSize)
+        return err;
+    aheader = (CookieAtomHeader*) ptrheader;
+    ptrheader += EndianU32_BtoN(aheader->size);
+    if (EndianS32_BtoN(aheader->type) != kCookieTypeTheoraComments || (UInt32) (ptrheader - mCookie) > mCookieSize)
+        return err;
+    aheader = (CookieAtomHeader*) ptrheader;
+    ptrheader += EndianU32_BtoN(aheader->size);
+    if (EndianS32_BtoN(aheader->type) != kCookieTypeTheoraCodebooks || (UInt32) (ptrheader - mCookie) > mCookieSize)
+        return err;
+
+    // all OK, back to the first theora packet
+    aheader = (CookieAtomHeader*) (mCookie + EndianU32_BtoN(atom->size));
+
+    th_info_init(&glob->ti);
+    th_comment_init(&tc);
+    glob->ts = NULL;
+
+    op.b_o_s = 1;
+    op.e_o_s = 0;
+    op.granulepos = 0;
+    op.packetno = 0;
+    op.bytes = EndianU32_BtoN(aheader->size) - 2 * sizeof(long); // FIXME??
+    op.packet = aheader->data;
+
+    if (th_decode_headerin(&glob->ti, &tc, &glob->ts, &op) < 0) {
+
+        if (glob->ts != NULL)
+            th_setup_free (glob->ts);
+        th_comment_clear(&tc);
+        th_info_clear(&glob->ti);
+
+        return err;
+    }
+
+    op.b_o_s = 0;
+
+    while (i < 2) {
+        aheader = (CookieAtomHeader*) ((Byte*) (aheader) + EndianU32_BtoN(aheader->size));
+        op.packetno += 1;
+        op.bytes = EndianU32_BtoN(aheader->size) - 2 * sizeof(long); // FIXME??
+        op.packet = aheader->data;
+
+        th_decode_headerin(&glob->ti, &tc, &glob->ts, &op);
+        i++;
+    }
+
+    err = noErr;
+
+    th_comment_clear(&tc);
+
+    dbg_printf("--:Theora:- OK, managed to initialize the decoder somehow...\n");
+    glob->info_initialised = true;
+
+    return err;
+}
+
+
+pascal ComponentResult Theora_ImageCodecOpen(Theora_Globals glob, ComponentInstance self)
+{
+	ComponentResult err;
+
+	glob = (Theora_Globals)NewPtrClear(sizeof(Theora_GlobalsRecord));
+        dbg_printf("\n--:Theora:- CodecOpen(%08lx) called\n", (long)glob);
+	if (err = MemError()) goto bail;
+
+	SetComponentInstanceStorage(self, (Handle)glob);
+
+	glob->self = self;
+	glob->target = self;
+	glob->wantedDestinationPixelTypeH = (OSType **)NewHandle(sizeof(OSType) * (kNumPixelFormatsSupported + 1));
+	if (err = MemError()) goto bail;
+	glob->drawBandUPP = NULL;
+        glob->info_initialised = false;
+        glob->last_frame = -1;
+
+        glob->p_buffer = NewPtr(kPacketBufferAllocIncrement);
+        glob->p_buffer_len = kPacketBufferAllocIncrement;
+        glob->p_buffer_used = 0;
+
+        // many of the functions are delegated actually
+	err = OpenADefaultComponent(decompressorComponentType, kBaseCodecType, &glob->delegateComponent);
+	if (err) goto bail;
+
+	ComponentSetTarget(glob->delegateComponent, self);
+
+bail:
+	return err;
+}
+
+pascal ComponentResult Theora_ImageCodecClose(Theora_Globals glob, ComponentInstance self)
+{
+    dbg_printf("--:Theora:- CodecClose(%08lx) called\n\n", (long)glob);
+	// Make sure to close the base component and dealocate our storage
+	if (glob) {
+		if (glob->delegateComponent) {
+			CloseComponent(glob->delegateComponent);
+		}
+		if (glob->wantedDestinationPixelTypeH) {
+			DisposeHandle((Handle)glob->wantedDestinationPixelTypeH);
+		}
+		if (glob->drawBandUPP) {
+			DisposeImageCodecMPDrawBandUPP(glob->drawBandUPP);
+		}
+
+                if (glob->p_buffer) {
+                    DisposePtr((Ptr) glob->p_buffer);
+                    glob->p_buffer = NULL;
+                }
+		DisposePtr((Ptr)glob);
+	}
+
+	return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecVersion(Theora_Globals glob)
+{
+#pragma unused(glob)
+    return kTheora_imdc_Version;
+}
+
+pascal ComponentResult Theora_ImageCodecTarget(Theora_Globals glob, ComponentInstance target)
+{
+    glob->target = target;
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecInitialize(Theora_Globals glob, ImageSubCodecDecompressCapabilities *cap)
+{
+    dbg_printf("--:Theora:- CodecInitalize(%08lx) called\n", (long)glob);
+
+    cap->decompressRecordSize = sizeof(Theora_DecompressRecord);
+    cap->canAsync = true;
+
+    if (cap->recordSize > offsetof(ImageSubCodecDecompressCapabilities, baseCodecShouldCallDecodeBandForAllFrames) ) {
+        cap->subCodecIsMultiBufferAware = true;
+        cap->baseCodecShouldCallDecodeBandForAllFrames = true;
+    }
+
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecPreflight(Theora_Globals glob, CodecDecompressParams *p)
+{
+    CodecCapabilities *capabilities = p->capabilities;
+    OSTypePtr         formats = *glob->wantedDestinationPixelTypeH;
+    OSErr             ret = noErr;
+
+    dbg_printf("--:Theora:- CodecPreflight(%08lx) called (seqid: %08lx, frN: %8ld, first: %d, data1: %02x)\n",
+               (long)glob, p->sequenceID, p->frameNumber, (p->conditionFlags & codecConditionFirstFrame) != 1, p->data[0]);
+    dbg_printf("         :- image: %dx%d, pixform: %x\n", (**p->imageDescription).width, (**p->imageDescription).height, glob->ti.pixel_fmt);
+
+    /* only decode full images at the moment */
+    capabilities->bandMin = (**p->imageDescription).height;
+    capabilities->bandInc = capabilities->bandMin;
+
+    capabilities->wantedPixelSize  = 0;
+    p->wantedDestinationPixelTypes = glob->wantedDestinationPixelTypeH;
+
+    capabilities->extendWidth = 0;
+    capabilities->extendHeight = 0;
+
+    ret = init_theora_decoder(glob, p);
+
+    if (ret == noErr) {
+        *formats++  = k422YpCbCr8PixelFormat;
+        if (glob->ti.pixel_fmt == TH_PF_420)
+            *formats++  = kYUV420PixelFormat;
+        *formats++	= 0;
+    }
+
+    return ret;
+}
+
+pascal ComponentResult Theora_ImageCodecBeginBand(Theora_Globals glob, CodecDecompressParams *p, ImageSubCodecDecompressRecord *drp, long flags)
+{
+#pragma unused(flags)
+    long offsetH, offsetV;
+    Theora_DecompressRecord *myDrp = (Theora_DecompressRecord *)drp->userDecompressRecord;
+
+    dbg_printf("--:Theora:- CodecBeginBand(%08lx, %08lx, %08lx) called (seqid: %08lx, frN: %8ld, first: %d, data1: %02x) (pixF: '%4.4s')\n",
+               (long)glob, (long)drp, (long)myDrp, p->sequenceID, p->frameNumber, (p->conditionFlags & codecConditionFirstFrame) != 1,
+               p->data[0], &p->dstPixMap.pixelFormat);
+    if (p->frameTime != NULL) {
+        dbg_printf("--:Theora:-      BeginBand::frameTime: scale: %8ld, duration: %8ld, rate: %5ld.%05ld (vd: %8ld)\n",
+                   p->frameTime->scale, p->frameTime->duration, p->frameTime->rate >> 16, p->frameTime->rate & 0xffff,
+                   (p->frameTime->flags & icmFrameTimeHasVirtualStartTimeAndDuration) ? p->frameTime->virtualDuration : -1);
+    }
+
+#if 0
+    switch (p->dstPixMap.pixelFormat) {
+    case k422YpCbCr8PixelFormat:
+        offsetH = (long)(p->dstRect.left - p->dstPixMap.bounds.left) * (long)(p->dstPixMap.pixelSize >> 3);
+        offsetV = (long)(p->dstRect.top - p->dstPixMap.bounds.top) * (long)drp->rowBytes;
+
+        drp->baseAddr = p->dstPixMap.baseAddr + offsetH + offsetV;
+        break;
+
+    case kYUV420PixelFormat:
+        //drp->baseAddr = p->dstPixMap.baseAddr;
+        break;
+
+    default:
+        //should not happen!
+        return codecErr;
+    }
+#endif /* 0 */
+
+    if ((*(unsigned char *)drp->codecData) & 0x40 == 0)
+        drp->frameType = kCodecFrameTypeKey;
+    else
+        drp->frameType = kCodecFrameTypeDifference;
+
+    myDrp->width = (**p->imageDescription).width;
+    myDrp->height = (**p->imageDescription).height;
+    myDrp->depth = (**p->imageDescription).depth;
+    myDrp->dataSize = p->bufferSize;
+    myDrp->frameNumber = p->frameNumber;
+    myDrp->pixelFormat = p->dstPixMap.pixelFormat;
+    myDrp->draw = 0;
+
+    if (glob->last_frame < 0) {
+        dbg_printf("--:Theora:-  calling theora_decode_init()...\n");
+        glob->td = th_decode_alloc(&glob->ti, glob->ts);
+        glob->last_frame = 0;
+    }
+
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecDecodeBand(Theora_Globals glob, ImageSubCodecDecompressRecord *drp, unsigned long flags)
+{
+    OSErr err = noErr;
+    Theora_DecompressRecord *myDrp = (Theora_DecompressRecord *)drp->userDecompressRecord;
+    unsigned char *dataPtr = (unsigned char *)drp->codecData;
+    ICMDataProcRecordPtr dataProc = drp->dataProcRecord.dataProc ? &drp->dataProcRecord : NULL;
+    SInt32 dataAvailable = dataProc != NULL ? codecMinimumDataSize : -1;
+
+    dbg_printf("--:Theora:-  CodecDecodeBand(%08lx, %08lx, %08lx) cald (                 frN: %8ld, dataProc: %8lx)\n",
+               (long)glob, (long)drp, (long)myDrp, myDrp->frameNumber, (long)dataProc);
+
+#if 0
+    // TODO: implement using dataProc for loading data if not all available at once
+    if (dataAvailable > -1) {
+        unsigned char *tmpDataPtr = dataPtr;
+        UInt32 bytesToLoad = myDrp->dataSize;
+        while (dataAvailable > 0) {
+            err = dataProc->dataProc((Ptr *)&dataPtr, dataNeeded, dataProc->dataRefCon);
+            if (err == eofErr)
+                err = noErr;
+        }
+    }
+#endif /* 0 */
+
+    
+    {
+        ogg_packet op;
+        int terr;
+        Boolean drop = false;
+        Boolean continued = (glob->p_buffer_used > 0);
+        UInt8 *data_buffer = dataPtr;
+        UInt32 data_size = myDrp->dataSize;
+
+        if (glob->last_frame + 1 != myDrp->frameNumber) {
+            glob->p_buffer_used = 0;
+            continued = false;
+        }
+
+        glob->last_frame = myDrp->frameNumber;
+
+        if (myDrp->dataSize % 255 == 4) {
+            // TODO: extend the checks below with frame duration checks
+            if (!memcmp(dataPtr + myDrp->dataSize - 4, "OggS", 4)) {
+                err = codecDroppedFrameErr;
+                drop = true;
+                if (myDrp->dataSize + glob->p_buffer_used > glob->p_buffer_len) {
+                    // TODO: implement reallocation with expansion
+                    err = codecErr;
+                } else {
+                    BlockMoveData(dataPtr, glob->p_buffer + glob->p_buffer_used, myDrp->dataSize - 4);
+                    glob->p_buffer_used += myDrp->dataSize - 4;
+                }
+            }
+        } else if (myDrp->dataSize == 1) {
+            myDrp->dataSize = 0;
+            myDrp->draw = 1;
+        } else {
+            myDrp->draw = 1;
+        }
+
+        if (!drop && continued) {
+            /* this should be the last fragment */
+            if (myDrp->dataSize > 0)
+                BlockMoveData(dataPtr, glob->p_buffer + glob->p_buffer_used, myDrp->dataSize);
+            data_size = myDrp->dataSize + glob->p_buffer_used;
+            glob->p_buffer_used = 0;
+            data_buffer = glob->p_buffer;
+        }
+
+        if (drop)
+            err = codecDroppedFrameErr;
+
+        if (!drop && myDrp->draw != 0) {
+            op.b_o_s = 0;
+            op.e_o_s = 0;
+            op.granulepos = -1;
+            op.packetno = myDrp->frameNumber + 3;
+            op.bytes = data_size;
+            op.packet = data_buffer;
+            terr = th_decode_packetin(glob->td, &op, NULL);
+            dbg_printf("--:Theora:-  theora_decode_packetin() = %d\n", terr);
+
+            if (terr != 0) {
+                myDrp->draw = 0;
+                err = codecDroppedFrameErr;
+            }
+        }
+    }
+
+    
+    return err;
+}
+
+
+pascal ComponentResult Theora_ImageCodecDrawBand(Theora_Globals glob, ImageSubCodecDecompressRecord *drp)
+{
+    OSErr err = noErr;
+    Theora_DecompressRecord *myDrp = (Theora_DecompressRecord *)drp->userDecompressRecord;
+    unsigned char *dataPtr = (unsigned char *)drp->codecData;
+    ICMDataProcRecordPtr dataProc = drp->dataProcRecord.dataProc ? &drp->dataProcRecord : NULL;
+
+    dbg_printf("--:Theora:-  CodecDrawBand(%08lx, %08lx, %08lx) called (                 frN: %8ld, dataProc: %8lx)\n",
+               (long)glob, (long)drp, (long)myDrp, myDrp->frameNumber, (long)dataProc);
+
+    if (myDrp->draw == 0)
+        err = codecDroppedFrameErr;
+    else {
+        th_ycbcr_buffer ycbcrB;
+        dbg_printf("--:Theora:-  calling theora_decode_YUVout()...\n");
+        th_decode_ycbcr_out(glob->td, ycbcrB);
+        if (myDrp->pixelFormat == k422YpCbCr8PixelFormat) {
+            if (glob->ti.pixel_fmt == TH_PF_420) {
+                err = CopyPlanarYCbCr420ToChunkyYUV422(myDrp->width, myDrp->height, ycbcrB, (UInt8 *)drp->baseAddr, drp->rowBytes);
+            } else if (glob->ti.pixel_fmt == TH_PF_422) {
+                err = CopyPlanarYCbCr422ToChunkyYUV422(myDrp->width, myDrp->height, ycbcrB, (UInt8 *)drp->baseAddr, drp->rowBytes);
+            } else if (glob->ti.pixel_fmt == TH_PF_444) {
+                err = CopyPlanarYCbCr444ToChunkyYUV422(myDrp->width, myDrp->height, ycbcrB, (UInt8 *)drp->baseAddr, drp->rowBytes);
+            } else {
+                dbg_printf("--:Theora:-  'What PLANET is this!?' (%d)\n", glob->ti.pixel_fmt);
+                err = codecBadDataErr;
+            }
+        } else if (myDrp->pixelFormat == kYUV420PixelFormat) {
+            err = CopyPlanarYCbCr422ToPlanarYUV422(ycbcrB, dataProc, (UInt8 *)drp->baseAddr, drp->rowBytes, myDrp->width, myDrp->height);
+        }
+    }
+
+    //err = noErr;
+    //err = codecBadDataErr;
+    return err;
+}
+
+pascal ComponentResult Theora_ImageCodecEndBand(Theora_Globals glob, ImageSubCodecDecompressRecord *drp, OSErr result, long flags)
+{
+#pragma unused(glob, drp,result, flags)
+    dbg_printf("--:Theora:-   CodecEndBand(%08lx, %08lx, %08lx, %08lx) called\n", (long)glob, (long)drp, (long)drp->userDecompressRecord, result);
+
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecQueueStarting(Theora_Globals glob)
+{
+#pragma unused(glob)
+    dbg_printf("--:Theora:- CodecQueueStarting(%08lx) called\n", (long)glob);
+
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecQueueStopping(Theora_Globals glob)
+{
+#pragma unused(glob)
+    dbg_printf("--:Theora:- CodecQueueStopping(%08lx) called\n", (long)glob);
+
+    return noErr;
+}
+
+pascal ComponentResult Theora_ImageCodecGetCompressedImageSize(Theora_Globals glob, ImageDescriptionHandle desc,
+                                                               Ptr data, long dataSize, ICMDataProcRecordPtr dataProc, long *size)
+{
+#pragma	unused(glob,dataSize,dataProc,desc)
+    dbg_printf("--:Theora:- CodecGetCompressedImageSize(%08lx) called (dataSize: %8ld)\n", (long)glob, dataSize);
+
+    if (size == NULL)
+        return paramErr;
+
+    //size = 0;
+    //return noErr;
+    return unimpErr;
+}
+
+pascal ComponentResult Theora_ImageCodecGetCodecInfo(Theora_Globals glob, CodecInfo *info)
+{
+    OSErr err = noErr;
+    dbg_printf("--:Theora:- CodecGetCodecInfo(%08lx) called\n", (long)glob);
+
+    if (info == NULL) {
+        err = paramErr;
+    }
+    else {
+        CodecInfo **tempCodecInfo;
+
+        err = GetComponentResource((Component)glob->self, codecInfoResourceType, kTheoraDecoderResID, (Handle *)&tempCodecInfo);
+        if (err == noErr) {
+            *info = **tempCodecInfo;
+            DisposeHandle((Handle)tempCodecInfo);
+        }
+    }
+
+    return err;
+}
+
+
+#pragma mark-
+
+#if TARGET_RT_BIG_ENDIAN
+#define PACK_2VUY(Cb, Y1, Cr, Y2) ((UInt32) (((Cb) << 24) | ((Y1) << 16) | ((Cr) << 8) | (Y2)))
+#else
+#define PACK_2VUY(Cb, Y1, Cr, Y2) ((UInt32) ((Cb) | ((Y1) << 8) | ((Cr) << 16) | ((Y2) << 24)))
+#endif /* TARGET_RT_BIG_ENDIAN */
+
+OSStatus CopyPlanarYCbCr420ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
+{
+    dbg_printf("BLIT: Yw: %d, Yh: %d, Ys: %d;  w: %ld,  h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+    dbg_printf("BLIT: Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d;     Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+               pb[2].width, pb[2].height, pb[2].ystride);
+
+    size_t x, y;
+    const UInt8 *lineBase_Y  = pb[0].data;
+    const UInt8 *lineBase_Cb = pb[1].data;
+    const UInt8 *lineBase_Cr = pb[2].data;
+    UInt8 *lineBase_2vuy = baseAddr_2vuy;
+    for( y = 0; y < height; y += 2 ) {
+        // Take two lines at a time.
+        const UInt8 *pixelPtr_Y_top  = lineBase_Y;
+        const UInt8 *pixelPtr_Y_bot  = lineBase_Y  + pb[0].ystride;
+        const UInt8 *pixelPtr_Cb = lineBase_Cb;
+        const UInt8 *pixelPtr_Cr = lineBase_Cr;
+        UInt8 *pixelPtr_2vuy_top = lineBase_2vuy;
+        UInt8 *pixelPtr_2vuy_bot = lineBase_2vuy + rowBytes_2vuy;
+        for( x = 0; x < width; x += 2 ) {
+            *((UInt32 *)pixelPtr_2vuy_top) = PACK_2VUY(*pixelPtr_Cb, *pixelPtr_Y_top, *pixelPtr_Cr, *(pixelPtr_Y_top + 1));
+            pixelPtr_2vuy_top += 4;
+            pixelPtr_Y_top += 2;
+
+            *((UInt32 *)pixelPtr_2vuy_bot) = PACK_2VUY(*pixelPtr_Cb++, *pixelPtr_Y_bot, *pixelPtr_Cr++, *(pixelPtr_Y_bot + 1));
+            pixelPtr_2vuy_bot += 4;
+            pixelPtr_Y_bot += 2;
+        }
+
+        lineBase_Y += 2 * pb[0].ystride;
+        lineBase_Cb += pb[1].ystride;
+        lineBase_Cr += pb[2].ystride;
+        lineBase_2vuy += 2 * rowBytes_2vuy;
+    }
+    return noErr;
+}
+
+OSStatus CopyPlanarYCbCr422ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
+{
+    dbg_printf("BLIT> Yw: %d, Yh: %d, Ys: %d;  w: %ld,  h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+    dbg_printf("BLIT> Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d;     Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+               pb[2].width, pb[2].height, pb[2].ystride);
+
+    size_t x, y;
+    const UInt8 *lineBase_Y  = pb[0].data;
+    const UInt8 *lineBase_Cb = pb[1].data;
+    const UInt8 *lineBase_Cr = pb[2].data;
+    UInt8 *lineBase_2vuy = baseAddr_2vuy;
+    for( y = 0; y < height; y += 2 ) {
+        // Take two lines at a time.
+        const UInt8 *pixelPtr_Y_top  = lineBase_Y;
+        const UInt8 *pixelPtr_Y_bot  = lineBase_Y  + pb[0].ystride;
+        const UInt8 *pixelPtr_Cb_top = lineBase_Cb;
+        const UInt8 *pixelPtr_Cb_bot = lineBase_Cb + pb[1].ystride;
+        const UInt8 *pixelPtr_Cr_top = lineBase_Cr;
+        const UInt8 *pixelPtr_Cr_bot = lineBase_Cr + pb[2].ystride;
+        UInt8 *pixelPtr_2vuy_top = lineBase_2vuy;
+        UInt8 *pixelPtr_2vuy_bot = lineBase_2vuy + rowBytes_2vuy;
+        for( x = 0; x < width; x += 2 ) {
+            //*((UInt32 *)pixelPtr_2vuy_top) = (UInt32) ((*pixelPtr_Cb_top++) << 24 | ((*pixelPtr_Y_top)) << 16 | ((*pixelPtr_Cr_top++)) << 8 | ((*(pixelPtr_Y_top+1))));
+            *((UInt32 *)pixelPtr_2vuy_top) = PACK_2VUY(*pixelPtr_Cb_top++, *pixelPtr_Y_top, *pixelPtr_Cr_top++, *(pixelPtr_Y_top + 1));
+            pixelPtr_2vuy_top += 4;
+            pixelPtr_Y_top += 2;
+
+            //*((UInt32 *)pixelPtr_2vuy_bot) = (UInt32) ((*pixelPtr_Cb_bot++) << 24 | ((*pixelPtr_Y_bot)) << 16 | ((*pixelPtr_Cr_bot++)) << 8 | ((*(pixelPtr_Y_bot+1))));
+            *((UInt32 *)pixelPtr_2vuy_bot) = PACK_2VUY(*pixelPtr_Cb_bot++, *pixelPtr_Y_bot, *pixelPtr_Cr_bot++, *(pixelPtr_Y_bot + 1));
+            pixelPtr_2vuy_bot += 4;
+            pixelPtr_Y_bot += 2;
+        }
+
+        lineBase_Y += 2 * pb[0].ystride;
+        lineBase_Cb += 2 * pb[1].ystride;
+        lineBase_Cr += 2 * pb[2].ystride;
+        lineBase_2vuy += 2 * rowBytes_2vuy;
+    }
+    return noErr;
+}
+
+
+/* !!: At the moment this function does nice 'decimation' rather than subsampling!!(?)
+   TODO: proper subsampling? */
+OSStatus CopyPlanarYCbCr444ToChunkyYUV422(size_t width, size_t height, th_ycbcr_buffer pb, UInt8 *baseAddr_2vuy, long rowBytes_2vuy)
+{
+    dbg_printf("BLIT? Yw: %d, Yh: %d, Ys: %d;  w: %ld,  h: %ld; stride: %ld\n", pb[0].width, pb[0].height, pb[0].ystride, width, height, rowBytes_2vuy);
+    dbg_printf("BLIT? Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d;     Rs: %d\n", pb[1].width, pb[1].height, pb[1].ystride,
+               pb[2].width, pb[2].height, pb[2].ystride);
+
+    size_t x, y;
+    const UInt8 *lineBase_Y  = pb[0].data;
+    const UInt8 *lineBase_Cb = pb[1].data;
+    const UInt8 *lineBase_Cr = pb[2].data;
+    UInt8 *lineBase_2vuy = baseAddr_2vuy;
+    for( y = 0; y < height; y += 2 ) {
+        // Take two lines at a time.
+        const UInt8 *pixelPtr_Y_top  = lineBase_Y;
+        const UInt8 *pixelPtr_Y_bot  = lineBase_Y  + pb[0].ystride;
+        const UInt8 *pixelPtr_Cb_top = lineBase_Cb;
+        const UInt8 *pixelPtr_Cb_bot = lineBase_Cb + pb[1].ystride;
+        const UInt8 *pixelPtr_Cr_top = lineBase_Cr;
+        const UInt8 *pixelPtr_Cr_bot = lineBase_Cr + pb[2].ystride;
+        UInt8 *pixelPtr_2vuy_top = lineBase_2vuy;
+        UInt8 *pixelPtr_2vuy_bot = lineBase_2vuy + rowBytes_2vuy;
+        for( x = 0; x < width; x += 2 ) {
+            *((UInt32 *)pixelPtr_2vuy_top) = PACK_2VUY(*pixelPtr_Cb_top, *pixelPtr_Y_top, *pixelPtr_Cr_top, *(pixelPtr_Y_top + 1));
+            pixelPtr_2vuy_top += 4;
+            pixelPtr_Y_top += 2;
+            pixelPtr_Cb_top += 2;
+            pixelPtr_Cr_top += 2;
+
+            *((UInt32 *)pixelPtr_2vuy_bot) = PACK_2VUY(*pixelPtr_Cb_bot, *pixelPtr_Y_bot, *pixelPtr_Cr_bot, *(pixelPtr_Y_bot + 1));
+            pixelPtr_2vuy_bot += 4;
+            pixelPtr_Y_bot += 2;
+            pixelPtr_Cb_bot += 2;
+            pixelPtr_Cr_bot += 2;
+        }
+
+        lineBase_Y += 2 * pb[0].ystride;
+        lineBase_Cb += 2 * pb[1].ystride;
+        lineBase_Cr += 2 * pb[2].ystride;
+        lineBase_2vuy += 2 * rowBytes_2vuy;
+    }
+    return noErr;
+}
+
+/* Presently, This function assumes YCbCr 4:2:0 as input.
+   TODO: take into account different subsampling types? */
+OSErr CopyPlanarYCbCr422ToPlanarYUV422(th_ycbcr_buffer ycbcr, ICMDataProcRecordPtr dataProc, UInt8 *baseAddr, long stride, long width, long height)
+{
+    OSErr err = noErr;
+    UInt8 *endOfScanLine, *dst_base, *src_base;
+    PlanarPixmapInfoYUV420 *pinfo = (PlanarPixmapInfoYUV420 *) baseAddr;
+    UInt32 lines;
+    SInt32 dst_stride, src_stride;
+    endOfScanLine = baseAddr + (width * 4);
+
+    dbg_printf("BLIT= yw: %d, yh: %d, ys: %d; w: %ld, h: %ld; stride: %ld\n", ycbcr[0].width, ycbcr[0].height, ycbcr[0].ystride, width, height, stride);
+    dbg_printf("BLIT= Bw: %d, Bh: %d, Bs: %d; Rw: %d, Rh: %d;     Rs: %d\n", ycbcr[1].width, ycbcr[1].height, ycbcr[1].ystride,
+               ycbcr[2].width, ycbcr[2].height, ycbcr[2].ystride);
+
+    lines = height;
+    dst_base = baseAddr + pinfo->componentInfoY.offset;
+    dst_stride = pinfo->componentInfoY.rowBytes;
+    src_base = ycbcr[0].data;
+    src_stride = ycbcr[0].ystride;
+    while (lines-- > 0) {
+        BlockMoveData(src_base, dst_base, width);
+        src_base += src_stride;
+        dst_base += dst_stride;
+    }
+
+    lines = height / 2;
+    dst_base = baseAddr + pinfo->componentInfoCb.offset;
+    dst_stride = pinfo->componentInfoCb.rowBytes;
+    src_base = ycbcr[1].data;
+    src_stride = ycbcr[1].ystride;
+    while (lines-- > 0) {
+        BlockMoveData(src_base, dst_base, width);
+        src_base += src_stride;
+        dst_base += dst_stride;
+    }
+
+    lines = height / 2;
+    dst_base = baseAddr + pinfo->componentInfoCr.offset;
+    dst_stride = pinfo->componentInfoCr.rowBytes;
+    src_base = ycbcr[2].data;
+    src_stride = ycbcr[2].ystride;
+    while (lines-- > 0) {
+        BlockMoveData(src_base, dst_base, width);
+        src_base += src_stride;
+        dst_base += dst_stride;
+    }
+
+    return err;
+}


Property changes on: trunk/xiph-qt/Theora/src/TheoraDecoder.c
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/xiph-qt/Theora/src/TheoraDecoder.h
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoder.h	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/TheoraDecoder.h	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,50 @@
+/*
+ *  TheoraDecoder.h
+ *
+ *    TheoraDecoder.h - some constants definitions.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+
+#ifndef __theoradecoder_h__
+#define __theoradecoder_h__ 1
+
+#include "theora_versions.h"
+#include "fccs.h"
+
+#define kTheoraDecoderResID                  -17770
+#define kTheoraDecoderNameStringResID        -17770
+#define kTheoraDecoderInfoStringResID        -17771
+
+#define	kTheoraDecoderFormatName  "Xiph Theora"
+
+
+#ifdef _DEBUG
+#define TheoraDecoderName        "Xiph Theora Decoder"
+#else
+#define TheoraDecoderName        ""
+#endif
+
+#endif /* __theoradecoder_h__ */


Property changes on: trunk/xiph-qt/Theora/src/TheoraDecoder.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/xiph-qt/Theora/src/TheoraDecoder.r
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoder.r	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/TheoraDecoder.r	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,151 @@
+/*
+ *  TheoraDecoder.r
+ *
+ *    Information bit definitions for the 'thng' and other TheoraDecoder
+ *    resources.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+
+#define thng_RezTemplateVersion 1
+
+#define cfrg_RezTemplateVersion 1
+
+#ifdef TARGET_REZ_MAC_PPC
+#include <CoreServices/CoreServices.r>
+#include <QuickTime/QuickTime.r>
+#include <QuickTime/QuickTimeComponents.r>
+/* vvv ???
+#undef __CARBON_R__
+#undef __CORESERVICES_R__
+#undef __CARBONCORE_R__
+#undef __COMPONENTS_R__
+   ^^^ */
+#else
+#include "ConditionalMacros.r"
+#include "CoreServices.r"
+#include "QuickTimeComponents.r"
+#include "ImageCodec.r" //??
+//#undef __COMPONENTS_R__ //??
+#endif /* TARGET_REZ_MAC_PPC */
+
+#define TARGET_REZ_CARBON_MACHO 1
+#define TARGET_REZ_MAC_PPC 1
+#define TARGET_REZ_MAC_X86 0
+#define TARGET_REZ_WIN32 0
+
+#include "TheoraDecoder.h"
+
+
+/* How do I do this properly... anybody? */
+#if defined(BUILD_UNIVERSAL)
+  #define TARGET_CPU_PPC 1
+  #define TARGET_CPU_X86 1
+#endif
+
+
+#if TARGET_OS_MAC
+  #if TARGET_CPU_PPC && TARGET_CPU_X86
+    #define TARGET_REZ_FAT_COMPONENTS 1
+    #define Target_PlatformType       platformPowerPCNativeEntryPoint
+    #define Target_SecondPlatformType platformIA32NativeEntryPoint
+  #elif TARGET_CPU_X86
+    #define Target_PlatformType       platformIA32NativeEntryPoint
+  #else
+    #define Target_PlatformType       platformPowerPCNativeEntryPoint
+  #endif
+#elif TARGET_OS_WIN32
+  #define Target_PlatformType platformWin32
+#else
+  #error get a real platform type
+#endif /* TARGET_OS_MAC */
+
+#if !defined(TARGET_REZ_FAT_COMPONENTS)
+  #define TARGET_REZ_FAT_COMPONENTS 0
+#endif
+
+
+#define kTheoraDecoderFlags (codecInfoDoes32 /*| codecInfoDoes16 | codecInfoDoes8 | codecInfoDoes1*/ | codecInfoDoesSpool)
+
+#define kTheoraFormatFlags	(codecInfoDepth32 /* ??! */ | codecInfoDepth24)
+
+resource 'cdci' (kTheoraDecoderResID) {
+	kTheoraDecoderFormatName, // Type
+	1, // Version
+        kTheora_imdc_Version,
+	kXiphComponentsManufacturer, // Manufacturer
+	kTheoraDecoderFlags, // Decompression Flags
+	0, // Compression Flags
+	kTheoraFormatFlags, // Format Flags
+	128, // Compression Accuracy
+	128, // Decomression Accuracy
+	128, // Compression Speed
+	128, // Decompression Speed
+	128, // Compression Level
+	0, // Reserved
+	16, // Minimum Height
+	16, // Minimum Width
+	0, // Decompression Pipeline Latency
+	0, // Compression Pipeline Latency
+	0 // Private Data
+};
+
+resource 'thng' (kTheoraDecoderResID) {
+    decompressorComponentType, kVideoFormatXiphTheora,
+    kXiphComponentsManufacturer, // Manufacturer(??)
+    0, 0, 0, 0,
+    'STR ', kTheoraDecoderNameStringResID,
+    'STR ', kTheoraDecoderInfoStringResID,
+    0, 0, // no icon
+    kTheora_imdc_Version,
+    componentDoAutoVersion|componentHasMultiplePlatforms, 0,
+    {
+        // component platform information
+        kTheoraDecoderFlags,
+        'dlle',
+        kTheoraDecoderResID,
+        Target_PlatformType,
+#if TARGET_REZ_FAT_COMPONENTS
+        kTheoraDecoderFlags,
+        'dlle',
+        kTheoraDecoderResID,
+        Target_SecondPlatformType,
+#endif
+    };
+};
+
+// Component Name
+resource 'STR ' (kTheoraDecoderNameStringResID) {
+	"Xiph Theora Decoder"
+};
+
+// Component Information
+resource 'STR ' (kTheoraDecoderInfoStringResID) {
+	"Decompresses image sequences stored in the Xiph Theora format."
+};
+
+resource 'dlle' (kTheoraDecoderResID) {
+    "Theora_ImageCodecComponentDispatch"
+};


Property changes on: trunk/xiph-qt/Theora/src/TheoraDecoder.r
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/xiph-qt/Theora/src/TheoraDecoderDispatch.h
===================================================================
--- trunk/xiph-qt/Theora/src/TheoraDecoderDispatch.h	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/TheoraDecoderDispatch.h	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,131 @@
+/*
+ *  TheoraDecoderDispatch.h
+ *
+ *    TheoraDecoder component dispatch helper header.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+
+	ComponentSelectorOffset (8)
+
+	ComponentRangeCount (3)
+	ComponentRangeShift (8)
+	ComponentRangeMask	(FF)
+
+	ComponentRangeBegin (0)
+		ComponentError	 (GetMPWorkFunction)
+		ComponentError	 (Unregister)
+		StdComponentCall (Target)
+		ComponentError   (Register)
+		StdComponentCall (Version)
+		StdComponentCall (CanDo)
+		StdComponentCall (Close)
+		StdComponentCall (Open)
+	ComponentRangeEnd (0)
+
+	ComponentRangeBegin (1)
+		ComponentCall     (GetCodecInfo)
+		ComponentDelegate (GetCompressionTime)
+		ComponentDelegate (GetMaxCompressionSize)
+		ComponentDelegate (PreCompress)
+		ComponentDelegate (BandCompress)
+		ComponentDelegate (PreDecompress)
+		ComponentDelegate (BandDecompress)
+		ComponentDelegate (Busy)
+		ComponentCall     (GetCompressedImageSize)
+		ComponentDelegate (GetSimilarity)
+		ComponentDelegate (TrimImage)
+		ComponentDelegate (RequestSettings)
+		ComponentDelegate (GetSettings)
+		ComponentDelegate (SetSettings)
+		ComponentDelegate (Flush)
+		ComponentDelegate (SetTimeCode)
+		ComponentDelegate (IsImageDescriptionEquivalent)
+		ComponentDelegate (NewMemory)
+		ComponentDelegate (DisposeMemory)
+		ComponentDelegate (HitTestData)
+		ComponentDelegate (NewImageBufferMemory)
+		ComponentDelegate (ExtractAndCombineFields)
+		ComponentDelegate (GetMaxCompressionSizeWithSources)
+		ComponentDelegate (SetTimeBase)
+		ComponentDelegate (SourceChanged)
+		ComponentDelegate (FlushLastFrame)
+		ComponentDelegate (GetSettingsAsText)
+		ComponentDelegate (GetParameterListHandle)
+		ComponentDelegate (GetParameterList)
+		ComponentDelegate (CreateStandardParameterDialog)
+		ComponentDelegate (IsStandardParameterDialogEvent)
+		ComponentDelegate (DismissStandardParameterDialog)
+		ComponentDelegate (StandardParameterDialogDoAction)
+		ComponentDelegate (NewImageGWorld)
+		ComponentDelegate (DisposeImageGWorld)
+		ComponentDelegate (HitTestDataWithFlags)
+		ComponentDelegate (ValidateParameters)
+		ComponentDelegate (GetBaseMPWorkFunction)
+		ComponentDelegate (0x0026)
+		ComponentDelegate (0x0027)
+		ComponentDelegate (RequestGammaLevel)
+		ComponentDelegate (GetSourceDataGammaLevel)
+		ComponentDelegate (0x002A)
+		ComponentDelegate (GetDecompressLatency)
+		ComponentDelegate (MergeFloatingImageOntoWindow)
+		ComponentDelegate (RemoveFloatingImage)
+		ComponentDelegate (GetDITLForSize)
+		ComponentDelegate (DITLInstall)
+		ComponentDelegate (DITLEvent)
+		ComponentDelegate (DITLItem)
+		ComponentDelegate (DITLRemove)
+		ComponentDelegate (DITLValidateInput)
+                ComponentDelegate (0x0034)
+                ComponentDelegate (0x0035)
+                ComponentDelegate (GetPreferredChunkSizeAndAlignment)
+		ComponentDelegate (PrepareToCompressFrames)
+		ComponentDelegate (EncodeFrame)
+		ComponentDelegate (CompleteFrame)
+    	        ComponentDelegate (BeginPass)
+    	        ComponentDelegate (EndPass)
+		ComponentDelegate (ProcessBetweenPasses)
+	ComponentRangeEnd (1)
+
+	ComponentRangeUnused (2)
+
+	ComponentRangeBegin (3)
+		ComponentCall (Preflight)
+		ComponentCall (Initialize)
+		ComponentCall (BeginBand)
+		ComponentCall (DrawBand)
+		ComponentCall (EndBand)
+		ComponentCall (QueueStarting)
+		ComponentCall (QueueStopping)
+		ComponentDelegate (DroppingFrame)
+		ComponentDelegate (ScheduleFrame)
+		ComponentDelegate (CancelTrigger)
+		ComponentDelegate (0x020A)
+		ComponentDelegate (0x020B)
+		ComponentDelegate (0x020C)
+		ComponentDelegate (0x020D)
+		ComponentDelegate (0x020E)
+		ComponentCall (DecodeBand)
+	ComponentRangeEnd (3)


Property changes on: trunk/xiph-qt/Theora/src/TheoraDecoderDispatch.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/xiph-qt/Theora/src/decoder_types.h
===================================================================
--- trunk/xiph-qt/Theora/src/decoder_types.h	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/decoder_types.h	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,106 @@
+/*
+ *  decoder_types.h
+ *
+ *    Definitions of TheoraDecoder data structures.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+
+#if !defined(__decoder_types_h__)
+#define __decoder_types_h__
+
+#if defined(__APPLE_CC__)
+#include <QuickTime/QuickTime.h>
+#else
+#include <QuickTimeComponents.h>
+
+#if defined(TARGET_OS_WIN32)
+#define _WINIOCTL_
+#include <windows.h>
+#endif
+
+#if defined(__DO_WE_NEED_ALL_THOSE_P__)
+#include <MacTypes.h>
+#include <MacErrors.h>
+#include <Endian.h>
+#include <MacMemory.h>
+#include <Resources.h>
+#include <Components.h>
+#include <Sound.h>
+#include <QuickTimeComponents.h>
+#include <FixMath.h>
+#include <Math64.h>
+#include <IntlResources.h>
+#include <MoviesFormat.h>
+#include <Gestalt.h>
+#include <TextEncodingConverter.h>
+#endif /* __DO_WE_NEED_ALL_THOSE_P__ */
+#endif /* __APPLE_CC__ */
+
+#if defined(__APPLE_CC__)
+#include <TheoraExp/theoradec.h>
+#else
+#include <theoradec.h>
+#endif /* __APPLE_CC__ */
+
+
+// Constants
+const UInt8 kNumPixelFormatsSupported = 2;
+const UInt32 kPacketBufferAllocIncrement = 64 * 1024;
+
+// Data structures
+typedef struct	{
+    ComponentInstance       self;
+    ComponentInstance       delegateComponent;
+    ComponentInstance       target;
+    OSType**                wantedDestinationPixelTypeH;
+    ImageCodecMPDrawBandUPP drawBandUPP;
+
+    th_info ti;
+    //theora_comment tc;
+    th_setup_info *ts;
+    th_dec_ctx *td;
+    Boolean info_initialised;
+    long last_frame;
+
+    /* packet buffer information */
+    UInt8* p_buffer;
+    UInt32 p_buffer_len;
+    UInt32 p_buffer_used;
+} Theora_GlobalsRecord, *Theora_Globals;
+
+typedef struct {
+    long width;
+    long height;
+    long depth;
+    long dataSize;
+    long frameNumber;
+    long draw;
+    OSType pixelFormat;
+
+    long _padding_unused;
+} Theora_DecompressRecord;
+
+#endif /* __decoder_types_h__ */


Property changes on: trunk/xiph-qt/Theora/src/decoder_types.h
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/xiph-qt/Theora/src/theora_versions.h
===================================================================
--- trunk/xiph-qt/Theora/src/theora_versions.h	2006-04-30 22:24:28 UTC (rev 11324)
+++ trunk/xiph-qt/Theora/src/theora_versions.h	2006-04-30 22:46:08 UTC (rev 11325)
@@ -0,0 +1,42 @@
+/*
+ *  theora_versions.h
+ *
+ *    The current version of the Theora component.
+ *
+ *
+ *  Copyright (c) 2006  Arek Korbik
+ *
+ *  This file is part of XiphQT, the Xiph QuickTime Components.
+ *
+ *  XiphQT 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.
+ *
+ *  XiphQT 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 XiphQT; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ *  Last modified: $Id$
+ *
+ */
+
+
+#if !defined(__theora_versions_h__)
+#define __theora_versions_h__
+
+
+#ifdef DEBUG
+#define kTheora_imdc_Version		(0x00FF0101)
+#else
+#define kTheora_imdc_Version		(0x00000101)
+#endif /* DEBUG */
+
+
+#endif /* __theora_versions_h__ */


Property changes on: trunk/xiph-qt/Theora/src/theora_versions.h
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the commits mailing list